Skip to content

Commit fb6a5d8

Browse files
committed
[SPARK-53410] 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): 302 ================================================================================ ``` **AFTER (Additional usage)** ``` $ dev/merge_spark_pr.py 302 git rev-parse --abbrev-ref HEAD Start to merge pull request #52020 ================================================================================ ``` ### 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 apache#302 from dongjoon-hyun/SPARK-53410. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 377371d commit fb6a5d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dev/merge_spark_pr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,11 @@ def main():
597597
branch_names = sorted(branch_names, reverse=True)
598598
branch_iter = iter(branch_names)
599599

600-
pr_num = bold_input("Which pull request would you like to merge? (e.g. 34): ")
600+
if len(sys.argv) == 1:
601+
pr_num = bold_input("Which pull request would you like to merge? (e.g. 34): ")
602+
else:
603+
pr_num = sys.argv[1]
604+
print("Start to merge pull request #%s" % (pr_num))
601605
pr = get_json("%s/pulls/%s" % (GITHUB_API_BASE, pr_num))
602606
pr_events = get_json("%s/issues/%s/events" % (GITHUB_API_BASE, pr_num))
603607

0 commit comments

Comments
 (0)