Repository navigation
chore(renovate): stop offering npm-pin updates and guard the pin - #1278
Conversation
constraints.npm (#1255) keeps Renovate's lock-file runs on the npm version CI uses (Node 26 bundles npm 11). Renovate treats the pin as an updatable dependency (renovate-config manager, depType tool-constraint) and offered npm 12 (#1257, closed); every future major would come back. - renovate.json: stop those offers, and put a reminder in every Node major PR to raise the pin in the same PR. - dashboard: a prebuild check, run by the required dashboard-build job, fails when CI's npm major differs from the pin, with the exact value to set. It only enforces under CI, so local builds aren't blocked. Checked locally: npm 11.20.0 passes, npm 12.2.2 fails with "Set constraints.npm to "^12.2.2" in this pull request", no CI skips. Same change as projectbluefin/documentation#1729. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qptoi6WwWFaNJymyz Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Agents reading the dashboard skill when dashboard-build goes red at prebuild need to know the fix is to raise constraints.npm in the same PR, not to edit or skip the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qptoi6WwWFaNJymyz Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. ℹ️ Sentinel: informational, author is trusted (owner), merge is not blocked. Head
No |
There was a problem hiding this comment.
Summary: This change stops the update bot from proposing npm upgrades that the dashboard build can't use, and adds a check that fails the dashboard build when the bot's npm setting and the build's npm drift apart. It does what it says, and the check passed on this PR's own build. One suggestion: the same check also runs in the job that publishes the live dashboard, where a failure has no pull request to fix it in.
correctness
One low-severity note, with a line comment on dashboard/scripts/check-npm-pin.mjs:12. It is advisory and does not block.
Verified at head 2cc9e73:
- The Renovate rule matches what Renovate actually emits.
renovatebot/renovatelib/modules/manager/renovate-config/extract.tspushes eachconstraintskey withdepType: 'tool-constraint'. No later rule re-enables it: the majors rule (renovate.json:67-72) does not setenabled. dashboard-buildrunsnpm run build(.github/workflows/dashboard-build.yml:50-53), soprebuildruns. The job log at this head showsrenovate.json constraints.npm "^11.20.0" matches npm 11.20.0.
No findings from: security, intent-alignment, style, docs-currency.
Confidence: 5/5 (safe)
-- hive: agent=reviewer-2 backend=claude model=claude-opus-5-5 effort=medium claude=2.1.327
| const running = (process.env.npm_config_user_agent ?? "").match( | ||
| /\bnpm\/(\d+)\.\d+\.\d+/, | ||
| ); | ||
| if (!process.env.CI || !running) process.exit(0); |
There was a problem hiding this comment.
correctness (low, advisory): CI is also set in publish-to-pages.yml, which runs npm run build (.github/workflows/publish-to-pages.yml:127-130) every 2 hours on main. Both workflows float on node-version: '26' (publish-to-pages.yml:118, dashboard-build.yml:41). A Node minor can bring a new npm major without any Renovate PR; Node 18.19 moved npm 9 to 10. If that happens, the scheduled publish stops deploying the dashboard, and there is no PR where the pin could be raised. Today a lock written by npm 11 would still install under npm 12, so the only cost is a stale pin. Suggest enforcing only on PR and merge-queue builds, where a person can fix it:
| if (!process.env.CI || !running) process.exit(0); | |
| const enforced = ["pull_request", "merge_group"].includes(process.env.GITHUB_EVENT_NAME ?? ""); | |
| if (!process.env.CI || !enforced || !running) process.exit(0); |
If you take this, also update SKILL.md point 12 ("it only enforces when CI is set").
Summary: The update bot keeps a setting that makes it use the same npm version as the dashboard's build. It also treats that setting as something to upgrade, so every new major npm release brings a pull request that someone has to close (#1257 was the first). This stops those offers, and adds a check that fails the dashboard build if the setting and the build's npm ever disagree, so it can't be forgotten when the dashboard moves to a newer Node.
renovate.json: no more offers forconstraints.npm(matchManagers: ["renovate-config"],matchDepTypes: ["tool-constraint"], renovatebot/renovatelib/modules/manager/renovate-config/extract.ts:93). Every Node major PR gets a "Before merging" note to raise the pin in that PR. Both rules sit before the majors rule, which stays last.dashboard/scripts/check-npm-pin.mjs, run asprebuild, so inside the requireddashboard-buildcheck: it compares the npm running the build (npm_config_user_agent) with the pin's major and fails with the exact value to set. It only enforces whenCIis set.docs/skills/ci-ops/dashboard-metrics/SKILL.md: new point 12 explains the pin and the check, so an agent fixing a reddashboard-buildraises the pin instead of editing the check.CIit exits 0.node-version: '26'→ npm 11). A Node major PR from Renovate brings the newer npm. It already waits for a person (needs-owner-merge), and now it fails until the pin is raised.Same change as projectbluefin/documentation#1729.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WcWm7qptoi6WwWFaNJymyz