Commit 9668a335 by David Baumgold

Include author in table

parent cd538bd8
...@@ -155,8 +155,9 @@ def generate_table(start_ref, end_ref): ...@@ -155,8 +155,9 @@ def generate_table(start_ref, end_ref):
""" """
Return a string corresponding to a commit table to embed in Confluence Return a string corresponding to a commit table to embed in Confluence
""" """
header = "|| Merged By || Title || PR || JIRA || Verified? ||" header = "|| Merged By || Author || Title || PR || JIRA || Verified? ||"
pr_link = "[#{num}|https://github.com/edx/edx-platform/pull/{num}]" pr_link = "[#{num}|https://github.com/edx/edx-platform/pull/{num}]"
user_link = "[@{user}|https://github.com/{user}]"
rows = [header] rows = [header]
prbe = prs_by_email(start_ref, end_ref) prbe = prs_by_email(start_ref, end_ref)
for email, pull_requests in prbe.items(): for email, pull_requests in prbe.items():
...@@ -165,6 +166,7 @@ def generate_table(start_ref, end_ref): ...@@ -165,6 +166,7 @@ def generate_table(start_ref, end_ref):
pr_info = get_pr_info(pull_request) pr_info = get_pr_info(pull_request)
title = pr_info["title"] or "" title = pr_info["title"] or ""
body = pr_info["body"] or "" body = pr_info["body"] or ""
author = pr_info["user"]["login"]
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
print( print(
"Warning: could not fetch data for #{num}: {message}".format( "Warning: could not fetch data for #{num}: {message}".format(
...@@ -174,8 +176,10 @@ def generate_table(start_ref, end_ref): ...@@ -174,8 +176,10 @@ def generate_table(start_ref, end_ref):
) )
title = "?" title = "?"
body = "?" body = "?"
rows.append("| {merged_by} | {title} | {pull_request} | {jira} | {verified} |".format( author = ""
rows.append("| {merged_by} | {author} | {title} | {pull_request} | {jira} | {verified} |".format(
merged_by=email if i == 0 else "", merged_by=email if i == 0 else "",
author=user_link.format(user=author) if author else "",
title=title.replace("|", "\|"), title=title.replace("|", "\|"),
pull_request=pr_link.format(num=pull_request), pull_request=pr_link.format(num=pull_request),
jira=", ".join(parse_ticket_references(body)), jira=", ".join(parse_ticket_references(body)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment