Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit 7a85cb2

Browse files
committed
Teach sync-team about the Rust bors GitHub app
1 parent 249bab6 commit 7a85cb2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/github/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,17 @@ type RepoName = String;
2929
#[derive(Copy, Clone, Debug, PartialEq)]
3030
enum GithubApp {
3131
RenovateBot,
32+
/// New Rust implementation of Bors
33+
Bors,
3234
}
3335

3436
impl GithubApp {
37+
/// You can find the GitHub app ID e.g. through `gh api apps/<name>` or through the
38+
/// app settings page (if we own the app).
3539
fn from_id(app_id: u64) -> Option<Self> {
3640
match app_id {
3741
2740 => Some(GithubApp::RenovateBot),
42+
278306 => Some(GithubApp::Bors),
3843
_ => None,
3944
}
4045
}
@@ -44,6 +49,7 @@ impl Display for GithubApp {
4449
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
4550
match self {
4651
GithubApp::RenovateBot => f.write_str("RenovateBot"),
52+
GithubApp::Bors => f.write_str("Bors"),
4753
}
4854
}
4955
}
@@ -444,7 +450,8 @@ impl SyncGitHub {
444450
// Find apps that should be enabled on the repository
445451
for app in expected_repo.bots.iter().filter_map(|bot| match bot {
446452
Bot::Renovate => Some(GithubApp::RenovateBot),
447-
_ => None,
453+
Bot::Bors => Some(GithubApp::Bors),
454+
Bot::Highfive | Bot::Rfcbot | Bot::RustTimer | Bot::Rustbot => None,
448455
}) {
449456
// Find installation ID of this app on GitHub
450457
let gh_installation = self
@@ -579,6 +586,7 @@ fn calculate_permission_diffs(
579586
/// Returns `None` if the bot is not an actual bot user, but rather a GitHub app.
580587
fn bot_user_name(bot: &Bot) -> Option<&str> {
581588
match bot {
589+
// FIXME: set this to `None` once homu is removed completely
582590
Bot::Bors => Some("bors"),
583591
Bot::Highfive => Some("rust-highfive"),
584592
Bot::RustTimer => Some("rust-timer"),

0 commit comments

Comments
 (0)