fix(docker): copy pnpm-workspace.yaml so overrides match the lockfile - #383
Conversation
The docker job has failed on every push to main since 2026-06-22 with: ERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile 989d893 moved pnpm.overrides out of package.json and into pnpm-workspace.yaml, but the Dockerfile only ever copied package.json and pnpm-lock.yaml into the image. pnpm therefore resolved zero overrides while pnpm-lock.yaml still recorded `overrides: vite: 8.0.8`, and --frozen-lockfile refuses to proceed on that disagreement. CI's build-and-test job runs the same pnpm 10 and the same --frozen-lockfile, but passes because actions/checkout gives it the whole repo — pnpm-workspace.yaml included. Only the docker build, with its narrower COPY context, was missing the file. That is why the failure looked like a pnpm-version problem and is not one. Copy pnpm-workspace.yaml in both the builder and runner stages. Note the override being restored is the K-1 HIGH CVE pin from 192d1b5 (vite 8.0.8, closing GHSA-v2wj-q39q-566r, GHSA-p9ff-h696-f583, GHSA-4w7w-66w2-5vf9). Regenerating the lockfile to match an empty override set would have silently dropped that pin, so the fix is to give pnpm the overrides file rather than to relax the lockfile. Verified by replicating each stage's exact COPY context against pnpm 10.33.0: without pnpm-workspace.yaml both stages fail with the CI error; with it, `--frozen-lockfile` and `--frozen-lockfile --prod` both exit 0 and `pnpm why vite` resolves to 8.0.8. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes the
dockerjob, which has failed on every push to main since 2026-06-22 (~4 weeks).Symptom
Root cause
989d893movedpnpm.overridesout ofpackage.jsonand intopnpm-workspace.yaml. The Dockerfile only ever copiedpackage.jsonandpnpm-lock.yaml, so inside the image pnpm resolved zero overrides whilepnpm-lock.yamlstill recordedoverrides: vite: 8.0.8.--frozen-lockfilerefuses to proceed on that disagreement.The tell that makes this easy to misdiagnose: CI's
build-and-testjob runs the same pnpm 10 and the same--frozen-lockfile, and passes. It passes only becauseactions/checkoutgives it the entire repo,pnpm-workspace.yamlincluded. Just the docker build, with its narrowerCOPYcontext, was missing the file. So this is not a pnpm-version problem, despite the10.34.5 → 11.14.0upgrade notice in the failing log.Fix
Copy
pnpm-workspace.yamlin both the builder and runner stages.Why not just regenerate the lockfile
The obvious-looking fix —
pnpm install --no-frozen-lockfileto make the lockfile agree with an empty override set — would have silently dropped a security pin. That override is theK-1HIGH CVE mitigation from192d1b5: vite pinned to 8.0.8, closing GHSA-v2wj-q39q-566r, GHSA-p9ff-h696-f583, and GHSA-4w7w-66w2-5vf9. The correct direction is to give pnpm the overrides file, not to relax the lockfile.Verification
Docker daemon isn't available in this environment, so I replicated each stage's exact COPY context into a scratch directory against pnpm 10.33.0 (same major as both CI and the image):
package.json+pnpm-lock.yaml(current)pnpm install --frozen-lockfilepnpm-workspace.yaml(this PR)pnpm install --frozen-lockfilepnpm-workspace.yaml(this PR)pnpm install --frozen-lockfile --prodpnpm why vitein the fixed builder context resolves tovite@8.0.8, confirming the K-1 pin is actually applied rather than merely unblocked.Also confirmed there is no
.dockerignorethat would exclude the file, and thatpnpm-workspace.yamlis git-tracked and therefore present in the build context.Reviewer note
PR #371 adds a second override (
ws→ 8.21.0). Whichever of these two lands second should confirm the new override is declared inpnpm-workspace.yaml(notpackage.json) and is reflected inpnpm-lock.yaml, or the same mismatch returns.🤖 Generated with Claude Code