Skip to content

Commit a4a80f1

Browse files
committed
Make team website entries required
1 parent b0de3d4 commit a4a80f1

12 files changed

+121
-11
lines changed

docs/toml-schema.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ ping = "rust-lang/cargo"
119119
# Team members to be excluded from FCPs
120120
exclude-members = ["some-team-member"]
121121

122-
# Information about the team to display on the www.rust-lang.org website.
122+
# Information about the team to display on the www.rust-lang.org website (required except marker teams).
123123
[website]
124124
# The name of the team to display on the website (required).
125125
name = "Language team"

src/validate.rs

+14
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static CHECKS: &[Check<fn(&Data, &mut Vec<String>)>] = checks![
5151
validate_repos,
5252
validate_branch_protections,
5353
validate_member_roles,
54+
validate_website,
5455
];
5556

5657
#[allow(clippy::type_complexity)]
@@ -1040,3 +1041,16 @@ where
10401041
}
10411042
}
10421043
}
1044+
1045+
fn validate_website(data: &Data, errors: &mut Vec<String>) {
1046+
wrapper(data.teams(), errors, |team, _| {
1047+
match team.kind() {
1048+
TeamKind::MarkerTeam => return Ok(()),
1049+
TeamKind::Team | TeamKind::WorkingGroup | TeamKind::ProjectGroup => {}
1050+
};
1051+
if team.website_data().is_none() {
1052+
bail!("team `{}` should have a `[website]` table", team.name());
1053+
}
1054+
Ok(())
1055+
})
1056+
}

teams/mentors.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ alumni = []
2121
name = "gsoc-mentors"
2222

2323
[website]
24-
name = "Mentorship Programs"
25-
description = "Organizes involvement in internship programs such as Google Summer of Code"
24+
name = "Mentors team"
25+
description = "Mentors for the mentorship and internship programs"

tests/static-api/_expected/v1/teams.json

+44-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,17 @@
9090
],
9191
"alumni": [],
9292
"github": null,
93-
"website_data": null,
93+
"website_data": {
94+
"name": "Leaderless",
95+
"description": "Test",
96+
"page": "leaderless",
97+
"email": null,
98+
"repo": null,
99+
"discord": null,
100+
"zulip_stream": null,
101+
"matrix_room": null,
102+
"weight": 0
103+
},
94104
"roles": [],
95105
"discord": []
96106
},
@@ -101,7 +111,17 @@
101111
"members": [],
102112
"alumni": [],
103113
"github": null,
104-
"website_data": null,
114+
"website_data": {
115+
"name": "Leadership council",
116+
"description": "test",
117+
"page": "leadership-council",
118+
"email": null,
119+
"repo": null,
120+
"discord": null,
121+
"zulip_stream": null,
122+
"matrix_room": null,
123+
"weight": 0
124+
},
105125
"roles": [],
106126
"discord": []
107127
},
@@ -132,7 +152,17 @@
132152
],
133153
"alumni": [],
134154
"github": null,
135-
"website_data": null,
155+
"website_data": {
156+
"name": "Leads permissions",
157+
"description": "Test",
158+
"page": "leads-permissions",
159+
"email": null,
160+
"repo": null,
161+
"discord": null,
162+
"zulip_stream": null,
163+
"matrix_room": null,
164+
"weight": 0
165+
},
136166
"roles": [],
137167
"discord": []
138168
},
@@ -166,7 +196,17 @@
166196
}
167197
],
168198
"github": null,
169-
"website_data": null,
199+
"website_data": {
200+
"name": "WG Test",
201+
"description": "test",
202+
"page": "wg-test",
203+
"email": null,
204+
"repo": null,
205+
"discord": null,
206+
"zulip_stream": null,
207+
"matrix_room": null,
208+
"weight": 0
209+
},
170210
"roles": [
171211
{
172212
"id": "convener",

tests/static-api/_expected/v1/teams/leaderless.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
],
1414
"alumni": [],
1515
"github": null,
16-
"website_data": null,
16+
"website_data": {
17+
"name": "Leaderless",
18+
"description": "Test",
19+
"page": "leaderless",
20+
"email": null,
21+
"repo": null,
22+
"discord": null,
23+
"zulip_stream": null,
24+
"matrix_room": null,
25+
"weight": 0
26+
},
1727
"roles": [],
1828
"discord": []
1929
}

tests/static-api/_expected/v1/teams/leadership-council.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55
"members": [],
66
"alumni": [],
77
"github": null,
8-
"website_data": null,
8+
"website_data": {
9+
"name": "Leadership council",
10+
"description": "test",
11+
"page": "leadership-council",
12+
"email": null,
13+
"repo": null,
14+
"discord": null,
15+
"zulip_stream": null,
16+
"matrix_room": null,
17+
"weight": 0
18+
},
919
"roles": [],
1020
"discord": []
1121
}

tests/static-api/_expected/v1/teams/leads-permissions.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@
2525
],
2626
"alumni": [],
2727
"github": null,
28-
"website_data": null,
28+
"website_data": {
29+
"name": "Leads permissions",
30+
"description": "Test",
31+
"page": "leads-permissions",
32+
"email": null,
33+
"repo": null,
34+
"discord": null,
35+
"zulip_stream": null,
36+
"matrix_room": null,
37+
"weight": 0
38+
},
2939
"roles": [],
3040
"discord": []
3141
}

tests/static-api/_expected/v1/teams/wg-test.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@
2828
}
2929
],
3030
"github": null,
31-
"website_data": null,
31+
"website_data": {
32+
"name": "WG Test",
33+
"description": "test",
34+
"page": "wg-test",
35+
"email": null,
36+
"repo": null,
37+
"discord": null,
38+
"zulip_stream": null,
39+
"matrix_room": null,
40+
"weight": 0
41+
},
3242
"roles": [
3343
{
3444
"id": "convener",

tests/static-api/teams/leaderless.toml

+4
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ top-level = true
55
leads = []
66
members = ["user-0"]
77
alumni = []
8+
9+
[website]
10+
name = "Leaderless"
11+
description = "Test"

tests/static-api/teams/leadership-council.toml

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ name = "leadership-council"
44
leads = []
55
members = []
66
alumni = []
7+
8+
[website]
9+
name = "Leadership council"
10+
description = "test"

tests/static-api/teams/leads-permissions.toml

+4
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ alumni = []
88

99
[leads-permissions]
1010
bors.crates-io.review = true
11+
12+
[website]
13+
name = "Leads permissions"
14+
description = "Test"

tests/static-api/teams/wg-test.toml

+4
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ alumni = ["user-0", "user-5"]
1212
[[roles]]
1313
id = "convener"
1414
description = "Convener"
15+
16+
[website]
17+
name = "WG Test"
18+
description = "test"

0 commit comments

Comments
 (0)