Repository navigation
Conversation
pnpm 10 serializes each `patchedDependencies` entry as a `{hash, path}`
mapping, while pnpm 11 and later write the bare patch-file hash. The
`Lockfile::patched_dependencies` field typed the values as plain strings,
so a lockfile committed by pnpm 10 failed to parse and every install --
frozen and non-frozen alike -- aborted with ERR_PNPM_BROKEN_LOCKFILE
before it could regenerate anything.
Deserialize the field through an untagged entry that accepts both shapes
and collapses the mapping to its hash, mirroring
`migratePatchedDependencies` in the TypeScript CLI. The path is redundant
-- patch paths come from the project's `patchedDependencies` config -- and
the writer already emits the bare hash, so such a lockfile installs
unchanged and normalizes the next time it is written.
Closes #13307
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe lockfile loader accepts pnpm 10 ChangesPatched dependencies compatibility
Estimated code review effort: 3 (Moderate) | ~20 minutes Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
PR Summary by QodoFix lockfile parsing for pnpm 10 patchedDependencies entries
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/read-pnpm-10-patched-dependencies.md:
- Line 5: Revise the changeset entry to describe only the fixed pnpm lockfile
install compatibility for patched dependencies, removing the `{hash, path}`
format, bare hash, normalization, and issue-reference implementation details.
Keep the release note concise and focused on user-visible behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b2f3f484-e33c-4af8-90c3-331a0825288e
📒 Files selected for processing (4)
.changeset/read-pnpm-10-patched-dependencies.mdpnpm/crates/cli/tests/patch.rspnpm/crates/lockfile/src/lib.rspnpm/crates/lockfile/src/load_lockfile/tests.rs
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Confidence Score: 4/5The compatibility fix appears safe to merge, with only the previously reported redundant test documentation still outstanding. The new deserializer accepts both lockfile representations and normalizes them to the existing in-memory shape; the remaining concern is limited to maintainability of the regression test's redundant rustdoc. Files Needing Attention: pnpm/crates/cli/tests/patch.rs Reviews (2): Last reviewed commit: "docs: address review feedback on the pnp..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13330 +/- ##
==========================================
- Coverage 87.05% 87.05% -0.01%
==========================================
Files 532 532
Lines 91601 91616 +15
==========================================
+ Hits 79741 79753 +12
- Misses 11860 11863 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Drop the historical framing and the restatement of the test body from the regression test's doc comment, and trim the changeset to the user-visible effect.
|
Review feedback addressed in
Qodo — changeset missing a Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit add5c32 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
pnpm 10 serializes each `patchedDependencies` entry as a `{hash, path}`
mapping, while pnpm 11 and later write the bare patch-file hash. The
`Lockfile::patched_dependencies` field typed the values as plain strings,
so a lockfile committed by pnpm 10 failed to parse and every install --
frozen and non-frozen alike -- aborted with ERR_PNPM_BROKEN_LOCKFILE
before it could regenerate anything.
Deserialize the field through an untagged entry that accepts both shapes
and collapses the mapping to its hash, mirroring
`migratePatchedDependencies` in the TypeScript CLI. The path is redundant
-- patch paths come from the project's `patchedDependencies` config -- and
the writer already emits the bare hash, so such a lockfile installs
unchanged and normalizes the next time it is written.
Closes pnpm#13307
Summary
pnpm 10 serializes each
patchedDependenciesentry inpnpm-lock.yamlas a{hash, path}mapping, while pnpm 11 and later write the bare patch-file hash. pacquet typedLockfile::patched_dependenciesasBTreeMap<String, String>, so a lockfile committed by pnpm 10 failed to parse and every install — frozen and non-frozen alike — aborted withERR_PNPM_BROKEN_LOCKFILEbefore it could regenerate anything. This is a hard upgrade blocker for any repository that patches a dependency and still has a pnpm-10-written lockfile committed (it blocks a cold frozen install of vercel/next.js).The field now deserializes through an untagged entry accepting both shapes and collapsing the mapping to its hash, mirroring
migratePatchedDependenciesinlockfile/fs/src/lockfileFormatConverters.ts. The writer is unchanged, so such a lockfile installs as-is and normalizes to the bare-hash shape the next time it is written.TypeScript CLI: no change needed — it already migrates the old shape at load time.
Closes #13307
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(Rust-only: the TypeScript CLI already handles both shapes.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit