Rollup merge of #72395 - Elinvynia:highfive, r=Mark-Simulacrum
Allow rust-highfive to label issues it creates. This is my first meaningful PR, I am unsure how to test this code so any pointers would be welcome! I am about 50% sure it works.
This commit is contained in:
commit
01adfe1bc3
1 changed files with 16 additions and 1 deletions
|
@ -39,6 +39,19 @@ MAINTAINERS = {
|
||||||
'rustc-dev-guide': {'mark-i-m', 'spastorino', 'amanjeev', 'JohnTitor'},
|
'rustc-dev-guide': {'mark-i-m', 'spastorino', 'amanjeev', 'JohnTitor'},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LABELS = {
|
||||||
|
'miri': ['A-miri', 'C-bug'],
|
||||||
|
'rls': ['A-rls', 'C-bug'],
|
||||||
|
'rustfmt': ['C-bug'],
|
||||||
|
'book': ['C-bug'],
|
||||||
|
'nomicon': ['C-bug'],
|
||||||
|
'reference': ['C-bug'],
|
||||||
|
'rust-by-example': ['C-bug'],
|
||||||
|
'embedded-book': ['C-bug'],
|
||||||
|
'edition-guide': ['C-bug'],
|
||||||
|
'rustc-dev-guide': ['C-bug'],
|
||||||
|
}
|
||||||
|
|
||||||
REPOS = {
|
REPOS = {
|
||||||
'miri': 'https://github.com/rust-lang/miri',
|
'miri': 'https://github.com/rust-lang/miri',
|
||||||
'rls': 'https://github.com/rust-lang/rls',
|
'rls': 'https://github.com/rust-lang/rls',
|
||||||
|
@ -132,6 +145,7 @@ def issue(
|
||||||
assignees,
|
assignees,
|
||||||
relevant_pr_number,
|
relevant_pr_number,
|
||||||
relevant_pr_user,
|
relevant_pr_user,
|
||||||
|
labels,
|
||||||
):
|
):
|
||||||
# Open an issue about the toolstate failure.
|
# Open an issue about the toolstate failure.
|
||||||
if status == 'test-fail':
|
if status == 'test-fail':
|
||||||
|
@ -155,6 +169,7 @@ def issue(
|
||||||
)),
|
)),
|
||||||
'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number),
|
'title': '`{}` no longer builds after {}'.format(tool, relevant_pr_number),
|
||||||
'assignees': list(assignees),
|
'assignees': list(assignees),
|
||||||
|
'labels': labels,
|
||||||
})
|
})
|
||||||
print("Creating issue:\n{}".format(request))
|
print("Creating issue:\n{}".format(request))
|
||||||
response = urllib2.urlopen(urllib2.Request(
|
response = urllib2.urlopen(urllib2.Request(
|
||||||
|
@ -235,7 +250,7 @@ def update_latest(
|
||||||
try:
|
try:
|
||||||
issue(
|
issue(
|
||||||
tool, create_issue_for_status, MAINTAINERS.get(tool, ''),
|
tool, create_issue_for_status, MAINTAINERS.get(tool, ''),
|
||||||
relevant_pr_number, relevant_pr_user,
|
relevant_pr_number, relevant_pr_user, LABELS.get(tool, ''),
|
||||||
)
|
)
|
||||||
except urllib2.HTTPError 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue