Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CELEBORN-907][INFRA] The Jira Python misses our assignee when it searches users again #1832

Closed
wants to merge 1 commit into from
Closed
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
15 changes: 14 additions & 1 deletion dev/merge_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,27 @@ def choose_jira_assignee(issue, asf_jira):
except BaseException:
# assume it's a user id, and try to assign (might fail, we just prompt again)
assignee = asf_jira.user(raw_assignee)
asf_jira.assign_issue(issue.key, assignee.name)
assign_issue(asf_jira, issue.key, assignee.name)
return assignee
except KeyboardInterrupt:
raise
except BaseException:
traceback.print_exc()
print("Error assigning JIRA, try again (or leave blank and fix manually)")

def assign_issue(client, issue: int, assignee: str) -> bool:
"""
Assign an issue to a user, which is a shorthand for jira.client.JIRA.assign_issue.
The original one has an issue that it will search users again and only choose the assignee
from 20 candidates. If it's unmatched, it picks the head blindly. In our case, the assignee
is already resolved.
"""
url = getattr(client, "_get_latest_url")(f"issue/{issue}/assignee")
payload = {"name": assignee}
getattr(client, "_session").put(url, data=json.dumps(payload))
return True



def resolve_jira_issues(title, merge_branches, comment):
jira_ids = re.findall("CELEBORN-[0-9]{3,6}", title)
Expand Down
Loading