You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by do...@apache.org on 2025/09/03 04:18:10 UTC

(spark-connect-swift) branch main updated: [SPARK-53467] Improve `merge_spark_pr.py` to accept PR numbers as a CLI argument

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

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-connect-swift.git


The following commit(s) were added to refs/heads/main by this push:
     new 339b037  [SPARK-53467] Improve `merge_spark_pr.py` to accept PR numbers as a CLI argument
339b037 is described below

commit 339b037ce3917a6efeb7ef031adae016e53ea80e
Author: Dongjoon Hyun <do...@apache.org>
AuthorDate: Tue Sep 2 21:18:02 2025 -0700

    [SPARK-53467] Improve `merge_spark_pr.py` to accept PR numbers as a CLI argument
    
    ### What changes were proposed in this pull request?
    
    This PR aims to improve `merge_spark_pr.py` to accept PR numbers as a CLI argument.
    
    ### Why are the changes needed?
    
    To provide an alternative shortcut.
    
    **BEFORE**
    
    ```
    $ dev/merge_spark_pr.py
    git rev-parse --abbrev-ref HEAD
    Which pull request would you like to merge? (e.g. 34): 235
    === JIRA SPARK-53467 ===
    ```
    
    **AFTER (Additional usage)**
    
    ```
    $  dev/merge_spark_pr.py 235
    git rev-parse --abbrev-ref HEAD
    Start to merge pull request #235
    === JIRA SPARK-53467 ===
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Manual test because this is irrelevant to the CI results.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #235 from dongjoon-hyun/SPARK-53467.
    
    Authored-by: Dongjoon Hyun <do...@apache.org>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 dev/merge_spark_pr.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dev/merge_spark_pr.py b/dev/merge_spark_pr.py
index a9bf692..c240268 100755
--- a/dev/merge_spark_pr.py
+++ b/dev/merge_spark_pr.py
@@ -610,7 +610,11 @@ def main():
     branch_names = sorted(branch_names, reverse=True)
     branch_iter = iter(branch_names)
 
-    pr_num = bold_input("Which pull request would you like to merge? (e.g. 34): ")
+    if len(sys.argv) == 1:
+        pr_num = bold_input("Which pull request would you like to merge? (e.g. 34): ")
+    else:
+        pr_num = sys.argv[1]
+        print("Start to merge pull request #%s" % (pr_num))
     pr = get_json("%s/pulls/%s" % (GITHUB_API_BASE, pr_num))
     pr_events = get_json("%s/issues/%s/events" % (GITHUB_API_BASE, pr_num))
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org