Skip to content

Commit 9b7b47c

Browse files
authored
Rollup merge of rust-lang#61938 - RalfJung:miri-toolstate, r=kennytm
create an issue for miri even in status test-fail I fired up python to see that this parses, but I wouldn't know how to test this script.
2 parents d51002c + d8eea92 commit 9b7b47c

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/tools/publish_toolstate.py

+17-8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def maybe_delink(message):
6464

6565
def issue(
6666
tool,
67+
status,
6768
maintainers,
6869
relevant_pr_number,
6970
relevant_pr_user,
@@ -72,20 +73,27 @@ def issue(
7273
# Open an issue about the toolstate failure.
7374
assignees = [x.strip() for x in maintainers.split('@') if x != '']
7475
assignees.append(relevant_pr_user)
76+
if status == 'test-fail':
77+
status_description = 'has failing tests'
78+
else:
79+
status_description = 'no longer builds'
7580
response = urllib2.urlopen(urllib2.Request(
7681
gh_url(),
7782
json.dumps({
7883
'body': maybe_delink(textwrap.dedent('''\
7984
Hello, this is your friendly neighborhood mergebot.
80-
After merging PR {}, I observed that the tool {} no longer builds.
85+
After merging PR {}, I observed that the tool {} {}.
8186
A follow-up PR to the repository {} is needed to fix the fallout.
8287
8388
cc @{}, do you think you would have time to do the follow-up work?
8489
If so, that would be great!
8590
8691
cc @{}, the PR reviewer, and @rust-lang/compiler -- nominating for prioritization.
8792
88-
''').format(relevant_pr_number, tool, REPOS.get(tool), relevant_pr_user, pr_reviewer)),
93+
''').format(
94+
relevant_pr_number, tool, status_description,
95+
REPOS.get(tool), relevant_pr_user, pr_reviewer
96+
)),
8997
'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number),
9098
'assignees': assignees,
9199
'labels': ['T-compiler', 'I-nominated'],
@@ -127,7 +135,7 @@ def update_latest(
127135
for status in latest:
128136
tool = status['tool']
129137
changed = False
130-
build_failed = False
138+
create_issue = False
131139

132140
for os, s in current_status.items():
133141
old = status[os]
@@ -145,14 +153,15 @@ def update_latest(
145153
.format(tool, os, old, new)
146154
message += '{} (cc {}, @rust-lang/infra).\n' \
147155
.format(title, MAINTAINERS.get(tool))
148-
# only create issues for build failures. Other failures can be spurious
149-
if new == 'build-fail':
150-
build_failed = True
156+
# Most tools only create issues for build failures.
157+
# Other failures can be spurious.
158+
if new == 'build-fail' or (tool == 'miri' and new == 'test-fail'):
159+
create_issue = True
151160

152-
if build_failed:
161+
if create_issue:
153162
try:
154163
issue(
155-
tool, MAINTAINERS.get(tool, ''),
164+
tool, new, MAINTAINERS.get(tool, ''),
156165
relevant_pr_number, relevant_pr_user, pr_reviewer,
157166
)
158167
except IOError as e:

0 commit comments

Comments
 (0)