Skip to content

ci(#9226): pin uvx and npx tool versions in hooks and Makefile - #9229

Merged
waynesun09 merged 4 commits into
mainfrom
agent/9226-pin-uvx-npx-tools
Nov 9, 2026
Merged

waynesun09 merged 4 commits into
mainfrom
agent/9226-pin-uvx-npx-tools

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pins the tools that .pre-commit-config.yaml and the Makefile fetch with uvx/npx, and configures Renovate to bump those pins and the remote hook rev: pins. The unpinned uvx ty check hook picked up ty 0.0.100 as soon as it shipped. That release renamed unresolved-attribute and added missing-union-attribute, so make lint-all failed on every PR with 190 diagnostics.

Related Issue

#9226 (follows the same failure mode as #9133)

Changes

.pre-commit-config.yaml / Makefile (commit 1)

  • ty hook: 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-staged hook: npx lint-staged@16.4.0 --allow-empty (the version in package-lock.json).
  • Makefile check/fmt: uvx ruff@0.15.7 (matches the ruff-pre-commit rev: v0.15.7) and uvx ty@0.0.99.
  • New check-tool-fetch-pins hook (language: pygrep) on .pre-commit-config.yaml and the Makefile.

renovate.json (commit 2)

Review follow-ups (commit 3)

  • The pin check flags every uvx/npx call not written as <pkg>@<version>: no version, @latest, @^16, ==, and flags before the package. hack/tool_fetch_pins_test.py tests both directions and checks that Renovate extracts a version from every call in the two files. It runs in make script-test.
  • ruff (pypi, Makefile) and astral-sh/ruff-pre-commit (hook rev:) are grouped into one PR.
  • Pre-commit hook rev: bumps are not automerged: the hooks are linters and scanners, and a patch release can add or rename checks.
  • pep440 and npm versioning on the two regex managers.

No files under .github/workflows/ are changed.

What Renovate covers after this PR

Pin Manager Next update found by the dry run Automerge
uvx ty@0.0.99 (hook + Makefile) regex, pypi 0.0.100, one renovate/ty-0.x PR no
uvx ruff@0.15.7 (Makefile) + ruff-pre-commit v0.15.7 regex pypi + pre-commit 0.17.4, one renovate/ruff PR no
npx lint-staged@16.4.0 + package.json ^16.4.0 regex npm + npm 17.6.0 / ^17.0.0, one renovate/major-lint-staged PR no
gitleaks, actionlint rev: pre-commit v8.30.1, v1.7.12 no
pre-commit-hooks, gitlint, bandit, shellcheck-py rev: pre-commit up to date no

Still floating, out of scope here: uv pip install --system pre-commit jsonschema pytest gitlint-core and uvx --from gitlint-core gitlint / uvx pre-commit in .github/workflows/lint.yml and pr-title-lint.yml; uvx --from gitlint-core gitlint in hack/ci-local/ci-local; make bootstrap (uv tool install ruff/ty, go install ...@latest).

Testing

All run on head 390628289 (renovate runs on 3f37156f5, whose renovate.json is identical).

  • Hooks on the changed files, SKIP=check-gateway-doc-configs pre-commit run: every hook Passed (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 reports Found 190 diagnostics.
  • python3 -m pytest hack/tool_fetch_pins_test.py -q: 16 passed. Removing the pin from uvx ruff@0.15.7 format in the Makefile makes test_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, managers pre-commit, custom.regex, npm): the table above is its output; branches renovate/ty-0.x, renovate/ruff, renovate/major-lint-staged, renovate/zricethezav-gitleaks-8.x, renovate/rhysd-actionlint-1.x.

Closes #9226

Post-script verification

  • Branch is not main/master (agent/9226-pin-uvx-npx-tools)
  • Secret scan passed (gitleaks — 96e0c43384dfbd1d57b80711ff75a3b74b753156..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

fullsend-ai-coder Bot and others added 2 commits November 9, 2026 20:42
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>
@waynesun09

Copy link
Copy Markdown
Member

/fs-fix-stop

@github-actions github-actions Bot added the fullsend-no-fix Skip bot-triggered fix agent runs label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Fix agent disabled for this PR. Remove the fullsend-no-fix label or use /fs-fix to re-engage.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 8:46 PM UTC · Completed 8:54 PM UTC

Commit: 65191a0 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.15

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 9, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Moderate 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

Risk Assessment: moderate (2/5)

Details

Moderate 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)

Details

Moderate 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.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] .pre-commit-config.yaml — This PR modifies a protected governance/infrastructure file (.pre-commit-config.yaml: pins the ty and lint-staged hook entries and adds the check-tool-fetch-pins pygrep hook). The PR links 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 and explains the rationale, so context is sufficient, but human approval is always required for protected-path changes regardless of context.
    Remediation: A human maintainer must review and approve the .pre-commit-config.yaml changes.
Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6Ii5wcmUtY29tbWl0LWNvbmZpZy55YW1sIiwiaWQiOiJmX2EwOGU4YzJhMTUzNWU0ZjMiLCJsaW5lIjoyMTQsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiZmFpbC1vcGVuIiwiZmlsZSI6Ii5wcmUtY29tbWl0LWNvbmZpZy55YW1sIiwiaWQiOiJmXzkxZmMwNjM2MmJiMzA3NTQiLCJsaW5lIjoyMTQsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6InNlY3VyaXR5In0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiZWRnZS1jYXNlIiwiZmlsZSI6Ii5wcmUtY29tbWl0LWNvbmZpZy55YW1sIiwiaWQiOiJmXzZhN2U5YjY2MmFmMGM2YzgiLCJsaW5lIjoyMTQsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn1dfQ== -->

Review

Findings

Medium

  • [logic-error] .pre-commit-config.yaml:214 — The check-tool-fetch-pins regex only requires @ followed by one digit, so floating specs such as npx lint-staged@16, npx lint-staged@16.x and uvx ty@0.0.* pass the guard (npx lint-staged@16 is not flagged). These resolve newly published releases without a reviewed pin change, which is the failure mode the hook is meant to prevent (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). The tests cover @latest and @^16 but have no numeric-range or wildcard cases. See also: [fail-open] finding at this location.
    Remediation: Require a complete exact-version token, for example \b(uvx|npx)\s+(?=\S)(?!(@[\w.-]+/)?[\w.-]+@\d+\.\d+\.\d+(?![\w.*])). Keep hack/tool_fetch_pins_test.py in step and add rejection cases for @16, @16.x and @0.0.*.
  • [fail-open] .pre-commit-config.yaml:214 — Supply-chain view of the same gap: the guard accepts any digit-prefixed version, so range specs such as npx lint-staged@16 or @16.x bypass it. The new test does not catch this either, because test_checked_files_are_clean_and_tracked only checks that a Renovate regex matches, and the currentValue capture accepts any non-space token. See also: [logic-error] finding at this location.
    Remediation: Validate the whole version token as an exact version with a token boundary, and add negative tests for npx lint-staged@16, npx lint-staged@16.x and uvx ty@0.0.*.
  • [protected-path] .pre-commit-config.yaml — This PR modifies a protected governance/infrastructure file (pins the ty and lint-staged hooks and adds the check-tool-fetch-pins pygrep hook). The PR links 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 and explains the rationale, so context is sufficient, but human approval is always required for protected-path changes regardless of context.
    Remediation: A human maintainer should review and approve the .pre-commit-config.yaml changes.

Low

  • [edge-case] .pre-commit-config.yaml:214 — The greedy \s+ can backtrack so the negative lookahead is tested at a whitespace character, which makes a correctly pinned command fail the guard. Example: uvx ty@0.0.99 check (two spaces) is flagged. Spacing changes can therefore break the hook even though the exact pin is present. No such line exists in the checked files today.
    Remediation: Add (?=\S) after \s+ so the lookahead cannot start inside the separator whitespace, and add passing cases for multiple spaces and mixed tabs/spaces to the test.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOltdfQ== -->

Review

Findings

Medium

  • [protected-path] .pre-commit-config.yaml — This PR modifies a protected governance/infrastructure file (.pre-commit-config.yaml: pins the ty and lint-staged hooks and adds the check-tool-fetch-pins pygrep hook). The PR links 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 and explains the rationale, so context is sufficient, but human approval is always required for protected-path changes regardless of context.
    Remediation: A human maintainer should review and approve the .pre-commit-config.yaml changes.

Labels: PR changes pre-commit hooks, Makefile lint targets and Renovate config, which are CI tooling.

@fullsend-ai-review fullsend-ai-review Bot added the component/ci CI pipelines and checks label Nov 9, 2026
@ralphbean
ralphbean enabled auto-merge November 9, 2026 20:54
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ⚠️ Cancelled · Started 9:02 PM UTC · Completed 9:09 PM UTC

Commit: 3f37156 · View workflow run →

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>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:11 PM UTC · Completed 9:20 PM UTC

Commit: 3906282 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.74

fullsend-ai-review[bot]

This comment was marked as outdated.

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>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:43 PM UTC · Completed 9:50 PM UTC

Commit: 117e0a8 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.91

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review November 9, 2026 21:49

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Nov 9, 2026
@waynesun09
waynesun09 added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit c45aab9 Nov 9, 2026
64 checks passed
@waynesun09
waynesun09 deleted the agent/9226-pin-uvx-npx-tools branch November 9, 2026 22:51

This branch was previously deployed

1 inactive deployment
dev — 117e0a8c Deployed Nov 9, 2026 by waynesun09 via behaviour #19406
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ci CI pipelines and checks fullsend-no-fix Skip bot-triggered fix agent runs ready-for-review Triggers review agent dispatch requires-manual-review Review requires human judgment risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants