Skip to content

Commit 3f4a8df

Browse files
committed
adds struct for CratesIoOps
Signed-off-by: Nell Shamrell <[email protected]> more refining Signed-off-by: Nell Shamrell <[email protected]> more refinements Signed-off-by: Nell Shamrell <[email protected]> wip Signed-off-by: Nell Shamrell <[email protected]>
1 parent fd49a35 commit 3f4a8df

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ supported services.
2323
[www-src]: https://github.com/rust-lang/www.rust-lang.org/blob/master/src/teams.rs
2424
[crater]: https://github.com/rust-lang-nursery/crater
2525
[crater-src]: https://github.com/rust-lang-nursery/crater/blob/master/src/server/auth.rs
26-
[crates-io-ios]: https://github.com/rust-lang/crates-io-ops-bot/
2726
[ml-src]: https://github.com/rust-lang/rust-central-station/tree/master/sync-mailgun
2827
[perf]: https://perf.rust-lang.org
2928
[perf-src]: https://github.com/rust-lang-nursery/rustc-perf/blob/master/site/src/server.rs

src/permissions.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ macro_rules! permissions {
1212
$($bors:ident,)*
1313
}
1414
crates_io_ops_apps {
15-
$($crates_io_ops_apps:ident,)*
15+
$($crates_io_ops_app:ident,)*
1616
}
1717
) => {
1818
#[derive(serde_derive::Deserialize, Debug)]
@@ -59,13 +59,15 @@ macro_rules! permissions {
5959
)*
6060
#[serde(default)]
6161
bors: BorsPermissions,
62+
crates_io_ops_bot: CratesIoOps,
6263
}
6364

6465
impl Default for Permissions {
6566
fn default() -> Self {
6667
Permissions {
6768
$($boolean: false,)*
6869
bors: BorsPermissions::default(),
70+
crates_io_ops_bot: CratesIoOps::default(),
6971
}
7072
}
7173
}
@@ -75,6 +77,7 @@ macro_rules! permissions {
7577
$(stringify!($boolean),)*
7678
$(concat!("bors.", stringify!($bors), ".review"),)*
7779
$(concat!("bors.", stringify!($bors), ".try"),)*
80+
$(concat!("crates_io_ops_app.", stringify!($crates_io_ops_app)),)*
7881
];
7982

8083
pub(crate) fn has(&self, permission: &str) -> bool {
@@ -95,6 +98,11 @@ macro_rules! permissions {
9598
return self.bors.$bors.try_
9699
}
97100
)*
101+
$(
102+
if permission == concat!("crates_io_ops_app", stringify!($crates_io_ops_app)) {
103+
return self.$crates_io_ops_app;
104+
}
105+
)*
98106
false
99107
}
100108

@@ -128,6 +136,25 @@ macro_rules! permissions {
128136
Ok(())
129137
}
130138
}
139+
140+
#[derive(serde_derive::Deserialize, Debug)]
141+
#[serde(deny_unknown_fields)]
142+
pub(crate) struct CratesIoOps {
143+
$(
144+
#[serde(default)]
145+
$crates_io_ops_app: bool,
146+
)*
147+
}
148+
149+
impl Default for CratesIoOps {
150+
fn default() -> Self {
151+
CratesIoOps {
152+
$($crates_io_ops_app: false,)*
153+
}
154+
}
155+
}
156+
157+
131158
}
132159
}
133160

@@ -154,7 +181,6 @@ permissions! {
154181
team,
155182
}
156183
crates_io_ops_apps {
157-
heroku_crates_io_staging, // Placeholder until I get the actual app name
158184
}
159185
}
160186

teams/infra.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ orgs = ["rust-lang", "rust-lang-ci", "rust-lang-nursery"]
1919
[permissions]
2020
perf = true
2121
crater = true
22-
crates-io-ops = true
2322
bors.rust.review = true
2423
bors.crater.review = true
24+
crates_io_ops_app.crates_io_staging = true
2525

2626
[rfcbot]
2727
label = "T-infra"

0 commit comments

Comments
 (0)