@@ -120,33 +120,39 @@ async fn handle_issue(
120120 issue : github:: Issue ,
121121 comment : github:: Comment ,
122122) -> ServerResult < github:: Response > {
123+ let main_client = client:: Client :: from_ctxt (
124+ & ctxt,
125+ "https://api.github.com/repos/rust-lang/rust" . to_owned ( ) ,
126+ ) ;
127+ let ci_client = client:: Client :: from_ctxt (
128+ & ctxt,
129+ "https://api.github.com/repos/rust-lang-ci/rust" . to_owned ( ) ,
130+ ) ;
123131 if comment. body . contains ( " homu: " ) {
124132 if let Some ( sha) = parse_homu_comment ( & comment. body ) . await {
125- enqueue_sha ( issue , & ctxt , sha) . await ?;
133+ enqueue_sha ( & ctxt , & main_client , & ci_client , issue . number , sha) . await ?;
126134 return Ok ( github:: Response ) ;
127135 }
128136 }
129137
130138 if comment. body . contains ( "@rust-timer " ) {
131- return handle_rust_timer ( ctxt, comment, issue) . await ;
139+ return handle_rust_timer ( ctxt, & main_client , & ci_client , comment, issue) . await ;
132140 }
133141
134142 Ok ( github:: Response )
135143}
136144
137145async fn handle_rust_timer (
138146 ctxt : Arc < SiteCtxt > ,
147+ main_client : & client:: Client ,
148+ ci_client : & client:: Client ,
139149 comment : github:: Comment ,
140150 issue : github:: Issue ,
141151) -> ServerResult < github:: Response > {
142- let main_repo_client = client:: Client :: from_ctxt (
143- & ctxt,
144- "https://api.github.com/repos/rust-lang/rust" . to_owned ( ) ,
145- ) ;
146152 if comment. author_association != github:: Association :: Owner
147153 && !get_authorized_users ( ) . await ?. contains ( & comment. user . id )
148154 {
149- main_repo_client
155+ main_client
150156 . post_comment (
151157 issue. number ,
152158 "Insufficient permissions to issue commands to rust-timer." ,
@@ -163,7 +169,7 @@ async fn handle_rust_timer(
163169 let conn = ctxt. conn ( ) . await ;
164170 conn. queue_pr ( issue. number , include, exclude, runs) . await ;
165171 }
166- main_repo_client
172+ main_client
167173 . post_comment (
168174 issue. number ,
169175 "Awaiting bors try build completion.
@@ -183,7 +189,14 @@ async fn handle_rust_timer(
183189 let conn = ctxt. conn ( ) . await ;
184190 conn. queue_pr ( issue. number , include, exclude, runs) . await ;
185191 }
186- enqueue_sha ( issue, & ctxt, commit. to_owned ( ) ) . await ?;
192+ enqueue_sha (
193+ & ctxt,
194+ & main_client,
195+ & ci_client,
196+ issue. number ,
197+ commit. to_owned ( ) ,
198+ )
199+ . await ?;
187200 return Ok ( github:: Response ) ;
188201 }
189202 }
0 commit comments