[no-ci] CI: add dedicated merge gate for restricted-paths review#1896
Open
rwgk wants to merge 3 commits intoNVIDIA:mainfrom
Open
[no-ci] CI: add dedicated merge gate for restricted-paths review#1896rwgk wants to merge 3 commits intoNVIDIA:mainfrom
rwgk wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
Add a dedicated workflow that fails when the Needs-Restricted-Paths-Review label is present. This gives branch protection a narrowly scoped merge gate for restricted-paths policy without making the broader PR metadata checks required. Made-with: Cursor
Contributor
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Temporarily switch the new workflow to pull_request so PR NVIDIA#1896 can exercise the label-driven pass/fail behavior before the workflow exists on the base branch. This lets us validate the gate logic pre-merge and then switch back to pull_request_target for the final rollout. Test plan: 1. Temporarily switch the new workflow to `pull_request`. 2. Push to PR `NVIDIA#1896`. 3. Add the label and confirm the check goes red. 4. Remove the label and confirm the check goes green. 5. Switch it back to `pull_request_target` before merging. Made-with: Cursor
This reverts commit 2b94e27.
Collaborator
Author
|
Smoke testing, as described in the message of commit 2b94e27: Manually add Needs-Restricted-Paths-Review label
Summary of failed (as expected) workflow
Manually remove Needs-Restricted-Paths-Review label
Summary of successful workflow
|
Collaborator
Author
|
@aterrel I think the chance of something still slipping through the cracks is very small:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Follow-on to PR #1878
Add a dedicated GitHub Actions workflow,
restricted-paths-review-gate.yml, that fails when theNeeds-Restricted-Paths-Reviewlabel is present on a PR.This keeps the merge-blocking behavior narrowly scoped to the restricted-paths policy, instead of making the broader checks in
pr-metadata-check.ymlrequired.Why a separate workflow
pr-metadata-check.ymlis not currently merge-blocking.pr-metadata-check.ymlwould mix two different policies:PR metadata hygiene and restricted-paths review.
if
Needs-Restricted-Paths-Reviewis present, merging is blocked until a maintainer removes the label.Behavior
restricted-paths-guard.ymlworkflow continues to assignNeeds-Restricted-Paths-Reviewwhen an untrusted author touchescuda_bindings/orcuda_python/.restricted-paths-review-gate.ymlworkflow reads the live PR labels and:Needs-Restricted-Paths-Reviewis presentpull_request_targetworkflow so it can be used as a required status check in branch protection / rulesets.Important rollout detail
This PR adds the workflow only. The check does not become merge-blocking until a repo admin adds the new check to the repository ruleset after this PR is merged.
Post-merge admin steps
Settings->Rules->Rulesets->Prevent committing without PR.Required status checks.Restricted paths review gate.Needs-Restricted-Paths-Review: merging should be blocked while the label is present, and unblocked after a maintainer removes it.Branch-scope note
The existing
Prevent committing without PRruleset applies to:main12.9.x11.8.xrelease/**/*If the new gate should apply to all of those branches, editing that existing ruleset is the right approach.
If the new gate should apply only to
main, the better follow-up is to create a separate ruleset scoped only torefs/heads/mainand requireRestricted paths review gatethere.Made with Cursor GPT-5.4 Extra High Fast