Skip to content

fix(ci): install renovate-check's Renovate from a lockfile with npm ci - #5

Merged
magicdrive merged 1 commit into
mainfrom
fix/renovate-check-lockfile
Oct 27, 2026
Merged

magicdrive merged 1 commit into
mainfrom
fix/renovate-check-lockfile

Conversation

@magicdrive

Copy link
Copy Markdown
Owner

Problem

make renovate-check (CI: validate renovate.json) installed Renovate with npx --yes --package renovate@$(RENOVATE_VERSION). The same command failed on magicdrive/ark main in run 40393137410:

2026-10-26T20:10:16Z npm error 404 Not Found - GET https://registry.npmjs.org/bowser/-/bowser-2.15.0.tgz - Not found

bowser 2.15.0 was published at 20:06:27Z, 3m49s earlier. This repository runs the identical command, so it is exposed to the same failure. Node.js: node-version: lts/* (floating; it changes major when a new LTS line starts); Renovate 44.x requires ^24.11.0.

Root Cause

Classification: Dependency Instability. npx --package renovate@X pins Renovate only; its ~600 transitive dependencies are resolved from semver ranges on every run (@aws-sdk/core asks for bowser ^2.11.0), so each run installs whatever was published last, including releases minutes old whose tarballs the registry does not serve yet. With --before two times apart, the same command installs bowser 2.14.1 vs 2.15.0.

CI is not meant to validate with the newest Renovate (the version was pinned in the Makefile and moved by Renovate); this keeps that design and pins the whole tree.

Solution

Same change as magicdrive/ark#88:

  • .github/renovate-check/package.json + package-lock.json pin renovate 44.149.0 and every transitive package (registry.npmjs.org URL and sha512 integrity each).
  • .github/renovate-check/run.sh installs them in a temp dir with npm ci --ignore-scripts --engine-strict, checks the installed version, and runs renovate-config-validator --strict renovate.json.
  • .github/renovate-check/.node-version (24.22.1) is the Node.js CI sets up (node-version-file), with the npm cache keyed on the lockfile.
  • renovate.json: the directory is one group ("Renovate validator": npm manager + nodenv), lockFileMaintenance refreshes the lockfile weekly; RENOVATE_VERSION leaves the Makefile; run.sh joins make lint's shellcheck sources.
  • No retry: nothing published after the lock is fetched; a 404 still fails (tested).

Security Impact

Positive: every package is integrity-checked against the committed lockfile and no install scripts run. re2 (optional native module) is not built; the npx install did not have it either (RE2 not usable warning in both).

Compatibility

make renovate-check keeps its name and output; locally it needs Node.js satisfying Renovate's engines (24.11+), older fails with EBADENGINE.

Tests

make renovate-check-test (.github/renovate-check/test_run.py, run in CI) against a fake registry on 127.0.0.1: the lockfile decides the version (a newer publish is not taken); a version not in the lockfile is not installed (EUSAGE, tarball never requested); a 404 fails npm ci and run.sh (E404, no "Config validated"); an integrity mismatch fails (EINTEGRITY); .node-version satisfies every locked package's engines.node.

Local (macOS, Node.js 24.22.1): make renovate-check -> "Config validated successfully"; make renovate-check-test 8/8 OK; shellcheck and make actionlint pass.

CI

The job running make renovate-check now sets up Node.js from .node-version and runs the test step first.

Migration

None.

Risks

lockFileMaintenance PRs pull fresh transitive versions; a propagation 404 can still hit that PR's CI, not main.

https://claude.ai/code/session_01RbGbwRHvCEhsKLZfbvbbRg

make renovate-check ran `npx --package renovate@<version>`, which pins
Renovate but resolves its ~600 transitive dependencies at run time, so
every run installs whatever the registry published last. On 2026-10-26
the same command failed in magicdrive/ark (CI run 40393137410) with
E404 for bowser 2.15.0, fetched under four minutes after it was
published, before the registry served its tarball. Renovate 44.x also
requires Node.js ^24.11.0, which this job did not pin.

Renovate 44.149.0 and its whole dependency tree are now pinned by
.github/renovate-check/package.json and package-lock.json (sha512
integrity for every package) and installed by run.sh with
`npm ci --ignore-scripts --engine-strict`. CI sets up the Node.js of
.github/renovate-check/.node-version (24.22.1) and caches npm tarballs
keyed on the lockfile. Renovate updates the directory as one group (npm
and nodenv managers) and refreshes the lockfile weekly
(lockFileMaintenance); RENOVATE_VERSION leaves the Makefile.

test_run.py (make renovate-check-test, run in CI) points npm at a fake
registry and checks that the lockfile decides the version, that a
version not in it is not installed, that a 404 or an integrity mismatch
fails npm ci and run.sh, and that .node-version satisfies the engines of
every locked package. Same change as magicdrive/ark#88.

Claude-Session: https://claude.ai/code/session_01RbGbwRHvCEhsKLZfbvbbRg
@magicdrive
magicdrive merged commit aa93b21 into main Oct 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant