Repository navigation
fix(pacquet): preserve libc metadata shape - #13436
Conversation
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe lockfile pipeline now preserves whether Changeslibc shape preservation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Manifest
participant LockfileGenerator
participant PackageMetadata
participant Lockfile
Manifest->>LockfileGenerator: Read libc as string or array
LockfileGenerator->>PackageMetadata: Store StringOrList
PackageMetadata->>Lockfile: Serialize matching libc shape
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 pacquet lockfile to preserve libc string vs array shape
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "test(pacquet): log generated lockfile fi..." | Re-trigger Greptile |
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 `@pnpm/crates/lockfile/src/package_metadata/tests.rs`:
- Around line 47-52: Extend the regression coverage beyond
libc_shape_is_preserved and PackageMetadata serialization by adding an
end-to-end fixture test through manifest extraction and lockfile writing.
Include both scalar and singleton-array libc manifests, then compare the
complete generated lockfile bytes with the TypeScript-produced expected artifact
to verify identical output shape and serialization.
🪄 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: c129c7ba-d08f-4d22-a90b-d616fa982c05
📒 Files selected for processing (9)
.changeset/quiet-wolves-remember.mdpnpm/crates/env-installer/src/install_config_deps.rspnpm/crates/env-installer/src/manifest_lockfile.rspnpm/crates/lockfile/src/package_metadata.rspnpm/crates/lockfile/src/package_metadata/tests.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rspnpm/crates/package-manager/src/hoisted_dep_graph.rspnpm/crates/package-manager/src/installability.rs
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Debug eprintln! in test
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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 `@pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs`:
- Around line 311-350: Log the rendered lockfile YAML immediately before the
multiline assert_eq! in the test, using the value produced by
lockfile.to_yaml_string(). Preserve the existing expected-string comparison and
serialization error handling while ensuring CI output includes the actual
generated YAML.
🪄 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: 73686f8a-9d02-4cdb-9c53-891a20a15c76
📒 Files selected for processing (1)
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs
|
Code review by qodo was updated up to the latest commit 570dce2 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
|
Code review by qodo was updated up to the latest commit f41b111 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13436 +/- ##
==========================================
- Coverage 87.64% 87.64% -0.01%
==========================================
Files 545 545
Lines 93897 93894 -3
==========================================
- Hits 82292 82289 -3
Misses 11605 11605 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The install loaded only the global and project pnpmfiles, so a config dependency plugin's pnpmfile contributed its updateConfig hook and nothing else. Its readPackage, afterAllResolved and custom resolvers never ran, and pnpmfileChecksum left it out. pnpm 11 puts plugin pnpmfiles in the same requireHooks set as the project's. PnpmfileSelection now carries the config dependencies, and find_pnpmfiles returns the global pnpmfile, then the installed plugin pnpmfiles, then the project's own, which is pnpm 11's order. Every consumer of the selection now sees the same set: install, update, deploy, the lockfile freshness checks, the optimistic repeat-install state, and the updateConfig/beforePacking pass. The updateConfig pass used to run plugins ahead of the global pnpmfile and now runs them after it, as pnpm 11 does. The up-to-date fast path already bails out whenever config dependencies exist, so it is unaffected. The workspace state's pnpmfile list now includes plugin pnpmfiles, as pnpm 11's does. A state written before this change therefore triggers one re-validation. Closes pnpm/pnpm#12366. Its env-lockfile items were already fixed by #13382, #13346 and #13436. This was the last lockfile divergence found while verifying them. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Fixes #13435 by preserving whether package
libcmetadata was declared as a string or an array when pacquet writespnpm-lock.yaml.TypeScript pnpm already preserves this distinction. With this change, clean lockfile-only installs of
withastro/astroat112d3ea14cf997218239fd8a436707e56a3815fbproduce byte-identical TypeScript and Rust lockfiles with SHA-2562d5f4badfb12ef4ca3ea692ef9c8415298556a054b1c24585e617e91ad6416d8.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.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 (Codex, GPT-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
libcshape from the manifest (scalar vs list) when writinglibcintoPackageMetadata.libcvalues so the same representation is propagated through lockfile generation and installability checks.libcparsing/serialization assertions to match shape preservation.