gaogaotiantian commented on code in PR #60261:
URL: https://github.com/apache/spark/pull/60261#discussion_r4558390200


##########
dev/merge_spark_pr.py:
##########
@@ -879,15 +889,23 @@ def clean_up():
             git.run("git branch -D %s" % branch)
 
 
-def should_skip_post_merge_ci(target_ref):
+def should_skip_post_merge_ci(target_ref, force_post_merge_ci=False):
     """Return whether the next commit on ``target_ref`` should skip post-merge 
CI.
 
     The branch history count matches the check formerly performed in 
``build_main.yml``.
+    ``force_post_merge_ci`` is set when the PR carries 
``POST_MERGE_CI_FORCE_LABEL``.
     """
     interval = POST_MERGE_CI_INTERVALS.get(target_ref)
     if interval is None:
         return False
 
+    if force_post_merge_ci:
+        print(
+            "Post-merge CI will run on %s: the PR has the %r label."

Review Comment:
   Done in b677ab8 with your wording for both the comment and the message.
   



##########
dev/merge_spark_pr.py:
##########
@@ -1046,7 +1081,7 @@ def _do_cherry_pick(pr_num, merge_hash, pick_ref):
     git.run("git fetch %s %s:%s" % (PUSH_REMOTE_NAME, pick_ref, 
pick_branch_name))
     git.run("git checkout %s" % pick_branch_name)
     pick_head = git.run("git rev-parse HEAD").strip()
-    skip_post_merge_ci = should_skip_post_merge_ci(pick_ref)
+    skip_post_merge_ci = should_skip_post_merge_ci(pick_ref, 
force_post_merge_ci)

Review Comment:
   Done in b677ab8. A cherry-pick that skips post-merge CI now also prints `If 
you stop this pick to rerun, answer N to 'Would you like to update an 
associated JIRA?' first. The rerun updates the JIRA.` The merge path doesn't 
print it, since stopping there never reaches the JIRA update.
   



##########
dev/merge_spark_pr.py:
##########
@@ -3203,6 +3247,7 @@ def main():
 
     url = pr["url"]
     title = pr["title"]
+    force_post_merge_ci = any(label["name"] == POST_MERGE_CI_FORCE_LABEL for 
label in pr["labels"])

Review Comment:
   Done in b677ab8. `should_skip_post_merge_ci` now reads `/issues/<pr>/labels` 
only when the commit would otherwise skip, and on every call, so a label added 
during the run reaches the later picks. This replaces the `force_post_merge_ci` 
argument. I also merged master so the read goes through `get_json_pages` 
(56150aa).
   



##########
dev/merge_spark_pr.py:
##########
@@ -3203,6 +3247,7 @@ def main():
 
     url = pr["url"]
     title = pr["title"]
+    force_post_merge_ci = any(label["name"] == POST_MERGE_CI_FORCE_LABEL for 
label in pr["labels"])

Review Comment:
   Done in b677ab8, it now compares `label["name"].lower()`.
   



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