@@ -120,33 +120,39 @@ async fn handle_issue(
120
120
issue : github:: Issue ,
121
121
comment : github:: Comment ,
122
122
) -> 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
+ ) ;
123
131
if comment. body . contains ( " homu: " ) {
124
132
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 ?;
126
134
return Ok ( github:: Response ) ;
127
135
}
128
136
}
129
137
130
138
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 ;
132
140
}
133
141
134
142
Ok ( github:: Response )
135
143
}
136
144
137
145
async fn handle_rust_timer (
138
146
ctxt : Arc < SiteCtxt > ,
147
+ main_client : & client:: Client ,
148
+ ci_client : & client:: Client ,
139
149
comment : github:: Comment ,
140
150
issue : github:: Issue ,
141
151
) -> 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
- ) ;
146
152
if comment. author_association != github:: Association :: Owner
147
153
&& !get_authorized_users ( ) . await ?. contains ( & comment. user . id )
148
154
{
149
- main_repo_client
155
+ main_client
150
156
. post_comment (
151
157
issue. number ,
152
158
"Insufficient permissions to issue commands to rust-timer." ,
@@ -163,7 +169,7 @@ async fn handle_rust_timer(
163
169
let conn = ctxt. conn ( ) . await ;
164
170
conn. queue_pr ( issue. number , include, exclude, runs) . await ;
165
171
}
166
- main_repo_client
172
+ main_client
167
173
. post_comment (
168
174
issue. number ,
169
175
"Awaiting bors try build completion.
@@ -183,7 +189,14 @@ async fn handle_rust_timer(
183
189
let conn = ctxt. conn ( ) . await ;
184
190
conn. queue_pr ( issue. number , include, exclude, runs) . await ;
185
191
}
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 ?;
187
200
return Ok ( github:: Response ) ;
188
201
}
189
202
}
0 commit comments