[no-ci] CI: Add restricted-paths-guard.yml#1878
Conversation
Report restricted-path author gating as its own workflow so contributors see the organization requirement as soon as a PR touches cuda_bindings/ or cuda_python/. Made-with: Cursor
|
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. |
Keep the lightweight PR check runnable on GitHub-hosted runners by avoiding the unsupported gh api --slurp --jq combination when scanning changed files. Made-with: Cursor
Include the exact restricted-path matches in the job summary so contributors and reviewers can see what triggered the author organization check. Made-with: Cursor
|
I dug into whether we can determine conclusively from GitHub Actions if a PR author is a member of the
So |
Query NVIDIA org membership directly for restricted-path PRs so the workflow can distinguish members, non-members, and inconclusive cases, label PRs that need manual review, and show the matched files. Keep the trigger on pull_request temporarily so the new check can be exercised before switching back to pull_request_target. Made-with: Cursor
This reverts commit 42ba3f8.
|
Reverting 42ba3f8 because the direct What we learned from the experiments:
Given the current goal of finding low-hanging fruit without introducing a dedicated PAT / GitHub App token, I think the direct org-membership query is not worth keeping in this PR. If we revisit this later, the realistic options seem to be:
|
Treat repository collaborators as trusted for restricted-path changes so the workflow blocks only authors with no collaborator, member, or owner association. Made-with: Cursor
Use OWNER and MEMBER associations plus public NVIDIA membership as true-positive signals, and add a review label instead of failing when the workflow cannot confirm the author automatically. Made-with: Cursor
This reverts commit 9dcf7b1.
Replace the public-membership probe with a checked-in allowlist so restricted-path PRs can still get a known true positive during rollout while labeling authors that need manual review. Made-with: Cursor
|
We explored a few different ways to get a trustworthy automatic "yes" for PR authors who touch
Given those constraints, the current PR state is a pragmatic compromise:
So the reason we ended up here is that the other approaches were either too lossy ( |
|
Archiving OUTDATED PR description posted originally 2026-04-07 03:04 PM PDT: Main open policy question
Current state
What was tried and backed out
What is already working
Notes before merge
|
Replace the remaining "true positive" terminology with "trusted signal" so the workflow summary and implementation language match the current manual-review design. Made-with: Cursor
Show both the previous and current path in the PR author check summary so rename-triggered matches are understandable during manual review. Made-with: Cursor
Remove the temporary checked-in allowlist and treat COLLABORATOR as a trusted author signal again so the workflow matches the team policy. Made-with: Cursor
Use shorter workflow and job names so the GitHub checks list is easier to scan while keeping the manual-review intent clear. Made-with: Cursor
Use a maintainer-facing label name that better describes the follow-up action required before merging inconclusive restricted-path changes. Made-with: Cursor
Use workflow, job, and summary names that match the current restricted-paths guard behavior and read more clearly in the GitHub checks UI. Made-with: Cursor
- undo cuda_bindings/pyproject.toml # XXX DUMMY CHANGE XXX - change trigger from pull_request (useful only for testing this PR) to pull_request_target
7fb4107 to
02edff4
Compare

Supersedes (and reuses work from) #1871
Closes #1139
Summary
This PR adds a separate workflow,
restricted-paths-guard.yml, for pull requests that touch restricted paths undercuda_bindings/orcuda_python/.The new
restricted-paths-guard.ymlworkflow does not implement strict enforcement. Instead, if a PR touches one of the restricted paths and we do not have a trusted signal for the PR author, the workflow assigns theNeeds-Restricted-Paths-Reviewlabel for manual follow-up. The job summary shows the author login, the author association, the matched restricted paths, the trusted signal, if any, that was used, and whether the label was needed.Trusted Signals
The current implementation treats the following as trusted signals (these are tightly controlled at the org level):
github.event.pull_request.author_associationisMEMBER,OWNER, orCOLLABORATORNote: This workflow currently trusts the PR author; it does not check the full provenance of every commit on the PR branch. In practice, that means a trusted signal also carries the expectation that the
cuda-pythonmaintainer who merges the PR is careful not to merge external-user commits touchingcuda_bindings/orcuda_python/.Intended Workflow Beyond This PR
The intended direction, in a follow-on PR, is for
Needs-Restricted-Paths-Reviewto become a merge-blocking mechanism for inconclusive cases.The flow would then be:
cuda_bindings/orcuda_python/Needs-Restricted-Paths-ReviewNeeds-Restricted-Paths-Reviewlabel manually and mergeIn other words, the workflow should automatically clear the easy, common cases and route the remaining ones into an explicit manual review step.
Testing
See commit 02edff4: the
pull_requesttrigger and a dummy change undercuda_bindings/were used for testing. This was undone in the commit.See below: Example Summary view of a workflow run (screenshot)