Skip to content

Commit 4c1e248

Browse files
GiteaBotbrechtvllunny
authored
Order pull request conflict checking by recently updated, for each push (#23220) (#23225)
Backport #23220 When a change is pushed to the default branch and many pull requests are open for that branch, conflict checking can take some time. Previously it would go from oldest to newest pull request. Now prioritize pull requests that are likely being actively worked on or prepared for merging. This only changes the order within one push to one repository, but the change is trivial and can already be quite helpful for smaller Gitea instances where a few repositories have most pull requests. A global order would require deeper changes to queues. Co-authored-by: Brecht Van Lommel <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent 5d5f907 commit 4c1e248

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

models/issues/pull_list.go

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequ
111111
return prs, db.GetEngine(db.DefaultContext).
112112
Where("base_repo_id=? AND base_branch=? AND has_merged=? AND issue.is_closed=?",
113113
repoID, branch, false, false).
114+
OrderBy("issue.updated_unix DESC").
114115
Join("INNER", "issue", "issue.id=pull_request.issue_id").
115116
Find(&prs)
116117
}

0 commit comments

Comments
 (0)