@@ -56,8 +56,8 @@ pub async fn handle_merge_queue(ctx: Arc<BorsContext>) -> anyhow::Result<()> {
56
56
let prs = ctx. db . get_merge_queue_prs ( repo_name, priority) . await ?;
57
57
58
58
// Sort PRs according to merge queue priority rules.
59
- // Pending PRs come first - this is important as we make sure to block the queue to
60
- // prevent starting simultaneous auto-builds.
59
+ // Successful builds come first so they can be merged immediately,
60
+ // then pending builds (which block the queue to prevent starting simultaneous auto-builds) .
61
61
let prs = sort_queue_prs ( prs) ;
62
62
63
63
for pr in prs {
@@ -67,11 +67,6 @@ pub async fn handle_merge_queue(ctx: Arc<BorsContext>) -> anyhow::Result<()> {
67
67
let commit_sha = CommitSha ( auto_build. commit_sha . clone ( ) ) ;
68
68
69
69
match auto_build. status {
70
- // Build in progress - stop queue. We can only have one PR built at a time.
71
- BuildStatus :: Pending => {
72
- tracing:: info!( "PR {pr_num} has a pending build - blocking queue" ) ;
73
- break ;
74
- }
75
70
// Build successful - point the base branch to the merged commit.
76
71
BuildStatus :: Success => {
77
72
match repo
@@ -140,6 +135,11 @@ pub async fn handle_merge_queue(ctx: Arc<BorsContext>) -> anyhow::Result<()> {
140
135
141
136
continue ;
142
137
}
138
+ // Build in progress - stop queue. We can only have one PR built at a time.
139
+ BuildStatus :: Pending => {
140
+ tracing:: info!( "PR {pr_num} has a pending build - blocking queue" ) ;
141
+ break ;
142
+ }
143
143
BuildStatus :: Failure | BuildStatus :: Cancelled | BuildStatus :: Timeouted => {
144
144
unreachable ! ( "Failed auto builds should be filtered out by SQL query" ) ;
145
145
}
0 commit comments