[SPARK-58734][INFRA] Skip a declined cherry-pick instead of aborting the merge in merge_spark_pr.py - #57959
Closed
uros-b wants to merge 2 commits into
Closed
[SPARK-58734][INFRA] Skip a declined cherry-pick instead of aborting the merge in merge_spark_pr.py#57959uros-b wants to merge 2 commits into
uros-b wants to merge 2 commits into
Conversation
…the merge in merge_spark_pr.py When a backport cherry-pick conflicts, declining the "Would you like to manually fix-up this merge?" prompt aborted the entire script via fail(), so the committer never reached the JIRA-resolution step (and the run exited non-zero) -- even though the merge into the target branch had already been pushed. Backport conflicts are routine, so declining one should skip only that branch. Add a SkipCherryPick exception, raised (after aborting the cherry-pick and restoring the tree) when a cherry-pick fix-up is declined, and catch it in cherry_pick() so it returns only what actually landed. The merge loops already treat the returned list generically, so they keep offering further branches and still resolve the associated JIRA. Generated-by: Claude Code with Claude Opus 4.8
uros-b
commented
Aug 12, 2026
uros-b
left a comment
Member
Author
There was a problem hiding this comment.
@cloud-fan Please review.
cloud-fan
approved these changes
Aug 12, 2026
cloud-fan
left a comment
Contributor
There was a problem hiding this comment.
0 blocking, 0 non-blocking, 2 nits.
The control flow is sound; two added comments need small accuracy and grammar fixes.
Nits: 2 minor items (see inline comments).
Verification
Traced both main cherry-pick loops through the single-branch and Upstream-First paths. Returned branch lists preserve successful pushes, skipped branches are not added to merged_refs, and the normal merge path still reaches JIRA resolution.
HyukjinKwon
approved these changes
Aug 13, 2026
Member
Author
|
Thank you @cloud-fan and @HyukjinKwon! |
Member
Author
|
Merge Summary:
Posted by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR changes how
dev/merge_spark_pr.pyhandles a committer declining to resolve a conflicting backport cherry-pick.Previously, when a cherry-pick onto a maintenance branch conflicted, the script prompted
Would you like to manually fix-up this merge?. AnsweringNwent throughcontinue_maybe(..., cherry=True), which aborted the cherry-pick and then calledfail("Okay, exiting")— terminating the whole run viasys.exit(-1). As a result the committer never reached the JIRA-resolution step, and the process exited non-zero, even though the merge into the target branch (and any earlier cherry-picks) had already been pushed.This PR makes declining a cherry-pick fix-up skip only that one branch and continue:
SkipCherryPickexception. When a cherry-pick fix-up prompt is declined,continue_maybeaborts the cherry-pick, restores the working tree (clean_up()), and raisesSkipCherryPickinstead of callingfail().cherry_pick()catchesSkipCherryPickand returns only the picks that actually landed (empty, or — in the Upstream-First two-branch path — just the sibling branch that was already pushed).main()already consume the returned list generically (merged_refs + []is a no-op), so no loop changes are needed: after a skip they simply offer the next branch and still proceed to resolve the associated JIRA.Hard aborts elsewhere are unchanged (e.g. declining the push prompt, or choosing
[a]bortat the Upstream-First prompt, still exit).Why are the changes needed?
Backport cherry-pick conflicts are routine, and by the time one occurs the merge into the target branch has already been pushed. Aborting the entire script on a declined fix-up means the committer:
Declining a single conflicting backport should skip just that branch and let the merge finish cleanly.
Does this PR introduce any user-facing change?
No. This changes a committer-only developer tool (
dev/merge_spark_pr.py); it is not part of any Spark release artifact.How was this patch tested?
doctest.testmod()at startup): 76 attempted, 0 failed.python3 -m py_compile dev/merge_spark_pr.pyis clean.cherry_pickreturns[], the loop re-prompts and JIRA resolution still runs;[b]othpath with the second pick declined -> the already-pushed sibling branch is still returned and recorded in the merge comment /merged_refs;[a]bortat the Upstream-First prompt, still hard-exit as before.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code with Claude Opus 4.8