From 983167cf49cd64c7a1f28c39aff03e00dd387990 Mon Sep 17 00:00:00 2001 From: caicandong <50507092+CaiCandong@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:21:09 +0800 Subject: Fix pull request check list is limited (#26179) In the original implementation, we can only get the first 30 records of the commit status (the default paging size), if the commit status is more than 30, it will lead to the bug #25990. I made the following two changes. - On the page, use the ` db.ListOptions{ListAll: true}` parameter instead of `db.ListOptions{}` - The `GetLatestCommitStatus` function makes a determination as to whether or not a pager is being used. fixed #25990 --- models/git/commit_status.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'models/git/commit_status.go') diff --git a/models/git/commit_status.go b/models/git/commit_status.go index 17090f30dd..e7616fb167 100644 --- a/models/git/commit_status.go +++ b/models/git/commit_status.go @@ -283,9 +283,9 @@ func GetLatestCommitStatus(ctx context.Context, repoID int64, sha string, listOp Where("repo_id = ?", repoID).And("sha = ?", sha). Select("max( id ) as id"). GroupBy("context_hash").OrderBy("max( id ) desc") - - sess = db.SetSessionPagination(sess, &listOptions) - + if !listOptions.IsListAll() { + sess = db.SetSessionPagination(sess, &listOptions) + } count, err := sess.FindAndCount(&ids) if err != nil { return nil, count, err -- cgit v1.2.3