Skip to content

[no-ci] Trust any collaborator in restricted-paths guard#2010

Open
rwgk wants to merge 6 commits intoNVIDIA:mainfrom
rwgk:restricted-paths-guard_trust_any_collaborator
Open

[no-ci] Trust any collaborator in restricted-paths guard#2010
rwgk wants to merge 6 commits intoNVIDIA:mainfrom
rwgk:restricted-paths-guard_trust_any_collaborator

Conversation

@rwgk
Copy link
Copy Markdown
Contributor

@rwgk rwgk commented May 2, 2026

The main rationale for this change is that the restricted-paths guard is meant to distinguish collaborators from non-collaborators, not to distinguish write-capable collaborators from read- or triage-level collaborators.

In practice, the current workflow is stricter than that: it only trusts admin, maintain, and write from the collaborator-permission API. That produced a false positive on PR #1821, where the author is an org member and a repository collaborator, but the collaborator API returned read, so touching cuda_bindings/ incorrectly caused Needs-Restricted-Paths-Review to be applied.

This change widens the trusted set to any collaborator permission level: read, triage, write, maintain, or admin. none remains untrusted, and non-200|404 API errors still fail the workflow instead of applying the label from an unknown state.

While touching the same workflow, this branch also adds a small usability improvement: when CI: Restricted Paths Guard newly assigns Needs-Restricted-Paths-Review, it posts a short PR comment with a direct link to the workflow run. The goal is to make it much easier for authors and reviewers to find the job Summary that explains why the label was applied, instead of having to hunt through the Actions UI.

Tested successfully via the temporary/scratch PR #2011

rwgk and others added 3 commits May 1, 2026 18:06
Restricted-paths review is only meant for authors outside the collaborator
set, so read and triage access should count as trusted signals too.

Co-authored-by: Cursor <cursoragent@cursor.com>
Make it easier to discover why Needs-Restricted-Paths-Review was applied by
posting a short PR comment with a link to the workflow run summary whenever
the label is newly added.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is for testing the collaborator permission check and must be
reverted before merge:

1. Changes trigger from pull_request_target to pull_request so this
   branch's workflow definition runs instead of main's.

2. Adds a dummy change to cuda_bindings/pyproject.toml to trigger the
   restricted-paths detection.

REVERT THIS COMMIT BEFORE MERGE.

Made-with: Cursor
@rwgk rwgk added this to the cuda.bindings next milestone May 2, 2026
@rwgk rwgk self-assigned this May 2, 2026
@rwgk rwgk added bug Something isn't working P1 Medium priority - Should do CI/CD CI/CD infrastructure labels May 2, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented May 2, 2026

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.

@github-actions github-actions Bot added the cuda.bindings Everything related to the cuda.bindings module label May 2, 2026
This commit is for testing the label-and-comment path and must be reverted
before merge. It temporarily treats write access as untrusted so the current
PR will exercise Needs-Restricted-Paths-Review assignment again.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rwgk rwgk mentioned this pull request May 2, 2026
@rwgk rwgk marked this pull request as ready for review May 2, 2026 02:08
@rwgk
Copy link
Copy Markdown
Contributor Author

rwgk commented May 2, 2026

/ok to test

@rwgk rwgk requested a review from leofang May 2, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant