diff --git a/openedx_webhooks/views/github.py b/openedx_webhooks/views/github.py index ea66a1c3..199988b6 100644 --- a/openedx_webhooks/views/github.py +++ b/openedx_webhooks/views/github.py @@ -121,6 +121,16 @@ def pr_opened(pr, bugsnag_context=None): comment_resp = github.post(url, data=json.dumps(comment)) if not comment_resp.ok: raise requests.exceptions.RequestException(comment_resp.text) + needs_triage_label = { + "url": "https://api.github.com/repos/edx/edx-platform/labels/needs+triage", + "name": "needs triage", + "color": "e11d21" + } + + label_resp = github.patch(issue_url, data=json.dumps({"labels": [needs_triage_label]})) + if not label_resp.ok: + raise requests.exceptions.RequestException(label_resp.text) + print( "@{user} opened PR #{num} against {repo}, created {issue} to track it".format( user=user, repo=repo, diff --git a/openedx_webhooks/views/jira.py b/openedx_webhooks/views/jira.py index 6558f5c5..d628608a 100644 --- a/openedx_webhooks/views/jira.py +++ b/openedx_webhooks/views/jira.py @@ -32,6 +32,11 @@ def get_jira_custom_fields(): # TODO: should load this directly from labels.yaml so the color and name info is up to date. # Doesn't have the URL info but that is easily constructed. STATUS_LABEL_DICT = { + 'Needs Triage': { + "url": "https://api.github.com/repos/edx/edx-platform/labels/needs+triage", + "name": "needs triage", + "color": "e11d21" + }, 'Product Review': { "url": "https://api.github.com/repos/edx/edx-platform/labels/product+review", "name": "product review", @@ -48,9 +53,9 @@ def get_jira_custom_fields(): 'color': 'fad8c7' }, 'Engineering Review': { - "url": "https://api.github.com/repos/edx/edx-platform/labels/community+manager+review", - "name": "community manager review", - "color": "207de5" + "url": "https://api.github.com/repos/edx/edx-platform/labels/engineering+review", + "name": "engineering review", + "color": "c7def8" }, 'Waiting on Author': { "url": "https://api.github.com/repos/edx/edx-platform/labels/waiting+on+author",