Skip to content

Commit f2576c8

Browse files
committed
ci: convert maintainer list in publish_toolstate to a set
1 parent f968c1a commit f2576c8

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

src/tools/publish_toolstate.py

+23-22
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,23 @@
2525
# These should be collaborators of the rust-lang/rust repository (with at least
2626
# read privileges on it). CI will fail otherwise.
2727
MAINTAINERS = {
28-
'miri': '@oli-obk @RalfJung @eddyb',
29-
'clippy-driver': '@Manishearth @llogiq @mcarton @oli-obk @phansch @flip1995 @yaahc',
30-
'rls': '@Xanewok',
31-
'rustfmt': '@topecongiro',
32-
'book': '@carols10cents @steveklabnik',
33-
'nomicon': '@frewsxcv @Gankra',
34-
'reference': '@steveklabnik @Havvy @matthewjasper @ehuss',
35-
'rust-by-example': '@steveklabnik @marioidival @projektir',
36-
'embedded-book': (
37-
'@adamgreig @andre-richter @jamesmunns @korken89 '
38-
'@ryankurte @thejpster @therealprof'
39-
),
40-
'edition-guide': '@ehuss @Centril @steveklabnik',
41-
'rustc-guide': '@mark-i-m @spastorino @amanjeev'
28+
'miri': {'oli-obk', 'RalfJung', 'eddyb'},
29+
'clippy-driver': {
30+
'Manishearth', 'llogiq', 'mcarton', 'oli-obk', 'phansch', 'flip1995',
31+
'yaahc',
32+
},
33+
'rls': {'Xanewok'},
34+
'rustfmt': {'topecongiro'},
35+
'book': {'carols10cents', 'steveklabnik'},
36+
'nomicon': {'frewsxcv', 'Gankra'},
37+
'reference': {'steveklabnik', 'Havvy', 'matthewjasper', 'ehuss'},
38+
'rust-by-example': {'steveklabnik', 'marioidival', 'projektir'},
39+
'embedded-book': {
40+
'adamgreig', 'andre-richter', 'jamesmunns', 'korken89',
41+
'ryankurte', 'thejpster', 'therealprof',
42+
},
43+
'edition-guide': {'ehuss', 'Centril', 'steveklabnik'},
44+
'rustc-guide': {'mark-i-m', 'spastorino', 'amanjeev'},
4245
}
4346

4447
REPOS = {
@@ -80,9 +83,7 @@ def validate_maintainers(repo, github_token):
8083

8184
errors = False
8285
for tool, maintainers in MAINTAINERS.items():
83-
for maintainer in maintainers.split(' '):
84-
if maintainer.startswith('@'):
85-
maintainer = maintainer[1:]
86+
for maintainer in maintainers:
8687
if maintainer not in assignable:
8788
errors = True
8889
print(
@@ -123,13 +124,12 @@ def maybe_delink(message):
123124
def issue(
124125
tool,
125126
status,
126-
maintainers,
127+
assignees,
127128
relevant_pr_number,
128129
relevant_pr_user,
129130
pr_reviewer,
130131
):
131132
# Open an issue about the toolstate failure.
132-
assignees = [x.strip() for x in maintainers.split('@') if x != '']
133133
if status == 'test-fail':
134134
status_description = 'has failing tests'
135135
else:
@@ -150,7 +150,7 @@ def issue(
150150
REPOS.get(tool), relevant_pr_user, pr_reviewer
151151
)),
152152
'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number),
153-
'assignees': assignees,
153+
'assignees': list(assignees),
154154
'labels': ['T-compiler', 'I-nominated'],
155155
})
156156
print("Creating issue:\n{}".format(request))
@@ -200,18 +200,19 @@ def update_latest(
200200
old = status[os]
201201
new = s.get(tool, old)
202202
status[os] = new
203+
maintainers = ' '.join('@'+name for name in MAINTAINERS[tool])
203204
if new > old: # comparing the strings, but they are ordered appropriately!
204205
# things got fixed or at least the status quo improved
205206
changed = True
206207
message += '🎉 {} on {}: {} → {} (cc {}, @rust-lang/infra).\n' \
207-
.format(tool, os, old, new, MAINTAINERS.get(tool))
208+
.format(tool, os, old, new, maintainers)
208209
elif new < old:
209210
# tests or builds are failing and were not failing before
210211
changed = True
211212
title = '💔 {} on {}: {} → {}' \
212213
.format(tool, os, old, new)
213214
message += '{} (cc {}, @rust-lang/infra).\n' \
214-
.format(title, MAINTAINERS.get(tool))
215+
.format(title, maintainers)
215216
# Most tools only create issues for build failures.
216217
# Other failures can be spurious.
217218
if new == 'build-fail' or (tool == 'miri' and new == 'test-fail'):

0 commit comments

Comments
 (0)