You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/05/26 10:47:48 UTC

[PR] [MINOR][INFRA] Prevent merging draft PRs in merge script [spark]

zhengruifeng opened a new pull request, #56120:
URL: https://github.com/apache/spark/pull/56120

   ### What changes were proposed in this pull request?
   
   Add a fail-hard check in `dev/merge_spark_pr.py` that aborts when the target PR is a draft (`pr["draft"] == True`). The check sits next to the existing `[WIP]`/`[DO-NOT-MERGE]` title guard.
   
   ### Why are the changes needed?
   
   A draft PR is, by definition, not ready for merge. The script today only inspects the title for `[WIP]`/`[DO-NOT-MERGE]`, so a committer who runs it against a draft PR whose title looks final can still kick off the merge flow. Checking the GitHub API's `draft` flag closes that gap.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Committer tooling only.
   
   ### How was this patch tested?
   
   Existing doctests in `dev/merge_spark_pr.py` still pass (`python3 -m doctest dev/merge_spark_pr.py` — 57/57).
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.7)


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-57077][INFRA] Prevent merging draft PRs in merge script [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #56120:
URL: https://github.com/apache/spark/pull/56120#issuecomment-4543647980

   use the updated script to merge this draft PR gets:
   ```bash
   (spark-dev-313) ➜  spark git:(merge-script-block-draft-pr-dev3) dev/merge_spark_pr.py
   git rev-parse --abbrev-ref HEAD
   Which pull request would you like to merge? (e.g. 34): 56120
   Cannot merge a draft PR #56120: [SPARK-57077][INFRA] Prevent merging draft PRs in merge script
   Restoring head pointer to merge-script-block-draft-pr-dev3
   git checkout merge-script-block-draft-pr-dev3
   Already on 'merge-script-block-draft-pr-dev3'
   git branch
   Restoring head pointer to merge-script-block-draft-pr-dev3
   git checkout merge-script-block-draft-pr-dev3
   Already on 'merge-script-block-draft-pr-dev3'
   git branch
   ```


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-57077][INFRA] Prevent merging draft PRs in merge script [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #56120: [SPARK-57077][INFRA] Prevent merging draft PRs in merge script
URL: https://github.com/apache/spark/pull/56120


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-57077][INFRA] Prevent merging draft PRs in merge script [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #56120:
URL: https://github.com/apache/spark/pull/56120#issuecomment-4551615057

   thanks, merged to master


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-57077][INFRA] Prevent merging draft PRs in merge script [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on code in PR #56120:
URL: https://github.com/apache/spark/pull/56120#discussion_r3305103238


##########
dev/merge_spark_pr.py:
##########
@@ -1120,6 +1120,10 @@ def main():
     if "[WIP]" in title or "[DO-NOT-MERGE]" in title:
         fail("Cannot merge a PR with [WIP] or [DO-NOT-MERGE] in the title:\n%s" % title)
 
+    # Fail hard on draft PRs to prevent accidental merges.
+    if pr.get("draft", False):
+        fail("Cannot merge a draft PR #%s: %s" % (pr_num, title))

Review Comment:
   Since this is simple, could you merge this into the above existing logic like the following? I guess this new message is more proper to cover all WIP cases.
   ```scala
   if pr.get("draft", False) or "[WIP]" in title or "[DO-NOT-MERGE]" in title:
       fail("Cannot merge a draft PR #%s: %s" % (pr_num, title))
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-57077][INFRA] Prevent merging draft PRs in merge script [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on code in PR #56120:
URL: https://github.com/apache/spark/pull/56120#discussion_r3307673668


##########
dev/merge_spark_pr.py:
##########
@@ -1120,6 +1120,10 @@ def main():
     if "[WIP]" in title or "[DO-NOT-MERGE]" in title:
         fail("Cannot merge a PR with [WIP] or [DO-NOT-MERGE] in the title:\n%s" % title)
 
+    # Fail hard on draft PRs to prevent accidental merges.
+    if pr.get("draft", False):
+        fail("Cannot merge a draft PR #%s: %s" % (pr_num, title))

Review Comment:
   sounds good



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org