Skip to content

Commit 375be61

Browse files
committed
ci: separate required-check migration from link checking
1 parent 12b067f commit 375be61

4 files changed

Lines changed: 12 additions & 605 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,16 @@ and freshly rendered HTML, including link fragments. It runs on PR updates and
221221
from nightly CI; copied `pull-request/*` branches do not repeat these checks.
222222

223223
Nightly link checks start with a fresh cache and publish successful checks for
224-
PRs to reuse for up to one day. Quarterly pre-commit hook updates arrive as
225-
draft PRs for review. Lychee version updates are maintained separately so its
226-
local hook and CI binary stay aligned. The local lychee hook keeps its current
227-
behavior until a stable release supports an explicit cache location.
228-
229-
See [the pre-commit migration procedure](ci/README-pre-commit-migration.md) for
230-
manual workflow testing and the required-check cutover. The existing
231-
pre-commit.ci service remains required until that cutover is complete.
224+
PRs to reuse for up to one day. Dependabot checks pre-commit hook revisions
225+
monthly and opens update PRs with the `CI/CD` and `dependencies` labels, without
226+
an automatic assignee or milestone. Lychee version updates are maintained
227+
separately so its local hook and CI binary stay aligned. The local lychee hook
228+
keeps its current behavior until a stable release supports an explicit cache
229+
location.
230+
231+
See [the pre-commit workflow guide](ci/README-pre-commit-migration.md) for manual
232+
workflow testing. The existing pre-commit.ci service remains required until the
233+
required-check cutover is complete.
232234

233235
To set yourself up for running pre-commit checks locally and to catch issues before pushing your changes, follow these steps:
234236

‎ci/README-pre-commit-migration.md‎

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ run hosted checks without copying a PR into the heavyweight CUDA CI:
1515

1616
```sh
1717
gh workflow run pre-commit.yml --repo NVIDIA/cuda-python --ref REF
18-
gh workflow run pre-commit-autoupdate.yml --repo NVIDIA/cuda-python --ref REF \
19-
-f dry-run=true
2018
gh workflow run lychee.yml --repo NVIDIA/cuda-python --ref REF \
2119
-f refresh-cache=true
2220
gh workflow run lychee.yml --repo NVIDIA/cuda-python --ref REF \
@@ -26,7 +24,8 @@ gh workflow run ci-nightly.yml --repo NVIDIA/cuda-python --ref REF \
2624
gh run list --repo NVIDIA/cuda-python --branch REF
2725
```
2826

29-
The updater dry run shows its diff without opening or updating a PR. Lychee's
27+
Dependabot checks hook revisions monthly and opens update PRs with the `CI/CD`
28+
and `dependencies` labels, without an automatic assignee or milestone. Lychee's
3029
refresh mode skips restoration and publishes a new snapshot even when some
3130
links fail; only successful checks enter the persisted cache. Its normal mode
3231
restores the newest matching snapshot and does not publish one. Branch tests
@@ -50,58 +49,3 @@ PIXI_LOCKED=true pixi run --manifest-path cuda_core/pixi.toml -e docs \
5049
The build verifies all three sibling libraries import from the checkout,
5150
installs metapackage metadata without dependencies, and assembles all four
5251
latest documentation trees under `artifacts/docs`.
53-
54-
## Preview the ruleset change
55-
56-
Run from the repository root with an authenticated GitHub CLI:
57-
58-
```sh
59-
pixi exec --spec python python ci/tools/migrate_precommit_checks.py \
60-
--repo NVIDIA/cuda-python > /tmp/cuda-python-precommit-cutover.json
61-
```
62-
63-
The default mode only reads GitHub. It discovers active rules applying to
64-
`main`, fetches complete repository rulesets, and prints their original
65-
configuration and the exact proposed PUT payload. Review that JSON before
66-
cutover. The payload changes only `rules`: unrelated rules and required checks,
67-
strictness, branch conditions, bypass actors, and enforcement remain in place.
68-
The tool rejects inherited organization rulesets and unexpected integration IDs;
69-
an organization ruleset's owner must handle that migration separately.
70-
71-
## Cut over after merge
72-
73-
1. Merge `.github/workflows/pre-commit.yml` and `.github/workflows/lychee.yml`.
74-
Check that they exist on the current default `main` branch.
75-
2. Obtain successful, completed runs of all three replacement checks on current
76-
`main` or a representative open PR targeting `main`. Record the full checked
77-
commit SHA. This also verifies the PR event path when using a PR; a branch
78-
push run alone does not validate PR-specific behavior.
79-
3. After explicit authorization for the ruleset cutover, run the preview again,
80-
then run the same command with `--apply --verified-sha FULL_COMMIT_SHA`.
81-
Omitting `--verified-sha` requires checks on the current `main` commit.
82-
4. Confirm the active rules now require all three replacement contexts from the
83-
GitHub Actions App and still contain every unrelated requirement. Verify on
84-
a representative PR that an intentional formatting or broken-link failure
85-
is reported as a required failing check and blocks merging; repair it and
86-
verify the same check passes. Check this independently of the PR's draft
87-
status, which also prevents merging.
88-
5. Only after that verification, remove this repository from the pre-commit.ci
89-
GitHub App installation's repository access, or disable its service through
90-
the repository/service settings. Preserve access for other repositories
91-
using the same installation. The migration script never changes App access.
92-
93-
`--apply` verifies the workflow files on `main`, the selected commit's checks,
94-
their App IDs, and their successful owning workflow runs before writing. It
95-
re-reads all affected rulesets and refuses changes made since discovery.
96-
GitHub does not provide an atomic transaction across ruleset updates: if a
97-
write fails partway through, inspect the emitted preview and actual rulesets
98-
before retrying. Do not remove the service while any old required check remains.
99-
100-
## Validate the helper
101-
102-
```sh
103-
pixi exec --spec python --spec pytest python -m pytest \
104-
--noconftest ci/tools/tests/test_migrate_precommit_checks.py
105-
```
106-
107-
The tests mock GitHub; they cannot change repository settings.

‎ci/tools/migrate_precommit_checks.py‎

Lines changed: 0 additions & 230 deletions
This file was deleted.

0 commit comments

Comments
 (0)