Skip to content

Commit 73e840e

Browse files
committed
Merge branch 'main' into pathfinder_in_build-system_requires
2 parents 3d422de + 613be11 commit 73e840e

File tree

15 files changed

+1181
-873
lines changed

15 files changed

+1181
-873
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: "CI: Enforce label/milestone on PRs"
6+
7+
on:
8+
pull_request_target:
9+
types:
10+
- opened
11+
- edited
12+
- synchronize
13+
- labeled
14+
- unlabeled
15+
- reopened
16+
- ready_for_review
17+
18+
jobs:
19+
check-metadata:
20+
name: PR has labels and milestone
21+
if: github.repository_owner == 'NVIDIA'
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check for labels and milestone
25+
env:
26+
LABELS: ${{ toJson(github.event.pull_request.labels) }}
27+
MILESTONE: ${{ github.event.pull_request.milestone && github.event.pull_request.milestone.title || '' }}
28+
PR_URL: ${{ github.event.pull_request.html_url }}
29+
IS_BOT: ${{ github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' || github.actor == 'copy-pr-bot[bot]' }}
30+
IS_DRAFT: ${{ github.event.pull_request.draft }}
31+
run: |
32+
if [ "$IS_BOT" = "true" ] || [ "$IS_DRAFT" = "true" ]; then
33+
echo "Skipping check for bot or draft PR."
34+
exit 0
35+
fi
36+
37+
LABEL_NAMES=$(echo "$LABELS" | jq -r '.[].name')
38+
ERRORS=""
39+
40+
# Module labels identify which package the PR touches.
41+
# Cross-cutting labels exempt PRs from needing a module label.
42+
MODULE_LABELS="cuda.bindings cuda.core cuda.pathfinder"
43+
MODULE_EXEMPT_LABELS="CI/CD"
44+
HAS_MODULE=false
45+
for label in $LABEL_NAMES; do
46+
for mod in $MODULE_LABELS $MODULE_EXEMPT_LABELS; do
47+
if [ "$label" = "$mod" ]; then
48+
HAS_MODULE=true
49+
break 2
50+
fi
51+
done
52+
done
53+
54+
if [ "$HAS_MODULE" = "false" ]; then
55+
ERRORS="${ERRORS}- **Missing module label**: add at least one of: \`cuda.bindings\`, \`cuda.core\`, \`cuda.pathfinder\` (or a cross-cutting label such as \`CI/CD\`).\n"
56+
fi
57+
58+
# Type labels categorize the kind of change.
59+
TYPE_LABELS="bug enhancement feature documentation test example CI/CD packaging dependencies performance experiment RFC support P0 P1 P2"
60+
HAS_TYPE=false
61+
for label in $LABEL_NAMES; do
62+
for typ in $TYPE_LABELS; do
63+
if [ "$label" = "$typ" ]; then
64+
HAS_TYPE=true
65+
break 2
66+
fi
67+
done
68+
done
69+
70+
if [ "$HAS_TYPE" = "false" ]; then
71+
ERRORS="${ERRORS}- **Missing type label**: add at least one of: \`bug\`, \`enhancement\`, \`feature\`, \`documentation\`, \`test\`, \`example\`, \`CI/CD\`, \`packaging\`, \`dependencies\`, \`performance\`, \`experiment\`, \`RFC\`, \`support\`, \`P0\`, \`P1\`, \`P2\`.\n"
72+
fi
73+
74+
if [ -z "$MILESTONE" ]; then
75+
ERRORS="${ERRORS}- **Missing milestone**: assign a milestone to this PR.\n"
76+
fi
77+
78+
# Block PRs with labels that indicate they are not ready to merge.
79+
BLOCKED_PATTERNS="blocked DO NOT MERGE do not merge"
80+
for label in $LABEL_NAMES; do
81+
for pattern in $BLOCKED_PATTERNS; do
82+
if echo "$label" | grep -qi "$pattern"; then
83+
ERRORS="${ERRORS}- **Blocked label detected**: label \`$label\` prevents merging. Remove it when the PR is ready.\n"
84+
break
85+
fi
86+
done
87+
done
88+
89+
if [ -n "$ERRORS" ]; then
90+
echo "::error::This PR is missing required metadata. See the job summary for details."
91+
{
92+
echo "## PR Metadata Check Failed"
93+
echo ""
94+
printf '%b' "$ERRORS"
95+
echo ""
96+
echo "Please update the PR at: $PR_URL"
97+
} >> "$GITHUB_STEP_SUMMARY"
98+
exit 1
99+
fi
100+
101+
LABEL_LIST=$(echo "$LABEL_NAMES" | paste -sd ', ' -)
102+
{
103+
echo "## PR Metadata Check Passed"
104+
echo ""
105+
echo "- **Labels**: $LABEL_LIST"
106+
echo "- **Milestone**: $MILESTONE"
107+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/test-wheel-windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ jobs:
263263
}
264264
265265
- name: Install cuda.pathfinder extra wheels for testing
266+
if: ${{ !endsWith(matrix.PY_VER, 't') }} # see issue #1820
266267
shell: bash --noprofile --norc -xeuo pipefail {0}
267268
run: |
268269
pushd cuda_pathfinder
@@ -271,6 +272,7 @@ jobs:
271272
popd
272273
273274
- name: Run cuda.pathfinder tests with all_must_work
275+
if: ${{ !endsWith(matrix.PY_VER, 't') }} # see issue #1820
274276
env:
275277
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
276278
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ guide for package-specific conventions and workflows.
1212
- `cuda_core/`: High-level Pythonic CUDA APIs built on top of bindings.
1313
- `cuda_python/`: Metapackage and docs aggregation.
1414

15+
# Pull requests
16+
17+
When creating pull requests with `gh pr create`, always assign at least one
18+
label and a milestone. CI enforces this via the `pr-metadata-check` workflow
19+
and will block PRs that are missing labels or a milestone. Use `--label` and
20+
`--milestone` flags, for example:
21+
22+
```
23+
gh pr create --title "..." --body "..." --label "bug" --milestone "v1.0"
24+
```
25+
26+
If you are unsure which label or milestone to use, check the existing labels
27+
and milestones on the repository with `gh label list` and `gh api
28+
repos/{owner}/{repo}/milestones --jq '.[].title'`, and pick the best match.
29+
30+
1531
# General
1632

1733
- When searching for text or files, prefer using `rg` or `rg --files`

0 commit comments

Comments
 (0)