summaryrefslogtreecommitdiffstats
path: root/services/pull
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-07-31 16:56:46 +0800
committerGitHub <noreply@github.com>2023-07-31 08:56:46 +0000
commit060026995a95a61a35535215105db015bab8a697 (patch)
treeaadc2fcb3bb6bffce66fe71e4d6c33503a4fd0cf /services/pull
parent0f265a2489bcdac6cf350a89eecb19ed78e133c1 (diff)
downloadgitea-060026995a95a61a35535215105db015bab8a697.tar.gz
gitea-060026995a95a61a35535215105db015bab8a697.zip
Fix pull request check list is limited (#26179) (#26245)
Backport #26179 by @CaiCandong 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 Co-authored-by: caicandong <50507092+CaiCandong@users.noreply.github.com>
Diffstat (limited to 'services/pull')
-rw-r--r--services/pull/commit_status.go2
-rw-r--r--services/pull/pull.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/services/pull/commit_status.go b/services/pull/commit_status.go
index 51ba06da27..39d60380ff 100644
--- a/services/pull/commit_status.go
+++ b/services/pull/commit_status.go
@@ -143,7 +143,7 @@ func GetPullRequestCommitStatusState(ctx context.Context, pr *issues_model.PullR
return "", errors.Wrap(err, "LoadBaseRepo")
}
- commitStatuses, _, err := git_model.GetLatestCommitStatus(ctx, pr.BaseRepo.ID, sha, db.ListOptions{})
+ commitStatuses, _, err := git_model.GetLatestCommitStatus(ctx, pr.BaseRepo.ID, sha, db.ListOptions{ListAll: true})
if err != nil {
return "", errors.Wrap(err, "GetLatestCommitStatus")
}
diff --git a/services/pull/pull.go b/services/pull/pull.go
index 55c400947b..8880bfc6ea 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -794,7 +794,7 @@ func getAllCommitStatus(gitRepo *git.Repository, pr *issues_model.PullRequest) (
return nil, nil, shaErr
}
- statuses, _, err = git_model.GetLatestCommitStatus(db.DefaultContext, pr.BaseRepo.ID, sha, db.ListOptions{})
+ statuses, _, err = git_model.GetLatestCommitStatus(db.DefaultContext, pr.BaseRepo.ID, sha, db.ListOptions{ListAll: true})
lastStatus = git_model.CalcCommitStatus(statuses)
return statuses, lastStatus, err
}