Skip to content

Commit 8caa657

Browse files
committed
Rollup merge of #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.
2 parents 85fc7af + ae893bb commit 8caa657

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)