11use crate :: api:: { github, ServerResult } ;
2- use crate :: github:: {
3- client, enqueue_sha, enqueue_unrolled_try_builds, parse_homu_comment, rollup_pr_number,
4- } ;
2+ use crate :: github:: { client, enqueue_sha, parse_homu_comment, rollup_pr_number, unroll_rollup} ;
53use crate :: load:: SiteCtxt ;
64
75use std:: sync:: Arc ;
@@ -50,10 +48,15 @@ async fn handle_push(ctxt: Arc<SiteCtxt>, push: github::Push) -> ServerResult<gi
5048 // GitHub webhooks have a timeout of 10 seconds, so we process this
5149 // in the background.
5250 tokio:: spawn ( async move {
53- let result = handle_rollup_merge (
51+ let rollup_merges = commits
52+ . iter ( )
53+ . rev ( )
54+ . skip ( 1 ) // skip the head commit
55+ . take_while ( |c| c. message . starts_with ( "Rollup merge of " ) ) ;
56+ let result = unroll_rollup (
5457 ci_client,
5558 main_repo_client,
56- commits ,
59+ rollup_merges ,
5760 & previous_master,
5861 rollup_pr_number,
5962 )
@@ -63,42 +66,6 @@ async fn handle_push(ctxt: Arc<SiteCtxt>, push: github::Push) -> ServerResult<gi
6366 Ok ( github:: Response )
6467}
6568
66- /// Handler for when a rollup has been merged
67- async fn handle_rollup_merge (
68- ci_client : client:: Client ,
69- main_repo_client : client:: Client ,
70- commits : Vec < github:: Commit > ,
71- previous_master : & str ,
72- rollup_pr_number : u32 ,
73- ) -> Result < ( ) , String > {
74- let rollup_merges = commits
75- . iter ( )
76- . rev ( )
77- . skip ( 1 ) // skip the head commit
78- . take_while ( |c| c. message . starts_with ( "Rollup merge of " ) ) ;
79- let mapping = enqueue_unrolled_try_builds ( ci_client, rollup_merges, previous_master)
80- . await ?
81- . into_iter ( )
82- . fold ( String :: new ( ) , |mut string, c| {
83- use std:: fmt:: Write ;
84- write ! (
85- & mut string,
86- "|#{pr}|[{commit}](https://github.com/rust-lang-ci/rust/commit/{commit})|\n " ,
87- pr = c. original_pr_number,
88- commit = c. sha
89- )
90- . unwrap ( ) ;
91- string
92- } ) ;
93- let msg =
94- format ! ( "📌 Perf builds for each rolled up PR:\n \n \
95- |PR# | Perf Build Sha|\n |----|-----|\n \
96- {mapping}\n In the case of a perf regression, \
97- run the following command for each PR you suspect might be the cause: `@rust-timer build $SHA`") ;
98- main_repo_client. post_comment ( rollup_pr_number, msg) . await ;
99- Ok ( ( ) )
100- }
101-
10269async fn handle_issue (
10370 ctxt : Arc < SiteCtxt > ,
10471 issue : github:: Issue ,
0 commit comments