|
1 | 1 | use crate::api::{github, ServerResult};
|
2 |
| -use crate::github::{client, enqueue_shas, parse_homu_comment, rollup_pr_number, unroll_rollup}; |
| 2 | +use crate::github::{ |
| 3 | + client, enqueue_shas, parse_homu_comment, rollup_pr_number, unroll_rollup, |
| 4 | + RUST_REPO_GITHUB_API_URL, |
| 5 | +}; |
3 | 6 | use crate::load::SiteCtxt;
|
4 | 7 |
|
5 | 8 | use std::sync::Arc;
|
@@ -29,10 +32,7 @@ async fn handle_push(ctxt: Arc<SiteCtxt>, push: github::Push) -> ServerResult<gi
|
29 | 32 | &ctxt,
|
30 | 33 | "https://api.github.com/repos/rust-lang-ci/rust".to_owned(),
|
31 | 34 | );
|
32 |
| - let main_repo_client = client::Client::from_ctxt( |
33 |
| - &ctxt, |
34 |
| - "https://api.github.com/repos/rust-lang/rust".to_owned(), |
35 |
| - ); |
| 35 | + let main_repo_client = client::Client::from_ctxt(&ctxt, RUST_REPO_GITHUB_API_URL.to_owned()); |
36 | 36 | if push.r#ref != "refs/heads/master" || push.sender.login != "bors" {
|
37 | 37 | return Ok(github::Response);
|
38 | 38 | }
|
@@ -70,10 +70,7 @@ async fn handle_issue(
|
70 | 70 | issue: github::Issue,
|
71 | 71 | comment: github::Comment,
|
72 | 72 | ) -> ServerResult<github::Response> {
|
73 |
| - let main_client = client::Client::from_ctxt( |
74 |
| - &ctxt, |
75 |
| - "https://api.github.com/repos/rust-lang/rust".to_owned(), |
76 |
| - ); |
| 73 | + let main_client = client::Client::from_ctxt(&ctxt, RUST_REPO_GITHUB_API_URL.to_owned()); |
77 | 74 | let ci_client = client::Client::from_ctxt(
|
78 | 75 | &ctxt,
|
79 | 76 | "https://api.github.com/repos/rust-lang-ci/rust".to_owned(),
|
|
0 commit comments