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

yao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 32861e0d4fb1 [SPARK-48684][INFRA] Print related JIRA summary before 
proceeding merge
32861e0d4fb1 is described below

commit 32861e0d4fb1da522fef9a5fbb87c7788495cf5f
Author: Kent Yao <[email protected]>
AuthorDate: Fri Jun 21 20:05:12 2024 +0800

    [SPARK-48684][INFRA] Print related JIRA summary before proceeding merge
    
    ### What changes were proposed in this pull request?
    
    We print JIRA summaries from the PR title alongside the PR summary to do a 
precheck
    ```
    
================================================================================
    === JIRA SPARK-48680 ===
    Summary         Add char/varchar doc to language specific tables
    Assignee        None
    Status          Open
    Url             https://issues.apache.org/jira/browse/SPARK-48680
    Affected        ['4.0.0']
    
    === Pull Request #47052 ===
    title   [SPARK-48680][DOCS] Add char/varchar doc to language specific tables
    source  yaooqinn/SPARK-48680
    target  master
    url     https://api.github.com/repos/apache/spark/pulls/47052
    Proceed with merging pull request #47052? (y/N):
    ```
    
    ### Why are the changes needed?
    
    It's important to double-check the JIRA ID before adding it to the commit 
log as it may sometimes be incorrect. Providing the "Affected Versions" to the 
signer as a reference will help decide whether a PR should be backported.
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    test log as above
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    no
    
    Closes #47057 from yaooqinn/SPARK-48684.
    
    Authored-by: Kent Yao <[email protected]>
    Signed-off-by: Kent Yao <[email protected]>
---
 dev/merge_spark_pr.py | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/dev/merge_spark_pr.py b/dev/merge_spark_pr.py
index 5d014a6375cb..fff6df62701d 100755
--- a/dev/merge_spark_pr.py
+++ b/dev/merge_spark_pr.py
@@ -257,16 +257,19 @@ def cherry_pick(pr_num, merge_hash, default_branch):
 
 
 def print_jira_issue_summary(issue):
-    summary = issue.fields.summary
+    summary = "Summary\t\t%s\n" % issue.fields.summary
     assignee = issue.fields.assignee
     if assignee is not None:
         assignee = assignee.displayName
-    status = issue.fields.status.name
+    assignee = "Assignee\t%s\n" % assignee
+    status = "Status\t\t%s\n" % issue.fields.status.name
+    url = "Url\t\t%s/%s\n" % (JIRA_BASE, issue.key)
+    target_versions = "Affected\t%s\n" % [x.name for x in 
issue.fields.versions]
+    fix_versions = ""
+    if len(issue.fields.fixVersions) > 0:
+        fix_versions = "Fixed\t\t%s\n" % [x.name for x in 
issue.fields.fixVersions]
     print("=== JIRA %s ===" % issue.key)
-    print(
-        "summary\t\t%s\nassignee\t%s\nstatus\t\t%s\nurl\t\t%s/%s\n"
-        % (summary, assignee, status, JIRA_BASE, issue.key)
-    )
+    print("%s%s%s%s%s%s" % (summary, assignee, status, url, target_versions, 
fix_versions))
 
 
 def get_jira_issue(prompt, default_jira_id=""):
@@ -685,6 +688,14 @@ def main():
         )
         continue_maybe(msg)
 
+    if asf_jira is not None:
+        jira_ids = re.findall("SPARK-[0-9]{4,5}", title)
+        for jira_id in jira_ids:
+            try:
+                print_jira_issue_summary(asf_jira.issue(jira_id))
+            except Exception:
+                print_error("Unable to fetch summary of %s" % jira_id)
+
     print("\n=== Pull Request #%s ===" % pr_num)
     print("title\t%s\nsource\t%s\ntarget\t%s\nurl\t%s" % (title, pr_repo_desc, 
target_ref, url))
     continue_maybe("Proceed with merging pull request #%s?" % pr_num)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to