Rollup merge of #62023 - RalfJung:miri-toolstate, r=kennytm
publish_toolstate: don't use 'new' from inside the loop
I think I made a mistake in https://github.com/rust-lang/rust/pull/61938 by using `new` outside the inner loop. This PR fixes that.
However, no issue got created at all for https://github.com/rust-lang/rust/pull/62003#issuecomment-504356964, and I don't know why that is. The script should be [triggered by Traivs](56a12b2ad0/.travis.yml (L240)
), and I can find no trace of that in [the build log](https://travis-ci.com/rust-lang/rust/jobs/209880042).
This commit is contained in:
commit
a4cf85e958
1 changed files with 33 additions and 28 deletions
|
@ -72,32 +72,33 @@ def issue(
|
||||||
):
|
):
|
||||||
# Open an issue about the toolstate failure.
|
# Open an issue about the toolstate failure.
|
||||||
assignees = [x.strip() for x in maintainers.split('@') if x != '']
|
assignees = [x.strip() for x in maintainers.split('@') if x != '']
|
||||||
assignees.append(relevant_pr_user)
|
|
||||||
if status == 'test-fail':
|
if status == 'test-fail':
|
||||||
status_description = 'has failing tests'
|
status_description = 'has failing tests'
|
||||||
else:
|
else:
|
||||||
status_description = 'no longer builds'
|
status_description = 'no longer builds'
|
||||||
|
request = json.dumps({
|
||||||
|
'body': maybe_delink(textwrap.dedent('''\
|
||||||
|
Hello, this is your friendly neighborhood mergebot.
|
||||||
|
After merging PR {}, I observed that the tool {} {}.
|
||||||
|
A follow-up PR to the repository {} is needed to fix the fallout.
|
||||||
|
|
||||||
|
cc @{}, do you think you would have time to do the follow-up work?
|
||||||
|
If so, that would be great!
|
||||||
|
|
||||||
|
cc @{}, the PR reviewer, and @rust-lang/compiler -- nominating for prioritization.
|
||||||
|
|
||||||
|
''').format(
|
||||||
|
relevant_pr_number, tool, status_description,
|
||||||
|
REPOS.get(tool), relevant_pr_user, pr_reviewer
|
||||||
|
)),
|
||||||
|
'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number),
|
||||||
|
'assignees': assignees,
|
||||||
|
'labels': ['T-compiler', 'I-nominated'],
|
||||||
|
})
|
||||||
|
print("Creating issue:\n{}".format(request))
|
||||||
response = urllib2.urlopen(urllib2.Request(
|
response = urllib2.urlopen(urllib2.Request(
|
||||||
gh_url(),
|
gh_url(),
|
||||||
json.dumps({
|
request,
|
||||||
'body': maybe_delink(textwrap.dedent('''\
|
|
||||||
Hello, this is your friendly neighborhood mergebot.
|
|
||||||
After merging PR {}, I observed that the tool {} {}.
|
|
||||||
A follow-up PR to the repository {} is needed to fix the fallout.
|
|
||||||
|
|
||||||
cc @{}, do you think you would have time to do the follow-up work?
|
|
||||||
If so, that would be great!
|
|
||||||
|
|
||||||
cc @{}, the PR reviewer, and @rust-lang/compiler -- nominating for prioritization.
|
|
||||||
|
|
||||||
''').format(
|
|
||||||
relevant_pr_number, tool, status_description,
|
|
||||||
REPOS.get(tool), relevant_pr_user, pr_reviewer
|
|
||||||
)),
|
|
||||||
'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number),
|
|
||||||
'assignees': assignees,
|
|
||||||
'labels': ['T-compiler', 'I-nominated'],
|
|
||||||
}),
|
|
||||||
{
|
{
|
||||||
'Authorization': 'token ' + github_token,
|
'Authorization': 'token ' + github_token,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -135,13 +136,13 @@ def update_latest(
|
||||||
for status in latest:
|
for status in latest:
|
||||||
tool = status['tool']
|
tool = status['tool']
|
||||||
changed = False
|
changed = False
|
||||||
create_issue = False
|
create_issue_for_status = None # set to the status that caused the issue
|
||||||
|
|
||||||
for os, s in current_status.items():
|
for os, s in current_status.items():
|
||||||
old = status[os]
|
old = status[os]
|
||||||
new = s.get(tool, old)
|
new = s.get(tool, old)
|
||||||
status[os] = new
|
status[os] = new
|
||||||
if new > old:
|
if new > old: # comparing the strings, but they are ordered appropriately!
|
||||||
# things got fixed or at least the status quo improved
|
# things got fixed or at least the status quo improved
|
||||||
changed = True
|
changed = True
|
||||||
message += '🎉 {} on {}: {} → {} (cc {}, @rust-lang/infra).\n' \
|
message += '🎉 {} on {}: {} → {} (cc {}, @rust-lang/infra).\n' \
|
||||||
|
@ -156,20 +157,24 @@ def update_latest(
|
||||||
# Most tools only create issues for build failures.
|
# Most tools only create issues for build failures.
|
||||||
# Other failures can be spurious.
|
# Other failures can be spurious.
|
||||||
if new == 'build-fail' or (tool == 'miri' and new == 'test-fail'):
|
if new == 'build-fail' or (tool == 'miri' and new == 'test-fail'):
|
||||||
create_issue = True
|
create_issue_for_status = new
|
||||||
|
|
||||||
if create_issue:
|
if create_issue_for_status is not None:
|
||||||
try:
|
try:
|
||||||
issue(
|
issue(
|
||||||
tool, new, MAINTAINERS.get(tool, ''),
|
tool, create_issue_for_status, MAINTAINERS.get(tool, ''),
|
||||||
relevant_pr_number, relevant_pr_user, pr_reviewer,
|
relevant_pr_number, relevant_pr_user, pr_reviewer,
|
||||||
)
|
)
|
||||||
except IOError as e:
|
except urllib2.HTTPError as e:
|
||||||
# network errors will simply end up not creating an issue, but that's better
|
# network errors will simply end up not creating an issue, but that's better
|
||||||
# than failing the entire build job
|
# than failing the entire build job
|
||||||
print("I/O error: {0}".format(e))
|
print("HTTPError when creating issue for status regression: {0}\n{1}"
|
||||||
|
.format(e, e.read()))
|
||||||
|
except IOError as e:
|
||||||
|
print("I/O error when creating issue for status regression: {0}".format(e))
|
||||||
except:
|
except:
|
||||||
print("Unexpected error: {0}".format(sys.exc_info()[0]))
|
print("Unexpected error when creating issue for status regression: {0}"
|
||||||
|
.format(sys.exc_info()[0]))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
if changed:
|
if changed:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue