This is an automated email from the ASF dual-hosted git repository.

zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 1550f9208 [CELEBORN-907][INFRA] The Jira Python misses our assignee 
when it searches users again
1550f9208 is described below

commit 1550f92086f15ff49ddac0a4f36b70dc445aeed2
Author: Kent Yao <[email protected]>
AuthorDate: Thu Aug 24 11:54:52 2023 +0800

    [CELEBORN-907][INFRA] The Jira Python misses our assignee when it searches 
users again
    
    …
    
    ### What changes were proposed in this pull request?
    
    detailed desc can be found 
https://github.com/apache/spark/commit/8fb799d47bbd5d5ce9db35283d08ab1a31dc37b9
    
    ### 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]>
---
 dev/merge_pr.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/dev/merge_pr.py b/dev/merge_pr.py
index f1ba4c6f7..4af319023 100755
--- a/dev/merge_pr.py
+++ b/dev/merge_pr.py
@@ -385,7 +385,7 @@ 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
@@ -393,6 +393,19 @@ def choose_jira_assignee(issue, asf_jira):
             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)

Reply via email to