@@ -233,12 +233,14 @@ pub async fn rollup_pr_number(
233233 . then_some ( issue. number ) )
234234}
235235
236- pub async fn enqueue_shas (
236+ /// Enqueues the given SHAs and returns the SHAs that were actually enqueued.
237+ pub async fn enqueue_shas < ' a > (
237238 ctxt : & SiteCtxt ,
238239 gh_client : & client:: Client ,
239240 pr_number : u32 ,
240- commits : impl Iterator < Item = & str > ,
241- ) -> Result < ( ) , String > {
241+ commits : impl Iterator < Item = & ' a str > ,
242+ ) -> Result < Vec < & ' a str > , String > {
243+ let mut enqueued = vec ! [ ] ;
242244 let mut msg = String :: new ( ) ;
243245 for commit in commits {
244246 let mut commit_response = gh_client
@@ -251,7 +253,7 @@ pub async fn enqueue_shas(
251253 commit_response. sha,
252254 commit_response. parents. len( )
253255 ) ;
254- return Ok ( ( ) ) ;
256+ continue ;
255257 }
256258 let try_commit = TryCommit {
257259 sha : commit_response. sha ,
@@ -268,6 +270,7 @@ pub async fn enqueue_shas(
268270 . await
269271 . map_err ( |error| format ! ( "Cannot attach SHAs to try benchmark request on PR {pr_number} and SHA {}: {error:?}" , try_commit. sha) ) ?;
270272 if queued {
273+ enqueued. push ( commit) ;
271274 if !msg. is_empty ( ) {
272275 msg. push ( '\n' ) ;
273276 }
@@ -286,7 +289,7 @@ pub async fn enqueue_shas(
286289 let queue_msg = format ! (
287290 r#"There {verb} currently {preceding_artifacts} preceding artifact{suffix} in the [queue](https://perf.rust-lang.org/status.html).
288291It will probably take at least ~{:.1} hours until the benchmark run finishes."# ,
289- ( expected_duration. as_secs_f64( ) / 3600.0 )
292+ expected_duration. as_secs_f64( ) / 3600.0
290293 ) ;
291294
292295 msg. push_str ( & format ! (
@@ -303,7 +306,7 @@ It will probably take at least ~{:.1} hours until the benchmark run finishes."#,
303306 gh_client. post_comment ( pr_number, msg) . await ;
304307 }
305308
306- Ok ( ( ) )
309+ Ok ( enqueued )
307310}
308311
309312/// Counts how many artifacts are in the queue before the specified commit, and what is the expected
0 commit comments