You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "szehon-ho (via GitHub)" <gi...@apache.org> on 2026/06/02 00:31:07 UTC
[PR] [SPARK-57203][INFRA] Improve dev/merge_spark_pr.py to continue on mistyped branch name [spark]
szehon-ho opened a new pull request, #56261:
URL: https://github.com/apache/spark/pull/56261
### What changes were proposed in this pull request?
This PR makes the cherry-pick branch prompt in `dev/merge_spark_pr.py` re-prompt on a typo instead of crashing.
Previously, `cherry_pick` read a branch name and passed it straight to `_do_cherry_pick`, whose first action is `git fetch <PUSH_REMOTE> <pick_ref>:<temp>`. `run_cmd` uses `subprocess.check_output`, which raises `CalledProcessError` on a non-zero exit. The `try/except` in `_do_cherry_pick` only wraps the later `git cherry-pick` call, not this fetch, so a mistyped branch name made the fetch fail and the exception propagated to the top-level handler in `main`, which cleaned up the temp branches and re-raised, aborting the entire merge session with a traceback.
The branch prompt now validates the entered name against `branch_names` (the list of `branch-*` release branches already fetched from the GitHub API) in a loop. On an unrecognized name it prints the list of valid branches and re-prompts; an empty input still accepts the default branch (which is always valid).
### Why are the changes needed?
Mistyping a branch name at the cherry-pick prompt is an easy mistake for a committer to make, and it previously crashed the whole merge tool, forcing the committer to restart the merge/backport flow. Re-prompting lets them simply correct the typo and continue.
### Does this PR introduce _any_ user-facing change?
No. This only affects the committer-facing behavior of the merge tool: the cherry-pick branch prompt now re-prompts on an invalid branch name instead of aborting.
### How was this patch tested?
Ran the module's doctests (`python3 -m doctest dev/merge_spark_pr.py`); all 57 tests pass. Manually verified the validation loop re-prompts on an unknown branch and accepts both a valid branch and the default (empty input).
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor (Claude Opus 4.8)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57203][INFRA] Improve dev/merge_spark_pr.py to continue prompting on mistyped branch name [spark]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #56261:
URL: https://github.com/apache/spark/pull/56261#issuecomment-4605460729
test failure doesnt look related:
[info] *** 1 TEST FAILED ***
[error] Failed tests:
[error] org.apache.spark.sql.kafka010.KafkaSourceStressForDontFailOnDataLossSuite
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57203][INFRA] Improve dev/merge_spark_pr.py to continue prompting on mistyped branch name [spark]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #56261:
URL: https://github.com/apache/spark/pull/56261#issuecomment-4605737550
merged to master, Thanks @LuciferYang @gaogaotiantian
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57203][INFRA] Improve dev/merge_spark_pr.py to continue on mistyped branch name [spark]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #56261:
URL: https://github.com/apache/spark/pull/56261#issuecomment-4597637377
@HyukjinKwon @gaogaotiantian does it make sense to you guys?
my first commit, i thought i can put a comma list of branches like 'branch-4.x, branch-4.x' and it crashed. I panicked a bit as it had already merged to master.
That being said, the script does already resume and skips merge to master if you run it again, but didnt know at the time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57203][INFRA] Improve dev/merge_spark_pr.py to continue prompting on mistyped branch name [spark]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho commented on PR #56261:
URL: https://github.com/apache/spark/pull/56261#issuecomment-4598139622
thanks, changed! yes agree we can update the message later
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-57203][INFRA] Improve dev/merge_spark_pr.py to continue prompting on mistyped branch name [spark]
Posted by "szehon-ho (via GitHub)" <gi...@apache.org>.
szehon-ho closed pull request #56261: [SPARK-57203][INFRA] Improve dev/merge_spark_pr.py to continue prompting on mistyped branch name
URL: https://github.com/apache/spark/pull/56261
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org