Skip to content

Commit 5b4de53

Browse files
authored
Merge pull request #1463 from Kobzol/repo-rust
Add rust repository under automation
2 parents f4383f8 + ee78091 commit 5b4de53

File tree

3 files changed

+80
-6
lines changed

3 files changed

+80
-6
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ teams/**/*.toml
1919
# Modifying these files requires admin approval.
2020
/repos/rust-lang/team.toml @Mark-Simulacrum @pietroalbini @jdno @marcoieni
2121
/repos/rust-lang/sync-team.toml @Mark-Simulacrum @pietroalbini @jdno @marcoieni
22+
/repos/rust-lang/rust.toml @Mark-Simulacrum @pietroalbini @jdno @marcoieni
2223
/teams/infra-admins.toml @Mark-Simulacrum @pietroalbini @jdno @marcoieni
2324
/teams/team-repo-admins.toml @Mark-Simulacrum @pietroalbini @jdno @marcoieni
2425
/people/Mark-Simulacrum.toml @Mark-Simulacrum @pietroalbini @jdno @marcoieni

repos/rust-lang/rust.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
org = "rust-lang"
2+
name = "rust"
3+
description = "Empowering everyone to build reliable and efficient software."
4+
homepage = "https://www.rust-lang.org"
5+
bots = ["bors", "craterbot", "glacierbot", "log-analyzer", "rustbot", "rfcbot", "rust-timer"]
6+
7+
[access.teams]
8+
bootstrap = "write"
9+
cargo = "write"
10+
clippy = "write"
11+
compiler = "write"
12+
infra = "write"
13+
lang = "write"
14+
lang-ops = "write"
15+
libs = "write"
16+
libs-api = "write"
17+
libs-contributors = "write"
18+
mods = "write"
19+
opsem = "write"
20+
project-exploit-mitigations = "write"
21+
project-stable-mir = "write"
22+
release = "write"
23+
rustdoc = "write"
24+
style = "write"
25+
types = "write"
26+
wg-prioritization = "triage"
27+
wg-triage = "write"
28+
29+
[[branch-protections]]
30+
pattern = "master"
31+
merge-bots = ["homu"]
32+
33+
[[branch-protections]]
34+
pattern = "stable"
35+
merge-bots = ["homu"]
36+
37+
[[branch-protections]]
38+
pattern = "beta"
39+
merge-bots = ["homu"]
40+
41+
[[branch-protections]]
42+
pattern = "try"
43+
merge-bots = ["homu"]
44+
45+
[[branch-protections]]
46+
pattern = "auto"
47+
merge-bots = ["homu"]
48+
49+
[[branch-protections]]
50+
pattern = "*"
51+
merge-bots = ["homu"]
52+
53+
[[branch-protections]]
54+
pattern = "*/**/*"
55+
pr-required = false
56+
57+
[[branch-protections]]
58+
pattern = "cargo_update"
59+
pr-required = false
60+
61+
[[branch-protections]]
62+
pattern = "automation/bors/try-merge"
63+
pr-required = false
64+
65+
[[branch-protections]]
66+
pattern = "automation/bors/try"
67+
pr-required = false

src/ci.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ pub fn check_codeowners(data: Data) -> anyhow::Result<()> {
2525
Ok(())
2626
}
2727

28+
/// Sensitive TOML data files.
29+
/// PRs that modify them need to be approved by an infra-admin.
30+
const PROTECTED_PATHS: &[&str] = &[
31+
"/repos/rust-lang/team.toml",
32+
"/repos/rust-lang/sync-team.toml",
33+
"/repos/rust-lang/rust.toml",
34+
"/teams/infra-admins.toml",
35+
"/teams/team-repo-admins.toml",
36+
];
37+
2838
/// We want to allow access to the data files to `team-repo-admins`
2939
/// (maintainers), while requiring a review from `infra-admins` (admins)
3040
/// for any other changes.
@@ -137,12 +147,8 @@ teams/**/*.toml
137147
)
138148
.unwrap();
139149

140-
let mut protected_paths = vec![
141-
"/repos/rust-lang/team.toml".to_string(),
142-
"/repos/rust-lang/sync-team.toml".to_string(),
143-
"/teams/infra-admins.toml".to_string(),
144-
"/teams/team-repo-admins.toml".to_string(),
145-
];
150+
let mut protected_paths: Vec<String> =
151+
PROTECTED_PATHS.iter().map(|&p| String::from(p)).collect();
146152

147153
// Some users can be both admins and maintainers.
148154
let all_users = admins

0 commit comments

Comments
 (0)