Skip to content

[no-ci] Add auto-labeling workflow for PRs based on changed paths#1818

Open
leofang wants to merge 7 commits intoNVIDIA:mainfrom
leofang:ci/auto-label-prs
Open

[no-ci] Add auto-labeling workflow for PRs based on changed paths#1818
leofang wants to merge 7 commits intoNVIDIA:mainfrom
leofang:ci/auto-label-prs

Conversation

@leofang
Copy link
Copy Markdown
Member

@leofang leofang commented Mar 25, 2026

Summary

  • Adds actions/labeler v6 workflow to automatically apply module labels based on which directories a PR touches
  • Adds .github/labeler.yml config with 4 directory-to-label mappings:
    • cuda_bindings/**cuda.bindings
    • cuda_core/**cuda.core
    • cuda_pathfinder/**cuda.pathfinder
    • .github/** and ci/**CI/CD
  • Labels are only added, never removed (sync-labels: false by default in v6)
  • Uses pull_request_target for fork PR support (safe — only reads PR metadata, no code checkout)
  • Skips on non-NVIDIA forks via github.repository_owner == 'NVIDIA'

How it works with #1815

The auto-labeler runs on opened/synchronize and adds labels → this fires a labeled event → the metadata check from #1815 re-runs and sees the label(s). The two workflows complement each other naturally without needing explicit ordering.

Closes #1025

Test plan

  • Open a test PR touching cuda_core/ — verify cuda.core label is applied
  • Open a test PR touching .github/ or ci/ — verify CI/CD label is applied
  • Open a PR touching multiple directories — verify multiple labels applied
  • Verify manually added labels are not removed

🤖 Generated with Claude Code

leofang and others added 2 commits March 24, 2026 20:31
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Mar 25, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@leofang leofang requested a review from rparolin March 25, 2026 01:04
Comment thread .github/labeler.yml Outdated
Comment thread .github/workflows/pr-auto-label.yml
@cpcloud
Copy link
Copy Markdown
Contributor

cpcloud commented Mar 25, 2026

Who's consuming these labels, and for what purpose?

@rwgk
Copy link
Copy Markdown
Contributor

rwgk commented Mar 25, 2026

Archiving by-product of looking at this PR (generated by Cursor Opus 4.6 1M Thinking):


Label considerations for cuda_python/

Current state

PR #1818 introduces auto-labeling with four labels mapped to directory paths:

Label Path(s)
cuda.bindings cuda_bindings/**
cuda.core cuda_core/**
cuda.pathfinder cuda_pathfinder/**
CI/CD .github/**, ci/**

cuda_python/ has no mapping and would not trigger any label.

Why cuda.bindings is not a fit for cuda_python/

cuda_python is a metapackage. Its setup.py declares dependencies on both
cuda-bindings and cuda-pathfinder:

install_requires=[
    f"cuda-bindings{matcher}{version}",
    "cuda-pathfinder~=1.1",
],

Labeling cuda_python/** changes as cuda.bindings would be misleading:
the metapackage is not part of the bindings package, and changes to it are
typically about project-wide docs, release notes, or packaging -- not the
bindings layer specifically.

Evidence from git history

Out of 101 commits touching cuda_python/, 28 (~28%) touch only
cuda_python/ (and sometimes root-level files like README.md) without
touching any of cuda_bindings/, cuda_core/, cuda_pathfinder/, .github/,
or ci/. Under the current labeler config these PRs would receive no label.

Those 28 commits break down as:

  • Metapackage packaging and versioning -- setting up the pure-Python wheel,
    dynamic version/dependencies, version specifier fixes, tag regex changes.
  • Project-wide docs and release notes -- adding release notes for
    cuda-python versions, Sphinx theme/tooling changes, doc build fixes, project
    list and description updates.
  • Metapackage housekeeping -- README symlink, DESCRIPTION.rst cleanup,
    pathfinder mention in release notes.

These are legitimate, recurring changes with no natural home in the existing
four labels.

Recommendation

Introduce a cuda.python label mapped to cuda_python/**. This keeps every
subpackage directory covered by a label and avoids misattributing metapackage
work to a subpackage it does not belong to.

Copy link
Copy Markdown
Contributor

@rwgk rwgk left a comment

Choose a reason for hiding this comment

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

I know it's still in draft, but it looks good to me.

Adding a cuda.python label would seem useful (in another PR):

#1818 (comment)

Comment thread .github/workflows/pr-auto-label.yml
Comment thread .github/labeler.yml Outdated
@leofang leofang self-assigned this Apr 20, 2026
@leofang leofang added the CI/CD CI/CD infrastructure label Apr 20, 2026
@leofang leofang changed the title Add auto-labeling workflow for PRs based on changed paths [no-ci] Add auto-labeling workflow for PRs based on changed paths Apr 20, 2026
@leofang leofang marked this pull request as ready for review April 20, 2026 17:10
@leofang leofang added this to the cuda.core v1.0.0 milestone Apr 20, 2026
@leofang leofang added the enhancement Any code-related improvements label Apr 20, 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 enhancement Any code-related improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Enforce label/milestone assignment

4 participants