Skip to content

chore(renovate): stop offering npm-pin updates and guard the pin - #1278

Merged
Danathar merged 2 commits into
mainfrom
renovate-npm-pin-guard
Nov 20, 2026
Merged

Danathar merged 2 commits into
mainfrom
renovate-npm-pin-guard

Conversation

@Danathar

@Danathar Danathar commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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 for constraints.npm (matchManagers: ["renovate-config"], matchDepTypes: ["tool-constraint"], renovatebot/renovate lib/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 as prebuild, so inside the required dashboard-build check: 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 when CI is set.
  • docs/skills/ci-ops/dashboard-metrics/SKILL.md: new point 12 explains the pin and the check, so an agent fixing a red dashboard-build raises the pin instead of editing the check.
  • Checked locally: CI with npm 11.20.0 passes; CI with npm 12.2.2 fails with "Set constraints.npm to "^12.2.2" in this pull request"; without CI it exits 0.
  • Why npm 12 arrives with Node: CI's npm is the one bundled with Node (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

Danathar and others added 2 commits November 19, 2026 21:42
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>
@Danathar
Danathar added this pull request to the merge queue Nov 20, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

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 2cc9e73afbf7 matched:

  • sensitive_path: changes 1 sensitive path(s) (dashboard/package.json)

No sentinel-alert label was added. The finding is recorded in the dashboard Security tab and /api/sentinel; set sentinel.trusted_authors_block: true to block trusted authors too.

@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 20, 2026
Merged via the queue into main with commit 8c79b4b Nov 20, 2026
12 checks passed

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/renovate lib/modules/manager/renovate-config/extract.ts pushes each constraints key with depType: 'tool-constraint'. No later rule re-enables it: the majors rule (renovate.json:67-72) does not set enabled.
  • dashboard-build runs npm run build (.github/workflows/dashboard-build.yml:50-53), so prebuild runs. The job log at this head shows renovate.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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant