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


##########
dev/merge_spark_pr.py:
##########
@@ -117,6 +117,8 @@
 # See 
https://docs.github.com/en/actions/how-tos/manage-workflow-runs/skip-workflow-runs
 POST_MERGE_CI_INTERVALS = {"master": 10, "branch-4.x": 10}
 POST_MERGE_CI_SKIP_TRAILER = "skip-checks: true"
+# A PR carrying this GitHub label always runs post-merge CI, regardless of the 
interval.
+POST_MERGE_CI_FORCE_LABEL = "do-not-skip-ci"

Review Comment:
   Some data for this thread. Adding a label on GitHub takes the Triage role or 
higher. PR authors with only Read access can't add labels, even on their own 
PRs. On apache/spark, that means committers plus the collaborators listed in 
`.asf.yaml`. Today the only collaborator is the `spark-test` bot, which has 
Triage so it can remove `ai-review-requested`. The `do-not-skip-ci` label 
already exists in the repo ("Ignore the post-merge sampling rule for CI.").
   
   Even if someone else could add it, the label only ever turns post-merge CI 
*on*. It can't make the script add `skip-checks: true`. So misusing it would 
cost CI minutes but can't hide a broken commit.
   
   Compared with a prompt inside the script, a label has one practical 
advantage: it is read again on every run. If a PR is backported later in a 
separate run (the already-merged path in `main()`), it still gets post-merge CI 
on the release branches without anyone remembering to answer a prompt again. 
And the decision stays visible on the PR.
   



##########
dev/merge_spark_pr.py:
##########
@@ -879,11 +889,19 @@ 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``.
     """
+    if force_post_merge_ci:

Review Comment:
   Minor: since the label is checked before the interval lookup, a branch with 
no configured interval also prints "Post-merge CI will run on branch-4.0: the 
PR has the 'do-not-skip-ci' label." when cherry-picking a labeled PR. CI runs 
there anyway, so the reason given is misleading. Checking the label after 
`POST_MERGE_CI_INTERVALS.get(target_ref)` and the `None` early return would 
still return before any git call (it is only a dict lookup), and it would print 
the label message only when the label actually changes the result:
   
   ```python
       interval = POST_MERGE_CI_INTERVALS.get(target_ref)
       if interval is None:
           return False
   
       if force_post_merge_ci:
           print(...)
           return False
   ```
   



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