Skip to content

Commit 7bd3a43

Browse files
committed
rename github to api
1 parent 207242e commit 7bd3a43

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/server/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl ACL {
120120
};
121121

122122
if let Some(github) = github {
123-
acl.refresh_cache(&github.github)?;
123+
acl.refresh_cache(&github.api)?;
124124
}
125125
Ok(acl)
126126
}

src/server/messages.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Message {
6767
message.push_str(&format!("\n:{}: {}", line.emoji, line.content));
6868
}
6969

70-
github_data.github.post_comment(issue_url, &message)?;
70+
github_data.api.post_comment(issue_url, &message)?;
7171

7272
if let Some(label) = self.new_label {
7373
let label = match label {
@@ -78,20 +78,20 @@ impl Message {
7878
// Remove all the labels matching the provided regex
7979
// If the label is already present don't reapply it though
8080
let regex = &data.config.server.labels.remove;
81-
let current_labels = github_data.github.list_labels(issue_url)?;
81+
let current_labels = github_data.api.list_labels(issue_url)?;
8282
let mut label_already_present = false;
8383
for current_label in &current_labels {
8484
if current_label.name == *label {
8585
label_already_present = true;
8686
} else if regex.is_match(&current_label.name) {
8787
github_data
88-
.github
88+
.api
8989
.remove_label(issue_url, &current_label.name)?;
9090
}
9191
}
9292

9393
if !label_already_present {
94-
github_data.github.add_label(issue_url, label)?;
94+
github_data.api.add_label(issue_url, label)?;
9595
}
9696
}
9797

src/server/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct Data {
5151
#[derive(Clone)]
5252
pub struct GithubData {
5353
pub bot_username: String,
54-
pub github: GitHubApi,
54+
pub api: GitHubApi,
5555
pub tokens: BotTokens,
5656
}
5757

@@ -67,7 +67,7 @@ pub fn run(config: Config, bind: SocketAddr) -> Fallible<()> {
6767
let bot_username = github.username()?;
6868
info!("bot username: {}", bot_username);
6969
Fallible::Ok(GithubData {
70-
github,
70+
api: github,
7171
bot_username,
7272
tokens,
7373
})

src/server/routes/webhooks/commands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ pub fn run(
8686
format!("Automatically detected try build {}", build.merge_sha),
8787
);
8888
let pr_head = github_data
89-
.github
89+
.api
9090
.get_pr_head_sha(&repo.full_name, issue.number)?;
9191
let mut merge_commit = github_data
92-
.github
92+
.api
9393
.get_commit(&repo.full_name, &build.merge_sha)?;
9494
if merge_commit.parents.len() == 2 {
9595
// The first parent is the rust-lang/rust commit, and the second
@@ -275,7 +275,7 @@ pub fn abort(
275275
}
276276

277277
pub fn reload_acl(data: &Data, github_data: &GithubData, issue: &Issue) -> Fallible<()> {
278-
data.acl.refresh_cache(&github_data.github)?;
278+
data.acl.refresh_cache(&github_data.api)?;
279279

280280
Message::new()
281281
.line("hammer_and_wrench", "List of authorized users reloaded!")

src/server/routes/webhooks/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn process_webhook(
3838

3939
crate::server::try_builds::detect(
4040
&data.db,
41-
&github_data.github,
41+
&github_data.api,
4242
&p.repository.full_name,
4343
p.issue.number,
4444
&p.comment.body,

0 commit comments

Comments
 (0)