Skip to content

Commit

Permalink
[CELEBORN-907][INFRA] The Jira Python misses our assignee when it sea…
Browse files Browse the repository at this point in the history
…rches users again

…

### What changes were proposed in this pull request?

detailed desc can be found apache/spark@8fb799d

### Why are the changes needed?

bypass upstream bug

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

I guess pan3793 has already hit the issue when resolving CELEBORN-903 at jira side

Closes #1832 from yaooqinn/CELEBORN-907.

Authored-by: Kent Yao <[email protected]>
Signed-off-by: zky.zhoukeyong <[email protected]>
  • Loading branch information
yaooqinn authored and waitinfuture committed Aug 24, 2023
1 parent 2ffd6d7 commit 1550f92
Showing 1 changed file with 14 additions and 1 deletion.
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

0 comments on commit 1550f92

Please sign in to comment.