Skip to content

ci(renovate): dedupe the pnpm lockfile after updates - #441

Merged
gitfromwildan merged 1 commit into
mainfrom
ci/renovate-pnpm-dedupe
Nov 4, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
ci/renovate-pnpm-dedupe

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Why

#438 (packages minor and patch) fails every CI job at pnpm install --frozen-lockfile:

specifiers in the lockfile don't match specifiers in package.json:
* in importers["packages/core"]:
  - @types/react (lockfile: ^19.3.0, manifest: 19.3.0)
  - react (lockfile: ^19.3.0, manifest: 19.3.1)

For lockfile-only updates Renovate runs:

pnpm install --lockfile-only --recursive --ignore-scripts --ignore-pnpmfile --no-frozen-lockfile
pnpm update --no-save <pkg>@<version> ... --lockfile-only --recursive --ignore-scripts --ignore-pnpmfile

With pnpm 12.3.4 that pnpm update --no-save call writes the raw package.json ranges back into the importers. It drops the specifiers that the pnpm-workspace.yaml overrides set (react, react-dom, @types/react, @types/react-dom, @sentry/bun), even for packages that are not being updated.

Changes

  • .github/renovate.json: postUpdateOptions: ["pnpmDedupe"]. Renovate runs pnpm dedupe after it updates the lockfile. Dedupe re-resolves with the overrides applied and also drops the duplicates the update leaves behind.
  • .prettierignore: add pnpm-lock.yaml. The lint-staged prettier --write hook re-quoted the lockfile (" instead of pnpm's ') on every commit that touched it. Each Renovate PR then rewrote the whole file back, so chore(deps): update packages minor and patch dependencies #438 shows +2659/−5143 lines when the real change is about a dozen.

Verification

Done locally from main with pnpm 12.3.4, replaying #438's override bump and Renovate's two commands:

  • After pnpm update --no-save: pnpm install --frozen-lockfile --lockfile-only fails with the same ERR_PNPM_OUTDATED_LOCKFILE as CI. This reproduces the bug.
  • After pnpm dedupe: the frozen install passes. The result matches a plain pnpm install --lockfile-only, minus the now-unused duplicates ([email protected], [email protected], [email protected], [email protected]).
  • renovate-config-validator --strict (renovate 44) passes.
  • prettier --check pnpm-lock.yaml now skips the file.

Self-hosted Renovate reads its config from main. After this merges, #438 needs a rebase via its checkbox (or the next run) so the branch is regenerated with dedupe.

For lockfile-only updates Renovate runs `pnpm update --no-save ...
--recursive`. That rewrites the importers' specifiers to the raw
package.json ranges and drops the ones pnpm-workspace.yaml overrides
(react, react-dom, @types/react, @sentry/bun), so `pnpm install
--frozen-lockfile` fails in CI (#438). `pnpm dedupe` re-resolves with the
overrides applied and also drops duplicates the update leaves behind.

Prettier no longer formats pnpm-lock.yaml. lint-staged re-quoted it on
every commit that touched it, so each Renovate PR rewrote the whole file
back to pnpm's own style.
@vercel

vercel Bot commented Nov 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Nov 4, 2026 2:29pm UTC

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Mode: standard. Both config changes look correct, and they target the two failure modes described for #438.

  • pnpmDedupe post-update option — Renovate now runs pnpm dedupe after updating the lockfile. Dedupe re-resolves the lockfile with the pnpm-workspace.yaml overrides applied, which fixes the override specifiers that pnpm update --no-save drops. Running pnpm dedupe --check against the current main lockfile shows only the duplicate collapses the description lists (es-toolkit, picomatch, tinyexec, plus yaml 2.9.0 → 2.9.1). It shows no unexpected re-resolutions.
  • pnpm-lock.yaml in .prettierignore — lint-staged runs prettier --write --ignore-unknown on every staged file, and Prettier 3 respects .prettierignore even for files passed to it by name. Human commits will no longer re-quote the lockfile, so Renovate PRs stop showing about 5k lines of quote churn.

Overall: ready to merge, with no findings that meet the admission rules. The committed lockfile on main is still in Prettier's double-quoted style. The first pnpm-native rewrite after this merges (most likely the rebased #438) will carry the requote diff once, and after that the churn stops.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan
gitfromwildan merged commit 5fd0fff into main Nov 4, 2026
16 checks passed
@gitfromwildan
gitfromwildan deleted the ci/renovate-pnpm-dedupe branch November 4, 2026 14:36
@gitfromwildan gitfromwildan mentioned this pull request Nov 5, 2026
12 tasks
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