Skip to content

Commit 9c56672

Browse files
authored
Rollup merge of rust-lang#56758 - Manishearth:emoji-status-toolstate, r=kennytm
Add short emoji status to toolstate updates I get a lot of these emails and it's good to know which ones I should be paying closer attention to -- i.e. the ones where clippy breaks. This adds a short emoji status report to the first line of the commit message, which shows up in notifications directly I haven't been able to test it, and the actual emoji are just suggestions. r? @kennytm cc @rust-lang/infra @rust-lang/devtools
2 parents 3669769 + ae893bb commit 9c56672

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

β€Žsrc/tools/publish_toolstate.py

+25-7
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@
3434
'rust-by-example': '@steveklabnik @marioidival @projektir',
3535
}
3636

37+
EMOJI = {
38+
'miri': 'πŸ›°οΈ',
39+
'clippy-driver': 'πŸ“Ž',
40+
'rls': 'πŸ’»',
41+
'rustfmt': 'πŸ“',
42+
'book': 'πŸ“–',
43+
'nomicon': 'πŸ‘Ώ',
44+
'reference': 'πŸ“š',
45+
'rust-by-example': 'πŸ‘©β€πŸ«',
46+
}
3747

3848
def read_current_status(current_commit, path):
3949
'''Reads build status of `current_commit` from content of `history/*.tsv`
@@ -63,13 +73,12 @@ def update_latest(
6373
}
6474

6575
slug = 'rust-lang/rust'
66-
message = textwrap.dedent('''\
67-
πŸ“£ Toolstate changed by {}!
68-
76+
long_message = textwrap.dedent('''\
6977
Tested on commit {}@{}.
7078
Direct link to PR: <{}>
7179
72-
''').format(relevant_pr_number, slug, current_commit, relevant_pr_url)
80+
''').format(slug, current_commit, relevant_pr_url)
81+
emoji_status = []
7382
anything_changed = False
7483
for status in latest:
7584
tool = status['tool']
@@ -81,12 +90,18 @@ def update_latest(
8190
status[os] = new
8291
if new > old:
8392
changed = True
84-
message += 'πŸŽ‰ {} on {}: {} β†’ {} (cc {}, @rust-lang/infra).\n' \
85-
.format(tool, os, old, new, MAINTAINERS.get(tool))
93+
long_message += 'πŸŽ‰ {} on {}: {} β†’ {}.\n' \
94+
.format(tool, os, old, new)
95+
emoji = "{}πŸŽ‰".format(EMOJI.get(tool))
96+
if msg not in emoji_status:
97+
emoji_status += [msg]
8698
elif new < old:
8799
changed = True
88-
message += 'πŸ’” {} on {}: {} β†’ {} (cc {}, @rust-lang/infra).\n' \
100+
long_message += 'πŸ’” {} on {}: {} β†’ {} (cc {}, @rust-lang/infra).\n' \
89101
.format(tool, os, old, new, MAINTAINERS.get(tool))
102+
emoji = "{}πŸ’”".format(EMOJI.get(tool))
103+
if msg not in emoji_status:
104+
emoji_status += [msg]
90105

91106
if changed:
92107
status['commit'] = current_commit
@@ -96,6 +111,9 @@ def update_latest(
96111
if not anything_changed:
97112
return ''
98113

114+
short_message = "πŸ“£ Toolstate changed by {}! ({})"
115+
.format(relevant_pr_number, '/'.join(emoji_status))
116+
message = short_message + "\n\n" + long_message
99117
f.seek(0)
100118
f.truncate(0)
101119
json.dump(latest, f, indent=4, separators=(',', ': '))

0 commit comments

Comments
Β (0)