@@ -16,7 +16,6 @@ use crate::bors::{AUTO_BRANCH_NAME, BorsContext, hide_tagged_comments};
1616use crate :: bors:: { PullRequestStatus , RepositoryState } ;
1717use crate :: database:: { PullRequestModel , UpsertPullRequestParams } ;
1818use crate :: github:: CommitSha ;
19- use crate :: utils:: text:: pluralize;
2019use std:: sync:: Arc ;
2120
2221pub ( super ) async fn handle_pull_request_edited (
@@ -243,29 +242,22 @@ pub(super) async fn handle_push_to_branch(
243242 mergeability_queue : & MergeabilityQueueSender ,
244243 payload : PushToBranch ,
245244) -> anyhow:: Result < ( ) > {
246- let affected_prs = db
247- . set_stale_mergeability_status_by_base_branch ( repo_state. repository ( ) , & payload. branch )
245+ db. set_stale_mergeability_status_by_base_branch ( repo_state. repository ( ) , & payload. branch )
248246 . await ?;
249247
250- if !affected_prs. is_empty ( ) {
251- tracing:: info!(
252- "Adding {} {} to the mergeability queue due to a new commit pushed to base branch `{}`" ,
253- affected_prs. len( ) ,
254- pluralize( "PR" , affected_prs. len( ) ) ,
255- payload. branch
256- ) ;
248+ tracing:: info!(
249+ "Adding a batch to the mergeability queue due to a new commit pushed to base branch `{}`" ,
250+ payload. branch
251+ ) ;
257252
258- // Try to find an auto build that matches this SHA
259- let merged_pr = find_pr_by_merged_commit ( & repo_state, & db, CommitSha ( payload. sha ) )
260- . await
261- . ok ( )
262- . flatten ( )
263- . map ( |pr| pr. number ) ;
253+ // Try to find an auto build that matches this SHA
254+ let merged_pr = find_pr_by_merged_commit ( & repo_state, & db, CommitSha ( payload. sha ) )
255+ . await
256+ . ok ( )
257+ . flatten ( )
258+ . map ( |pr| pr. number ) ;
264259
265- for pr in affected_prs {
266- mergeability_queue. enqueue_pr ( & pr, merged_pr) ;
267- }
268- }
260+ mergeability_queue. enqueue_batch ( repo_state. repository ( ) , & payload. branch , merged_pr) ;
269261
270262 Ok ( ( ) )
271263}
0 commit comments