1
1
use 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} ;
5
3
use crate :: load:: SiteCtxt ;
6
4
7
5
use std:: sync:: Arc ;
@@ -50,10 +48,15 @@ async fn handle_push(ctxt: Arc<SiteCtxt>, push: github::Push) -> ServerResult<gi
50
48
// GitHub webhooks have a timeout of 10 seconds, so we process this
51
49
// in the background.
52
50
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 (
54
57
ci_client,
55
58
main_repo_client,
56
- commits ,
59
+ rollup_merges ,
57
60
& previous_master,
58
61
rollup_pr_number,
59
62
)
@@ -63,42 +66,6 @@ async fn handle_push(ctxt: Arc<SiteCtxt>, push: github::Push) -> ServerResult<gi
63
66
Ok ( github:: Response )
64
67
}
65
68
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
-
102
69
async fn handle_issue (
103
70
ctxt : Arc < SiteCtxt > ,
104
71
issue : github:: Issue ,
0 commit comments