Skip to content

[no-ci] pr-metadata-check: restrict cuda_bindings changes to NVIDIA organization members#1871

Closed
rwgk wants to merge 3 commits intoNVIDIA:mainfrom
rwgk:pr-metadata-check-author-is-member
Closed

[no-ci] pr-metadata-check: restrict cuda_bindings changes to NVIDIA organization members#1871
rwgk wants to merge 3 commits intoNVIDIA:mainfrom
rwgk:pr-metadata-check-author-is-member

Conversation

@rwgk
Copy link
Copy Markdown
Collaborator

@rwgk rwgk commented Apr 7, 2026

Closed: Superseded by #1878

Related issue: #1139

  • Extend pr-metadata-check to read the PR author's association and changed files from the pull_request_target payload/API.
  • Block PRs that touch cuda_bindings/ unless the author association is MEMBER or OWNER, including rename cases.
  • Update the workflow messaging to reflect the broader requirements check and point contributors to cuda_bindings/LICENSE.

Note: We don't have a practical way to end-to-end test this workflow before merging. If issues show up after merge, we can roll back quickly with a [no-ci] revert PR.

Keep the PR policy workflow self-contained by using the pull request payload and files API to block non-members from modifying low-level bindings.

Made-with: Cursor
@rwgk rwgk added this to the cuda.bindings next milestone Apr 7, 2026
@rwgk rwgk self-assigned this Apr 7, 2026
@rwgk rwgk added P1 Medium priority - Should do CI/CD CI/CD infrastructure github_actions Pull requests that update GitHub Actions code labels Apr 7, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 7, 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.

@rwgk rwgk marked this pull request as ready for review April 7, 2026 15:15
@rwgk rwgk requested review from leofang and rparolin April 7, 2026 15:15
Copy link
Copy Markdown
Contributor

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exploration of using gh api instead of raw curl invocations and lots of bash is warranted here.

page=1
TOUCHES_CUDA_BINDINGS=false
while true; do
FILES_JSON=$(curl --silent --show-error --fail \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using curl here instead of gh api --paginate? It seems like maybe you haven't told your agent about using gh instead of raw curl for things like this.

You can also have it run that jq script using --jq, make it even more readable and concise.

You can then avoid looping over API invocations and burning up gh rate limits as well as all the overwrought bash that hardcodes the page size and checks for pages with fewer files than that number.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: commit a52b862

It seems like maybe you haven't told your agent about using gh instead of raw curl for things like this.

Yes. I assumed it'd know such things. Probably next month :-)

rwgk added 2 commits April 7, 2026 10:26
Align the PR metadata workflow with repo conventions by using gh to paginate the PR file list, keeping the bindings restriction check simpler and easier to review.

Made-with: Cursor
done <<<"$BLOCKED_LABELS"

# Only NVIDIA organization members may change code under cuda_bindings.
if [ "$AUTHOR_ASSOCIATION" != "MEMBER" ] && [ "$AUTHOR_ASSOCIATION" != "OWNER" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: I assume checking MEMBER is enough? Do we need OWNER here?

flatten
| any(
.[];
(.filename | startswith("cuda_bindings/"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important: Also include cuda_python/

#
# SPDX-License-Identifier: Apache-2.0

name: "CI: Enforce assignee/label/milestone on PRs"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in this team meeting, it would be awesome if the org check was a separate line item to make it obvious when it fails.

@rwgk
Copy link
Copy Markdown
Collaborator Author

rwgk commented Apr 7, 2026

Superseded by #1878

@rwgk rwgk closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure github_actions Pull requests that update GitHub Actions code P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Autogenerate a PR comment for contributors making changes to the cuda_bindings/ directory

4 participants