Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions openedx_webhooks/views/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ def pr_opened(pr, bugsnag_context=None):
comment_resp = github.post(url, json=comment)
if not comment_resp.ok:
raise requests.exceptions.RequestException(comment_resp.text)

issue_url = "/repos/{repo}/issues/{num}".format(repo=repo, num=pr["number"])
label_resp = github.patch(issue_url, data=json.dumps({"labels": ["needs triage"]}))
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,
Expand Down
35 changes: 7 additions & 28 deletions openedx_webhooks/views/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,14 @@ def get_jira_custom_fields():
if value["custom"]
}

# Maps JIRA status : Github label dictionary
# 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.
# Maps JIRA status : Github label name
STATUS_LABEL_DICT = {
'Product Review': {
"url": "https://api.github.com/repos/edx/edx-platform/labels/product+review",
"name": "product review",
"color": "5319e7"
},
'Community Manager Review': {
"url": "https://api.github.com/repos/edx/edx-platform/labels/community+manager+review",
"name": "community manager review",
"color": "207de5"
},
'Awaiting Prioritization': {
'url': 'https://api.github.com/repos/edx/edx-platform/labels/awaiting+prioritization',
'name': 'awaiting prioritization',
'color': 'fad8c7'
},
'Engineering Review': {
"url": "https://api.github.com/repos/edx/edx-platform/labels/community+manager+review",
"name": "community manager review",
"color": "207de5"
},
'Waiting on Author': {
"url": "https://api.github.com/repos/edx/edx-platform/labels/waiting+on+author",
"name": "waiting on author",
"color": "0052cc"
},
'Needs Triage': "needs triage",
'Product Review': "product review",
'Community Manager Review': "community manager review",
'Awaiting Prioritization': "awaiting prioritization",
'Engineering Review': "engineering review",
'Waiting on Author': "waiting on author",
}


Expand Down