Better display for approval/changes_requested in pull request reviews
This commit is contained in:
parent
be77188e71
commit
4388d17b99
1 changed files with 12 additions and 4 deletions
|
@ -522,19 +522,27 @@ class Module(ModuleManager.BaseModule):
|
||||||
author, action_desc, pr_title, url)]
|
author, action_desc, pr_title, url)]
|
||||||
|
|
||||||
def pull_request_review(self, full_name, data):
|
def pull_request_review(self, full_name, data):
|
||||||
if data["review"]["state"] == "commented":
|
|
||||||
return []
|
|
||||||
if not "submitted_at" in data["review"]:
|
if not "submitted_at" in data["review"]:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
state = data["review"]["state"]
|
||||||
number = utils.irc.color("#%s" % data["pull_request"]["number"],
|
number = utils.irc.color("#%s" % data["pull_request"]["number"],
|
||||||
COLOR_ID)
|
COLOR_ID)
|
||||||
action = data["action"]
|
action = data["action"]
|
||||||
pr_title = data["pull_request"]["title"]
|
pr_title = data["pull_request"]["title"]
|
||||||
reviewer = utils.irc.bold(data["sender"]["login"])
|
reviewer = utils.irc.bold(data["sender"]["login"])
|
||||||
url = self._short_url(data["review"]["html_url"])
|
url = self._short_url(data["review"]["html_url"])
|
||||||
return ["[PR] %s %s a review on %s: %s - %s" %
|
|
||||||
(reviewer, action, number, pr_title, url)]
|
state_desc = state
|
||||||
|
if state == "approved":
|
||||||
|
state_desc = "approved changes"
|
||||||
|
elif state == "changes_requested":
|
||||||
|
state_desc = "requested changes"
|
||||||
|
elif state == "dismissed":
|
||||||
|
state_desc = "dismissed a review"
|
||||||
|
|
||||||
|
return ["[PR] %s %s on %s: %s - %s" %
|
||||||
|
(reviewer, state_desc, number, title, url)]
|
||||||
|
|
||||||
def pull_request_review_comment(self, full_name, data):
|
def pull_request_review_comment(self, full_name, data):
|
||||||
number = utils.irc.color("#%s" % data["pull_request"]["number"],
|
number = utils.irc.color("#%s" % data["pull_request"]["number"],
|
||||||
|
|
Loading…
Reference in a new issue