Repository navigation
ci(#9226): pin uvx and npx tool versions in hooks and Makefile - #9229
Conversation
The ty hook ran an unpinned `uvx ty check`, so CI picked up ty 0.0.100 the moment it shipped. That release renamed unresolved-attribute to missing-attribute and added missing-union-attribute, failing lint-all with 190 diagnostics on every PR. - Pin the ty hook to ty@0.0.99, keeping the current --ignore list, which restores the last green behaviour. Moving to 0.0.100 changes the ignore policy and is left to a reviewed Renovate bump. - Pin the Makefile check/fmt targets to ty@0.0.99 and ruff@0.15.7 (the ruff-pre-commit rev). - Pin the lint-staged hook to lint-staged@16.4.0 (package-lock.json); the CI job runs no npm ci, so npx fetched the newest release. - Add a pygrep hook that fails on an uvx/npx call without @<version> in .pre-commit-config.yaml or the Makefile. Its own entry and name never put whitespace after uvx/npx, so it does not match itself. Verified: `uvx ty@0.0.99 check --ignore import-not-found --ignore unresolved-attribute` passes on main. pre-commit could not fetch remote hook repos in the sandbox (TLS error), so the pre-commit-hooks checks (check-yaml, end-of-file, whitespace, line endings, merge conflict, private key), lint-broken-symlinks and the new pygrep hook were run directly and passed. Related to #9226 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renovate could not see tool versions fetched by uvx/npx in local hook entries, and its opt-in pre-commit manager was disabled, so neither the new pins nor the remote hook rev: pins were ever bumped. - Add regex custom managers for .pre-commit-config.yaml and the Makefile: `uvx <pkg>@<version>` (pypi) and `npx <pkg>@<version>` (npm, scoped names allowed). - Enable the pre-commit manager. - Disable automerge for ty: 0.0.x releases rename and split rules (#9133, #9226), so a bump must re-check the hook's --ignore list. - Group lint-staged so the package.json range and the hook pin move in the same PR. Verified with `renovate-config-validator --strict` (passes; RE2 was unavailable so it fell back to JS RegExp). The new regexes extract (ty, 0.0.99), (ruff, 0.15.7) and (lint-staged, 16.4.0) from the files. Closes #9226 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/fs-fix-stop |
|
Fix agent disabled for this PR. Remove the |
|
🤖 Finished Review · ✅ Success · Started 8:46 PM UTC · Completed 8:54 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.15 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk CI and build configuration update across high-churn files, offset by bot authorship, exact alignment with linked issue scope, and added test coverage. Previous runRisk Assessment: moderate (2/5) DetailsModerate risk CI and build configuration update across high-churn files, offset by bot authorship, exact alignment with linked issue scope, and added test coverage. Previous run (2)Risk Assessment: moderate (2/5) DetailsModerate risk change updating CI and build configuration across frequently modified files, balanced by a small 50-line diff, automated bot authorship, and exact alignment with the linked issue. |
ReviewFindingsMedium
Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6Ii5wcmUtY29tbWl0LWNvbmZpZy55YW1sIiwiaWQiOiJmX2EwOGU4YzJhMTUzNWU0ZjMiLCJsaW5lIjoyMTQsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiZmFpbC1vcGVuIiwiZmlsZSI6Ii5wcmUtY29tbWl0LWNvbmZpZy55YW1sIiwiaWQiOiJmXzkxZmMwNjM2MmJiMzA3NTQiLCJsaW5lIjoyMTQsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6InNlY3VyaXR5In0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiZWRnZS1jYXNlIiwiZmlsZSI6Ii5wcmUtY29tbWl0LWNvbmZpZy55YW1sIiwiaWQiOiJmXzZhN2U5YjY2MmFmMGM2YzgiLCJsaW5lIjoyMTQsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn1dfQ== --> ReviewFindingsMedium
Low
Next steps:
Previous run (2)<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOltdfQ== --> ReviewFindingsMedium
Labels: PR changes pre-commit hooks, Makefile lint targets and Renovate config, which are CI tooling. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Review · Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.26 This review was superseded by a newer commit. Check the current pull request HEAD's review status before merging. |
Review follow-ups on the pin and Renovate changes: - The pin check now flags every uvx/npx call that is not written as <pkg>@<version>: @latest, @^16, ==, and flags before the package passed before. hack/tool_fetch_pins_test.py covers both directions and checks that Renovate extracts a version from every call in the two files; it runs in make script-test. - Group the ruff-pre-commit rev and the Makefile uvx ruff pin into one PR so make check/fmt and the hook stay on one ruff version. - Hold pre-commit hook rev bumps for review: they are linters and scanners, and a patch release can add or rename checks. - Use pep440 and npm versioning for the uvx and npx regex managers. Assisted-by: Claude (fix), Claude (review), DeepSeek (review) Signed-off-by: Wayne Sun <gsun@redhat.com>
3f37156 to
3906282
Compare
|
🤖 Finished Review · ✅ Success · Started 9:11 PM UTC · Completed 9:20 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.74 |
The pin check accepted any version that started with a digit, so ranges such as lint-staged@16, @16.x and ty@0.0.* passed while still floating. It now requires an exact X.Y.Z version ending at a token boundary, and (?=\S) stops the lookahead from starting inside the separator, so `uvx ty@0.0.99` (two spaces) is no longer flagged. The test gains cases for both. Assisted-by: Claude (fix), fullsend review agent (review) Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 9:43 PM UTC · Completed 9:50 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.91 |
Superseded by updated review
Summary
Pins the tools that
.pre-commit-config.yamland theMakefilefetch withuvx/npx, and configures Renovate to bump those pins and the remote hookrev:pins. The unpinneduvx ty checkhook picked up ty 0.0.100 as soon as it shipped. That release renamedunresolved-attributeand addedmissing-union-attribute, somake lint-allfailed on every PR with 190 diagnostics.Related Issue
#9226 (follows the same failure mode as #9133)
Changes
.pre-commit-config.yaml/Makefile(commit 1)tyhook:uvx ty@0.0.99 check --ignore import-not-found --ignore unresolved-attribute. This keeps the current ignore list and brings back the last green behaviour. Moving to 0.0.100 changes the ignore policy, so it's left for a reviewed Renovate PR.lint-stagedhook:npx lint-staged@16.4.0 --allow-empty(the version inpackage-lock.json).Makefilecheck/fmt:uvx ruff@0.15.7(matches theruff-pre-commitrev: v0.15.7) anduvx ty@0.0.99.check-tool-fetch-pinshook (language: pygrep) on.pre-commit-config.yamland theMakefile.renovate.json(commit 2)customManagersregex entries for.pre-commit-config.yamlandMakefile:uvx <pkg>@<version>→pypi, andnpx <pkg>@<version>→npm(scoped names allowed)."pre-commit": { "enabled": true }. The manager is opt-in in Renovate and was off, so the remote hookrev:pins never got bump PRs.packageRules:tyhasautomerge: false(0.0.x releases rename and split rules, CI lint fails with ty 0.0.98 because unresolved-import was renamed #9133, ci: pin ty in the pre-commit hook (ty 0.0.100 fails lint-all on every PR) and let Renovate bump uvx/npx pins #9226).lint-stagedis grouped so thepackage.jsonrange and the hook pin move in the same PR.Review follow-ups (commit 3)
uvx/npxcall not written as<pkg>@<version>: no version,@latest,@^16,==, and flags before the package.hack/tool_fetch_pins_test.pytests both directions and checks that Renovate extracts a version from every call in the two files. It runs inmake script-test.ruff(pypi, Makefile) andastral-sh/ruff-pre-commit(hookrev:) are grouped into one PR.rev:bumps are not automerged: the hooks are linters and scanners, and a patch release can add or rename checks.pep440andnpmversioning on the two regex managers.No files under
.github/workflows/are changed.What Renovate covers after this PR
uvx ty@0.0.99(hook + Makefile)renovate/ty-0.xPRuvx ruff@0.15.7(Makefile) +ruff-pre-commitv0.15.7renovate/ruffPRnpx lint-staged@16.4.0+package.json^16.4.0^17.0.0, onerenovate/major-lint-stagedPRrev:rev:Still floating, out of scope here:
uv pip install --system pre-commit jsonschema pytest gitlint-coreanduvx --from gitlint-core gitlint/uvx pre-commitin.github/workflows/lint.ymlandpr-title-lint.yml;uvx --from gitlint-core gitlintinhack/ci-local/ci-local;make bootstrap(uv tool install ruff/ty,go install ...@latest).Testing
All run on head
390628289(renovateruns on3f37156f5, whoserenovate.jsonis identical).SKIP=check-gateway-doc-configs pre-commit run: every hookPassed(ruff, ruff format, ty, bandit, semgrep, gitleaks, check-tool-fetch-pins, pre-commit-hooks).pre-commit run ty --all-files:Passed. With ty 0.0.100 and the old flags the same command reportsFound 190 diagnostics.python3 -m pytest hack/tool_fetch_pins_test.py -q:16 passed. Removing the pin fromuvx ruff@0.15.7 formatin the Makefile makestest_checked_files_are_clean_and_tracked[Makefile]fail.renovate-config-validator --strict renovate.json(renovate 44.181.7 container):Config validated successfully against 1 file(s).renovate --platform=local --dry-run=lookup(renovate 44.181.7, managerspre-commit,custom.regex,npm): the table above is its output; branchesrenovate/ty-0.x,renovate/ruff,renovate/major-lint-staged,renovate/zricethezav-gitleaks-8.x,renovate/rhysd-actionlint-1.x.Closes #9226
Post-script verification
agent/9226-pin-uvx-npx-tools)96e0c43384dfbd1d57b80711ff75a3b74b753156..HEAD)