Repository navigation
Conversation
#15427 made an unfiltered `pnpm install --frozen-lockfile` fail when a lockfile importer's directory or manifest was missing. That broke Docker builds that leave unneeded workspace projects out of the build context: the check cannot tell an excluded project from a deleted one. The check now fails only when the project directory exists but holds no manifest. A wholly absent directory is skipped again, as it was before 12.8.0 and 11.28.0, the same way a project dropped from the workspace patterns is. v12 reports the remaining case with a new ImporterWithoutManifest staleness reason, and RemovedImporter gets its original message back. Closes #16453. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (2)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughFrozen-lockfile validation now skips lockfile importers whose workspace directories are absent. It still reports an existing importer directory without a recognized manifest as stale. Rust and TypeScript checks and regression tests cover these cases. A changeset records patch releases for three packages. ChangesWorkspace importer freshness
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: Merge Risk: ⚪ Minimal · up to Frozen installs now skip workspace projects whose directories are absent, and directories without a package.json still fail. I found no concrete merge-blocking risk in the supplied changes. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Frozen installs will accept omitted workspace directories while continuing to validate present projects against the lockfile. No introduced security vulnerability was established. Evidence supports normal removal and restoration, but does not establish guarantees for concurrent filesystem changes or interrupted installation. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
pnpm11/pnpm/test/monorepo/index.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16462 +/- ##
=======================================
Coverage 92.17% 92.17%
=======================================
Files 1517 1517
Lines 204798 204812 +14
=======================================
+ Hits 188769 188788 +19
+ Misses 16029 16024 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4657608240999997,
"stddev": 0.12271324226984734,
"median": 2.4421947301999998,
"user": 1.5091634800000002,
"system": 1.5730230799999998,
"min": 2.2799379712,
"max": 2.6338591672
},
{
"command": "pacquet@main",
"mean": 2.4581801434,
"stddev": 0.1499589069838024,
"median": 2.3924032257,
"user": 1.48825888,
"system": 1.5465919799999999,
"min": 2.2962380311999997,
"max": 2.6712663972
},
{
"command": "pnpr@HEAD",
"mean": 1.4527816594,
"stddev": 0.10695160867117909,
"median": 1.4327197742000002,
"user": 1.50564358,
"system": 1.46770018,
"min": 1.3029372472000003,
"max": 1.6773341762000002
},
{
"command": "pnpr@main",
"mean": 1.4777341608999999,
"stddev": 0.142805686632461,
"median": 1.4436658547000003,
"user": 1.3596711799999999,
"system": 1.3959965799999998,
"min": 1.3008530022,
"max": 1.6934654572
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.29234477676000004,
"stddev": 0.047345745689227996,
"median": 0.27356095766,
"user": 0.3449054399999999,
"system": 0.69021256,
"min": 0.24858624166,
"max": 0.37556236266000004
},
{
"command": "pacquet@main",
"mean": 0.31764123016,
"stddev": 0.05326540060585464,
"median": 0.30242462466000003,
"user": 0.37830114,
"system": 0.7297335599999999,
"min": 0.25600563166,
"max": 0.41140982766000006
},
{
"command": "pnpr@HEAD",
"mean": 0.27720750696000007,
"stddev": 0.010071078752907683,
"median": 0.2747687521600001,
"user": 0.29728834,
"system": 0.6093729600000001,
"min": 0.26476983566000006,
"max": 0.29123602866000003
},
{
"command": "pnpr@main",
"mean": 0.25592104866000004,
"stddev": 0.013654294863435027,
"median": 0.25603386866000005,
"user": 0.27175333999999995,
"system": 0.58601516,
"min": 0.23821458566,
"max": 0.27565323866
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.02011982233827958,
"stddev": 0.005548893009462803,
"median": 0.020135993720000002,
"user": 0.009805363225806454,
"system": 0.012271408064516123,
"min": 0.01118423772,
"max": 0.03664754872
},
{
"command": "pacquet@main",
"mean": 0.01562978423851851,
"stddev": 0.0036081218531517287,
"median": 0.015118576720000002,
"user": 0.007988824197530862,
"system": 0.00920070802469135,
"min": 0.01036567872,
"max": 0.02727155672
},
{
"command": "pnpr@HEAD",
"mean": 0.013331813154146345,
"stddev": 0.002340021804106413,
"median": 0.012697894720000002,
"user": 0.007287962439024386,
"system": 0.007459879804878048,
"min": 0.009471270720000001,
"max": 0.01972420272
},
{
"command": "pnpr@main",
"mean": 0.013381027715412845,
"stddev": 0.0021820672327456103,
"median": 0.012965267720000001,
"user": 0.0072376046788990836,
"system": 0.007569453577981651,
"min": 0.00994727672,
"max": 0.01895629072
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.0118130971765812,
"stddev": 0.005122421230665289,
"median": 0.008536604980000001,
"user": 0.006764799999999996,
"system": 0.006028172478632478,
"min": 0.00736548998,
"max": 0.024316178980000002
},
{
"command": "pacquet@main",
"mean": 0.008358233632343753,
"stddev": 0.0005654909218694439,
"median": 0.00829562898,
"user": 0.00531697921875,
"system": 0.0038428196093749983,
"min": 0.00722329298,
"max": 0.01151388698
},
{
"command": "pnpr@HEAD",
"mean": 0.008579070501912353,
"stddev": 0.00067545921849674,
"median": 0.00850672998,
"user": 0.004715220079681276,
"system": 0.004693146693227091,
"min": 0.0072139959799999995,
"max": 0.01102608298
},
{
"command": "pnpr@main",
"mean": 0.008721057976296298,
"stddev": 0.0007914222814574902,
"median": 0.008577226980000002,
"user": 0.005418136000000002,
"system": 0.004158943333333332,
"min": 0.007366871979999999,
"max": 0.013142670980000002
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.88715039388,
"stddev": 0.05956201502028617,
"median": 2.90781622278,
"user": 2.9016212199999996,
"system": 2.2961473000000003,
"min": 2.76946739428,
"max": 2.97095572028
},
{
"command": "pacquet@main",
"mean": 2.8215527262799998,
"stddev": 0.080487908225711,
"median": 2.83908560278,
"user": 2.7704896199999993,
"system": 2.118689,
"min": 2.71738802828,
"max": 2.9351141002800003
},
{
"command": "pnpr@HEAD",
"mean": 1.60170389968,
"stddev": 0.10381098121225632,
"median": 1.5987480552800002,
"user": 1.5765846199999998,
"system": 1.5989678999999999,
"min": 1.4570729342800002,
"max": 1.78381687228
},
{
"command": "pnpr@main",
"mean": 1.57184403058,
"stddev": 0.098295968622173,
"median": 1.54066353278,
"user": 1.46877872,
"system": 1.5308168,
"min": 1.46596317728,
"max": 1.79178832028
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5453786978599999,
"stddev": 0.025887679085068904,
"median": 0.5454686345599999,
"user": 0.7355212999999999,
"system": 0.9144136199999998,
"min": 0.50836381956,
"max": 0.58211079156
},
{
"command": "pacquet@main",
"mean": 0.59241764506,
"stddev": 0.052746289947200715,
"median": 0.5925339350600001,
"user": 0.8146695999999999,
"system": 0.9459155199999998,
"min": 0.5228229465600001,
"max": 0.69845628756
},
{
"command": "pnpr@HEAD",
"mean": 0.40683598266,
"stddev": 0.03242343480722043,
"median": 0.39508730256,
"user": 0.38771980000000006,
"system": 0.8300343199999999,
"min": 0.36923435256000003,
"max": 0.46151103956000006
},
{
"command": "pnpr@main",
"mean": 0.4370027911600001,
"stddev": 0.0423702774072206,
"median": 0.43816044406,
"user": 0.417982,
"system": 0.8491716199999999,
"min": 0.36273632956,
"max": 0.51729509856
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6554200050000003,
"stddev": 0.07537066854348783,
"median": 1.6226337163000002,
"user": 1.00650914,
"system": 0.9622849600000001,
"min": 1.5769276553000002,
"max": 1.8004515183
},
{
"command": "pacquet@main",
"mean": 1.7025888063,
"stddev": 0.07445704301266168,
"median": 1.6896199798000002,
"user": 1.10559534,
"system": 1.0647156599999998,
"min": 1.6147401903,
"max": 1.8841264363
},
{
"command": "pnpr@HEAD",
"mean": 0.32517699120000004,
"stddev": 0.013228971918167902,
"median": 0.3261023983,
"user": 0.28973654,
"system": 0.6030800599999999,
"min": 0.3021829403,
"max": 0.3407959903
},
{
"command": "pnpr@main",
"mean": 0.34228478259999995,
"stddev": 0.016721020158195394,
"median": 0.3380933953,
"user": 0.30977694,
"system": 0.65687986,
"min": 0.3243126383,
"max": 0.3768364083
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2545985724,
"stddev": 0.01850178401790763,
"median": 0.25171904440000004,
"user": 0.23452435000000002,
"system": 0.08167035333333332,
"min": 0.22781872440000003,
"max": 0.3034873964
},
{
"command": "pacquet@main",
"mean": 0.3144882666727273,
"stddev": 0.0770514303226256,
"median": 0.3172249564,
"user": 0.30171787272727274,
"system": 0.12398906545454545,
"min": 0.2222910724,
"max": 0.4383950414
},
{
"command": "pnpr@HEAD",
"mean": 0.0929537194357143,
"stddev": 0.002271619989083015,
"median": 0.0928134609,
"user": 0.03779742142857142,
"system": 0.012253749999999997,
"min": 0.0895842134,
"max": 0.1001902204
},
{
"command": "pnpr@main",
"mean": 0.09365464004516127,
"stddev": 0.0022311109072495794,
"median": 0.0931651644,
"user": 0.037585793548387106,
"system": 0.012858083870967745,
"min": 0.0897840284,
"max": 0.0984230804
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2456815271355556,
"stddev": 0.012860803659192913,
"median": 0.25107382558,
"user": 0.24611137777777778,
"system": 0.06356463555555555,
"min": 0.22114616758000002,
"max": 0.25563059958000006
},
{
"command": "pacquet@main",
"mean": 0.2582967441355556,
"stddev": 0.012741985523443244,
"median": 0.25568653858000007,
"user": 0.2714236,
"system": 0.06322496888888889,
"min": 0.24387450158,
"max": 0.28520335758000004
},
{
"command": "pnpm@HEAD",
"mean": 4.210265238357778,
"stddev": 0.7527862343992907,
"median": 3.96451905058,
"user": 5.970979377777777,
"system": 0.5408456355555555,
"min": 3.71230544058,
"max": 6.185409589580001
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23131386215333335,
"stddev": 0.009295442157263155,
"median": 0.22763419632,
"user": 0.19443852999999997,
"system": 0.08266191333333332,
"min": 0.21896589382,
"max": 0.25600565082000004
},
{
"command": "pacquet@main",
"mean": 0.22244747048666666,
"stddev": 0.004873171505932368,
"median": 0.22148522082000002,
"user": 0.18924653,
"system": 0.07488307999999999,
"min": 0.21273614382000003,
"max": 0.23074103582000002
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.82096120614,
"stddev": 0.21105805536255554,
"median": 4.7804099864400005,
"user": 2.5928975,
"system": 2.37146502,
"min": 4.55968049144,
"max": 5.26376041644
},
{
"command": "pacquet@main",
"mean": 4.7663911172399995,
"stddev": 0.1502529559178002,
"median": 4.76223700094,
"user": 2.5637967,
"system": 2.32498382,
"min": 4.5412877624400005,
"max": 5.03033194144
},
{
"command": "pnpr@HEAD",
"mean": 3.69080747824,
"stddev": 0.1137380263708757,
"median": 3.6871923634400003,
"user": 2.1893081999999997,
"system": 1.9648485199999999,
"min": 3.52940538644,
"max": 3.8482470814400003
},
{
"command": "pnpr@main",
"mean": 3.71352037964,
"stddev": 0.11825643617658377,
"median": 3.70085015894,
"user": 2.2554262999999994,
"system": 2.01059362,
"min": 3.54796550644,
"max": 3.9536913244400003
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.14084863802,
"stddev": 0.005942111946314918,
"median": 0.14020391502000001,
"user": 0.1794981905263158,
"system": 0.14553682842105262,
"min": 0.13214280002,
"max": 0.15572650902000001
},
{
"command": "pacquet@main",
"mean": 0.14341239132,
"stddev": 0.006449588993387638,
"median": 0.14317036952,
"user": 0.17476243,
"system": 0.16017786,
"min": 0.12970281902,
"max": 0.15551561302
},
{
"command": "pnpr@HEAD",
"mean": 0.15899928382,
"stddev": 0.014250453926458587,
"median": 0.15531715002000002,
"user": 0.19014158000000003,
"system": 0.15335485999999998,
"min": 0.14016100302,
"max": 0.18679002102
},
{
"command": "pnpr@main",
"mean": 0.14914373202,
"stddev": 0.006684413151074353,
"median": 0.14718028902000002,
"user": 0.18273392444444445,
"system": 0.13702323777777778,
"min": 0.13838845502000002,
"max": 0.16430912502
}
]
} |
This comment has been minimized.
This comment has been minimized.
|
@coderabbitai review Written by an agent (Claude Code, claude-opus-5-5). |
PR Summary by QodoSkip absent workspace directories during frozen installs
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1. One changeset mixes both release lines
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix is aligned across both implementations and covered by meaningful regression tests.
Review effort: Balanced
Findings: None
What changed in this PR
Restores frozen installs for partial Docker workspace contexts while retaining errors for existing project directories without manifests across pnpm v11 and v12.
Changes:
- Skip absent workspace project directories during frozen installs.
- Preserve missing-manifest validation with clearer staleness reporting.
- Add cross-stack regression tests and a changeset.
| File | Description |
|---|---|
.changeset/frozen-install-absent-workspace-project.md |
Documents the restored behavior. |
pnpm11/installing/deps-installer/src/install/verifyFrozenLockfile.ts |
Distinguishes absent directories from missing manifests. |
pnpm11/installing/deps-installer/test/install/removedImporterFastUpdate.ts |
Tests both directory states. |
pnpm/crates/package-manager/src/install/lockfile_freshness.rs |
Gates manifest errors on directory existence. |
pnpm/crates/package-manager/src/install/run/dispatch.rs |
Updates frozen-path documentation. |
pnpm/crates/lockfile/src/freshness.rs |
Adds a dedicated staleness reason. |
pnpm/crates/cli/tests/suite/workspace_install/freshness.rs |
Verifies successful installation with an absent project. |
pnpm/crates/cli/tests/suite/lockfile_resolution_reuse/mutations.rs |
Updates the frozen-install regression expectation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
A frozen install that skipped an absent project directory must still install that project after the directory comes back. The current lockfile leaves the skipped importer out, so the next install sees the project as new. Cover this in both stacks; v11 needs an e2e test because the deps-installer harness bypasses the CLI's up-to-date check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 819f557 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Re the Qodo finding that one changeset mixes both release lines: not changing it. AGENTS.md allows one changeset naming both Written by an agent (Claude Code, claude-opus-5-5). |
…17713) #16462 let a frozen install skip a lockfile importer whose directory is absent, but kept failing when the directory exists without a manifest. An uninitialized git submodule is that case: git creates the gitlink's directory, empty, so CI jobs that skip submodule checkout fail every unfiltered frozen install. An empty directory now counts as absent. v12 checks it in check_importer_manifests_exist, v11 in isNonEmptyDirWithoutManifest. A directory with other contents and no manifest still fails. Closes #17712. --------- Co-authored-by: Zoltan Kochan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
#15427 (shipped in 12.8.0 and 11.28.0) made an unfiltered
pnpm install --frozen-lockfilefail withERR_PNPM_OUTDATED_LOCKFILEwhen a lockfile importer's directory orpackage.jsonwas missing. That broke Docker builds that leave unneeded workspace projects out of the build context (COPY --exclude=tests . ./): the check cannot tell an excluded project from a deleted one.The check now fails only when the project's directory exists but holds no manifest. A wholly absent directory is skipped again, like a project dropped from the workspace patterns. Both stacks change together.
check_importer_manifests_existrequires the directory to exist. The remaining case gets its ownStalenessReason::ImporterWithoutManifest("that project's directory has no package.json").RemovedImporter, which the auto-frozen freshness path still reports for any unclaimed importer, gets its original "no such project exists" message back.findImporterWithoutProjectManifestskips importers whose directory is absent, with the same failure reason text.Trade-off: the #7667 flow that copies only the lockfile and root manifest before the project sources succeeds silently again for projects whose directories are not there yet. It still fails if the directory was copied without its
package.json.pnpm fetchremains the command for that flow.Closes #16453.
Verification:
pnpm test:rust -p pnpm-cli -p pnpm-lockfile -p pnpm-package-manager -E 'test(/freshness|mutations|frozen|stale_importer|removed|importer/)'ran 506 tests, all passed.removedImporterFastUpdate.tsandfrozenLockfile.tsin@pnpm/installing.deps-installerran 26 tests, all passed. eslint passed on the changed files.frozen_install_skips_a_workspace_project_whose_directory_is_absent_until_it_reappears(v12) and a new e2e test inpnpm11/pnpm/test/monorepo/index.ts(v11, which goes through the CLI's up-to-date check) cover it. A manual run with both CLIs confirmed it for plainpnpm installtoo.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
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-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit