holdenk commented on code in PR #60471:
URL: https://github.com/apache/spark/pull/60471#discussion_r4584874356


##########
dev/merge_spark_pr.py:
##########
@@ -1381,6 +1958,12 @@ def cherry_pick(pr_num, merge_hash, default_branch, 
branch_names, target_ref, al
             f"Valid branches: {valid_branches}. Please try again."
         )
 
+    def pick(ref):
+        pair = _do_cherry_pick(pr_num, merge_hash, ref)
+        if record:
+            record(pair)

Review Comment:
   Fixed rather than marked, in 7ebc62246db: `_do_cherry_pick` now takes 
`record` and calls it right after `git.push`, before `clean_up()`, so a cleanup 
that raises no longer loses the pick. `pick()` in `cherry_pick` no longer 
records the returned pair, so each pick is recorded once. The `_do_cherry_pick` 
doctest pins the order (push, record, clean_up), including a `clean_up` that 
raises, and that a failed push or a skip records nothing.
   
   ---
   <sub>🤖 Posted by an AI agent (Claude Code · skill `none`) on behalf of 
@holdenk.</sub>
   <!-- agent-attribution v1: agent=claude-code; skill=none; operator=holdenk 
-->



##########
dev/merge_spark_pr.py:
##########
@@ -3530,6 +4117,10 @@ def main():
     # cherry_pick, so each grows with every cherry-pick -- including branches 
consumed by the
     # Upstream-First two-branch path inside cherry_pick (e.g. picking 
branch-M.x + branch-M.N
     # in a single prompt). It starts with target_ref, the merge sink, never to 
be re-picked.
+    def record(pair):

Review Comment:
   Fixed in 7ebc62246db. `cherry_pick`'s doctest now covers the plain, `[o]nly` 
and `[b]oth` picks (and a skipped or exiting second pick), and a new 
`main_records` doctest runs both `main()` loops with a `cherry_pick` stand-in 
that calls the `record` it is handed, asserting the pairs `post_merge_comment` 
gets and the branches `update_jira_for_pr` gets, including a run whose later 
pick exits.
   
   Each of these now fails the self-test (checked by mutation): bypassing 
`record` at the plain, `[o]nly`, first `[b]oth` or second `[b]oth` pick, 
recording twice, dropping `record=record` from either `main()` call, and 
dropping either append from either closure.
   
   ---
   <sub>🤖 Posted by an AI agent (Claude Code · skill `none`) on behalf of 
@holdenk.</sub>
   <!-- agent-attribution v1: agent=claude-code; skill=none; operator=holdenk 
-->



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to