Skip to content

Commit e91c0cb

Browse files
committed
ci: retire legacy branch-based bindings maintenance
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
1 parent 463bd2c commit e91c0cb

34 files changed

Lines changed: 971 additions & 369 deletions

‎.github/RELEASE-bindings.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,20 @@ boundary, not a separate long-term home for shared infrastructure.
3636
## Move fixes between integration and release branches
3737

3838
Prefer a reviewed fix on `main`, then backport it to the selected release
39-
branch in a separate PR. Inspect the diff, request CI using the normal PR
40-
approval procedure, and review it before merging. Conflicts and toolkit-specific
41-
generated changes require an explicitly reviewed adaptation.
39+
branch. Run **CI: Backport a merged PR to a release branch** from the Actions
40+
tab on `main`, supplying the merged PR number and one existing target branch.
41+
The workflow opens a PR; it does not merge or release the result. Inspect the
42+
diff, request CI using the normal PR approval procedure, and review it before
43+
merging. Workflow-file changes require a manual backport with appropriate
44+
credentials. Conflicts and toolkit-specific generated changes require an
45+
explicitly reviewed adaptation.
4246

4347
If urgency requires a fix on the release branch first, link a follow-up PR
4448
reconciling the fix back into `main` before closing the release checklist. In either
4549
direction, assess both bindings roots and record why a change applies to one
4650
or both. Regenerate affected generated files from the intended toolkit and
4751
cybind inputs instead of blindly copying generated output between majors.
52+
See the [shared maintenance policy](../ci/README.md#maintaining-both-bindings-roots).
4853

4954
## Validate and publish the selected line
5055

@@ -55,8 +60,8 @@ cybind inputs instead of blindly copying generated output between majors.
5560
branch. Normal development CI includes dependent packages and may cover
5661
both majors. Resolve failures in affected code before selecting the tag.
5762
3. Create the approved immutable `vX.Y.Z` tag at the selected source commit.
58-
Tag-triggered CI builds both bindings lines and their consumers. The release
59-
workflow selects only the requested line's bindings or metapackage artifacts.
63+
Tag-triggered CI selects that line's bindings and metapackage, validates them
64+
with the published Pathfinder dependency, and builds release artifacts.
6065
The tag does not have to be on `main`. Wait for this exact tag's CI to pass.
6166
4. Run **CI: Release** with `release-action=dry-run`, the tag, and
6267
`component=cuda-bindings`; repeat for `cuda-python`. Leave `run-id` blank

‎.github/dependabot.yml‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,3 @@ updates:
5555
time: "09:00"
5656
timezone: "America/Los_Angeles"
5757
open-pull-requests-limit: 1
58-
59-
# GitHub Actions updates targeting the 12.9.x branch
60-
- package-ecosystem: github-actions
61-
directories:
62-
- /
63-
- /.github/actions/*
64-
target-branch: "12.9.x" # keep in sync with backport_branch in ci/versions.yml
65-
schedule:
66-
interval: "monthly"
67-
time: "09:00"
68-
timezone: "America/Los_Angeles"
69-
70-
# Keep churn down: only one open PR from this ecosystem at a time
71-
open-pull-requests-limit: 1
72-
73-
groups:
74-
actions-monthly:
75-
applies-to: version-updates
76-
patterns: ["*"]
77-
update-types: ["major", "minor", "patch"]
78-
79-
labels: [CI/CD, dependencies]

‎.github/workflows/backport.yml‎

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,84 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
name: "CI: Backport the merged PR"
5+
name: "CI: Backport a merged PR to a release branch"
66

77
on:
8-
pull_request_target:
9-
types: [closed, labeled]
10-
branches:
11-
- main
128
workflow_dispatch:
139
inputs:
1410
backport-branch:
15-
description: "Branch to backport commits onto"
16-
required: false
11+
description: "Existing release branch to receive the fix"
12+
required: true
1713
type: string
1814
pull-request:
19-
description: "PR to backport"
15+
description: "Merged PR to backport"
2016
required: true
2117
type: number
2218

23-
2419
permissions:
25-
contents: write # so it can comment
26-
pull-requests: write # so it can create pull requests
20+
contents: write
21+
pull-requests: write
22+
23+
concurrency:
24+
group: backport-${{ inputs.pull-request }}-${{ inputs.backport-branch }}
25+
cancel-in-progress: false
2726

2827
jobs:
29-
backport-from-pr:
30-
name: Backport directly from a pull request
31-
if: ${{ github.repository_owner == 'nvidia' &&
32-
github.event.pull_request.merged == true &&
33-
contains( github.event.pull_request.labels.*.name, 'to-be-backported')
34-
}}
28+
backport:
29+
if: github.repository == 'NVIDIA/cuda-python'
3530
runs-on: ubuntu-latest
3631
steps:
37-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
32+
- name: Checkout workflow source
33+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
34+
with:
35+
ref: ${{ github.sha }}
3836

39-
- name: Load branch name
40-
id: get-branch
37+
- name: Validate source PR and target branch
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
GH_REPO: ${{ github.repository }}
41+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
42+
BACKPORT_BRANCH: ${{ inputs.backport-branch }}
43+
PR_NUMBER: ${{ inputs.pull-request }}
4144
run: |
42-
OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml)
43-
echo "OLD_BRANCH=${OLD_BRANCH}" >> $GITHUB_ENV
45+
set -euo pipefail
46+
if [[ ! "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]]; then
47+
echo "::error::The source PR must be a positive integer."
48+
exit 1
49+
fi
50+
if ! git check-ref-format "refs/heads/$BACKPORT_BRANCH"; then
51+
echo "::error::Provide one exact target branch name."
52+
exit 1
53+
fi
54+
if [[ "$BACKPORT_BRANCH" == "$DEFAULT_BRANCH" ]]; then
55+
echo "::error::Choose a release branch, not the default branch."
56+
exit 1
57+
fi
58+
if ! git ls-remote --exit-code --heads origin "refs/heads/$BACKPORT_BRANCH"; then
59+
echo "::error::The target branch must already exist in this repository."
60+
exit 1
61+
fi
62+
if [[ "$(gh pr view "$PR_NUMBER" --repo "$GH_REPO" --json state --jq .state)" != MERGED ]]; then
63+
echo "::error::The source PR must already be merged in this repository."
64+
exit 1
65+
fi
4466
45-
- name: Create backport pull requests
67+
# Workflow-file changes need a manual backport because GITHUB_TOKEN
68+
# cannot push them. Generated changes need target-specific regeneration.
69+
- name: Create backport pull request
70+
id: backport
4671
uses: korthout/backport-action@8560fb503c275d433c56f05a2f64850093baa9f7 # v4.7.0
4772
with:
73+
source_pr_number: ${{ inputs.pull-request }}
74+
target_branches: ${{ inputs.backport-branch }}
75+
# The explicit target must not be combined with source PR labels.
76+
label_pattern: ''
4877
copy_assignees: true
49-
copy_labels_pattern: true
78+
copy_labels_pattern: '^(?!to-be-backported$|backport ).*'
5079
copy_requested_reviewers: true
51-
target_branches: ${{ env.OLD_BRANCH }}
52-
backport-to-branch:
53-
name: Backport a specific PR against a specific branch
54-
if: github.repository_owner == 'nvidia' && github.event_name == 'workflow_dispatch'
55-
runs-on: ubuntu-latest
56-
steps:
57-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5880

59-
- name: Load branch from environment name
60-
if: inputs.backport-branch == null
81+
- name: Require successful backport
82+
if: steps.backport.outputs.was_successful != 'true'
6183
run: |
62-
BACKPORT_BRANCH=$(yq '.backport_branch' ci/versions.yml)
63-
echo "BACKPORT_BRANCH=${BRANCH}" >> $GITHUB_ENV
64-
65-
- name: Load branch name from input
66-
if: inputs.backport-branch != null
67-
run: echo "BACKPORT_BRANCH=${{ inputs.backport-branch }}" >> $GITHUB_ENV
68-
69-
- name: Create backport pull requests
70-
uses: korthout/backport-action@8560fb503c275d433c56f05a2f64850093baa9f7 # v4.7.0
71-
with:
72-
copy_assignees: true
73-
copy_labels_pattern: true
74-
copy_requested_reviewers: true
75-
target_branches: ${{ env.BACKPORT_BRANCH }}
76-
source_pr_number: ${{ inputs.pull-request }}
84+
echo "::error::Backport failed; resolve the conflict or prepare the target-specific fix manually."
85+
exit 1

‎.github/workflows/build-wheel.yml‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -502,14 +502,6 @@ jobs:
502502
path: cuda_python/dist/${{ env.CURRENT_CUDA_VARIANT }}/*.whl
503503
if-no-files-found: error
504504

505-
- name: Upload legacy CUDA13 metapackage alias
506-
if: ${{ (env.BUILD_CUDA_PYTHON_CURRENT == 'true' || env.BASELINE_RUN_ID != '') && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
507-
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
508-
with:
509-
name: cuda-python-wheel
510-
path: cuda_python/dist/${{ env.CURRENT_CUDA_VARIANT }}/*.whl
511-
if-no-files-found: error
512-
513505
- name: List the cuda-python artifacts directories
514506
if: ${{ (env.BUILD_CUDA_PYTHON == 'true' || env.BASELINE_RUN_ID != '') && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }}
515507
run: |
@@ -617,14 +609,6 @@ jobs:
617609
path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }}
618610
if-no-files-found: error
619611

620-
- name: Upload legacy CUDA13 Core Cython alias
621-
if: ${{ env.TEST_CORE_CURRENT == 'true' }}
622-
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
623-
with:
624-
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
625-
path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*${{ env.PY_EXT_SUFFIX }}
626-
if-no-files-found: error
627-
628612
# Note: This overwrites CUDA_PATH etc.
629613
- name: Set up maintenance mini CTK
630614
if: ${{ !inputs.single-cuda-major && (env.BUILD_BINDINGS_MAINTENANCE == 'true' || env.BUILD_CORE == 'true' || env.TEST_BINDINGS_MAINTENANCE == 'true' || env.TEST_CORE_MAINTENANCE == 'true') }}

0 commit comments

Comments
 (0)