SteNicholas commented on code in PR #3823:
URL: https://github.com/apache/celeborn/pull/3823#discussion_r3844659139


##########
dev/merge_pr.py:
##########
@@ -634,11 +691,27 @@ def main():
 
     merge_hash = merge_pr(pr_num, target_ref, title, body, pr_repo_desc)
 
+    # Ordered (branch, commit hash) pairs for the merge comment: the merge 
sink first,
+    # then each cherry-pick target as it is picked.
+    merged_commits = [(target_ref, merge_hash)]
+
     pick_prompt = "Would you like to pick %s into another branch?" % merge_hash
-    while input("\n%s (y/n): " % pick_prompt).lower() == "y":
-        merged_refs = merged_refs + [
-            cherry_pick(pr_num, merge_hash, next(branch_iter, branch_names[0]))
-        ]
+    # Post the summary in a finally block: the merge into the target branch 
has already
+    # been pushed, so aborting a later cherry-pick must not drop that line.
+    try:
+        while input("\n%s (y/N): " % pick_prompt).lower() == "y":
+            picked = cherry_pick(pr_num, merge_hash, next(branch_iter, 
branch_names[0]))
+            merged_refs = merged_refs + [picked[0]]
+            merged_commits = merged_commits + [picked]
+    finally:
+        # The "Closes #N" string in the commit message only auto-closes the PR 
when the
+        # commit lands on the default branch. For merges into other branches 
(e.g.
+        # branch-X.Y backport PRs), GitHub leaves the PR open, so close it 
through the API.
+        pr_state = get_json("%s/pulls/%s" % (GITHUB_API_BASE, 
pr_num)).get("state")

Review Comment:
   This calls `get_json()`, which exits on HTTP errors and lets connection 
errors escape. Because the target commit has already been pushed, a rate-limit 
or network failure here prevents `post_merge_comment()` and all later JIRA 
handling; rerunning the merge is not a safe recovery. Please catch and report 
this state check locally, and ensure the remaining bookkeeping still runs.



-- 
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]

Reply via email to