Repository navigation
Conversation
`pnpm update` re-resolved the lockfile but left `package.json` declaring the range it started from, so a dependency the output reported as updated still read as its old version in the manifest — unlike the TypeScript CLI, which rewrites the declared range around the version it resolved. A compatible bump cannot name that version before resolving: the pick depends on the ranges the workspace's other importers declare, on the overrides, and on the peer graph. Guessing it up front (the way `--latest` reads a dist-tag) would disagree with the install often enough to leave the manifest and the lockfile out of sync. So the update names the direct dependencies it targets, and the fresh-resolve path moves their ranges onto what it settled on, in the lockfile it is about to write, and reports each one back for the manifest write. The two carry the same text, and the version recorded against it satisfies it by construction. A dependency declared through a dist-tag now keeps tracking the tag under `--latest` too, which had been pinning it to the version behind the tag. Closes #13879
|
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 (7)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthrough
ChangesUpdate range persistence
Estimated code review effort: 4 (Complex) | ~45 minutes Mergeability Score: ⚪ Minimal · up to This updates the Rust CLI to write resolved dependency ranges back to manifests while preserving supported declaration forms; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Update
participant Install
participant Lockfile
participant ManifestSpecBumps
participant Manifest
Update->>Install: pass dependency bump targets
Install->>Lockfile: resolve packages and build lockfile
Lockfile->>ManifestSpecBumps: apply resolved versions
ManifestSpecBumps-->>Update: return applied manifest and catalog ranges
Update->>Manifest: persist changed ranges
✨ 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
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "style(update): add the trailing comma th..." | Re-trigger Greptile |
The doc comments on the new update tests, and the range-operator enumeration on `bumped_range`, narrated behavior the test names and assertions already carry. Each keeps only the rationale a reader cannot recover from the code. Also narrow the lockfile-side range rewrite to the dependency group the range was read from, so a dependency declared in more than one group can never have an unread declaration overwritten.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
pnpm/crates/cli/tests/suite/update.rs (2)
184-195: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert that the dist-tag tests still observe an update.
Both tests assert only that the manifest specifier is unchanged. A regression that makes
updateskip the dependency entirely would also satisfy that assertion. Add a resolved-version assertion so each test proves two things: the tag stays, and the dependency still moved.
update_bumps_within_rangealready usesvirtual_store_hasfor this purpose.💚 Proposed assertion for `update_keeps_a_dist_tag_specifier`
pacquet(&workspace, ["update"]).assert().success(); assert_eq!(dep_spec(&workspace, DEP).as_deref(), Some("latest")); + eprintln!("virtual store contents: {:?}", list_virtual_store(&workspace)); + assert!( + virtual_store_has(&workspace, "`@pnpm.e2e`[email protected]"), + "the tag must keep tracking the version it points at", + );Apply the equivalent assertion in
update_latest_keeps_a_dist_tag_specifier. Use the version the mocked registry advertises aslatest.Also applies to: 423-434
🤖 Prompt for 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. In `@pnpm/crates/cli/tests/suite/update.rs` around lines 184 - 195, Update the tests update_keeps_a_dist_tag_specifier and update_latest_keeps_a_dist_tag_specifier to retain their existing dist-tag assertions and additionally verify the resolved dependency version via virtual_store_has, using the mocked registry’s latest version to prove update actually occurred.
1065-1066: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert that the old catalog range is gone.
yaml.contains("^100.1.0")passes when the writer appends a second entry and leaves^100.0.0in place. Add the negative assertion so the test proves the entry moved rather than grew.💚 Proposed assertion
let yaml = read_workspace_yaml(&workspace); assert!(yaml.contains("^100.1.0"), "catalog entry should be bumped to ^100.1.0: {yaml}"); + assert!(!yaml.contains("^100.0.0"), "the previous catalog range should be replaced: {yaml}");🤖 Prompt for 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. In `@pnpm/crates/cli/tests/suite/update.rs` around lines 1065 - 1066, Update the assertions in the workspace YAML verification test around read_workspace_yaml so they also confirm the old ^100.0.0 catalog range is absent, while retaining the existing assertion for ^100.1.0.pnpm/crates/package-manager/src/manifest_spec_bumps.rs (1)
185-196: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse
is_valid_semver_rangefor npm-alias body detection.Import it from
pacquet_resolving_resolver_baseand replacerest.parse::<Range>().is_ok(). This keeps npm-alias disambiguation consistent with the shared strict semver-range policy.🤖 Prompt for 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. In `@pnpm/crates/package-manager/src/manifest_spec_bumps.rs` around lines 185 - 196, Update split_npm_alias to import and use is_valid_semver_range from pacquet_resolving_resolver_base when detecting bare npm range bodies, replacing the direct rest.parse::<Range>().is_ok() check while preserving the existing alias splitting behavior.Source: Learnings
🤖 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/update.rs`:
- Around line 337-347: The importer ID and workspace root calculations in
pnpm/crates/package-manager/src/update.rs:337-347 and
pnpm/crates/package-manager/src/update.rs:462-464 must follow the same rule as
Install::run_inner, including shared_workspace_lockfile handling and workspace
discovery when workspace_dir is unset. Extract and reuse a shared helper for
this rule, then use it in both update paths so ManifestSpecBumps.targets,
prepare_selected_manifests, and the per-project lookup derive consistent
importer IDs.
- Around line 395-401: Update the manifest update flow around
apply_bumped_manifest_specs so that, for bump-only updates where
should_persist_manifest is false, the initial manifest event is emitted before
applying the bump mutations. Preserve the existing persistence behavior and
ensure normal updates do not emit duplicate initial events.
---
Nitpick comments:
In `@pnpm/crates/cli/tests/suite/update.rs`:
- Around line 184-195: Update the tests update_keeps_a_dist_tag_specifier and
update_latest_keeps_a_dist_tag_specifier to retain their existing dist-tag
assertions and additionally verify the resolved dependency version via
virtual_store_has, using the mocked registry’s latest version to prove update
actually occurred.
- Around line 1065-1066: Update the assertions in the workspace YAML
verification test around read_workspace_yaml so they also confirm the old
^100.0.0 catalog range is absent, while retaining the existing assertion for
^100.1.0.
In `@pnpm/crates/package-manager/src/manifest_spec_bumps.rs`:
- Around line 185-196: Update split_npm_alias to import and use
is_valid_semver_range from pacquet_resolving_resolver_base when detecting bare
npm range bodies, replacing the direct rest.parse::<Range>().is_ok() check while
preserving the existing alias splitting behavior.
🪄 Autofix
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: 015182f0-9e26-4882-a618-e25e0b3be1ff
📒 Files selected for processing (10)
.changeset/update-writes-the-new-range.mdpnpm/crates/cli/tests/suite/update.rspnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/install/materialize.rspnpm/crates/package-manager/src/install/run.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/lib.rspnpm/crates/package-manager/src/manifest_spec_bumps.rspnpm/crates/package-manager/src/manifest_spec_bumps/tests.rspnpm/crates/package-manager/src/update.rs
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/package-manager/src/manifest_spec_bumps.rs (1)
124-126: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy liftKeep the dependency-group identity in the applied result.
manifestsstores(DependencyGroupIndex, String), butrender_aliasesremoves the group index beforeapplied.manifestsreachespnpm/crates/package-manager/src/update.rs:1103-1106, where the group is selected again from only the alias.If an alias exists in multiple groups, any precedence difference between
declared_dependencyanddeclared_groupcan update different groups in the lockfile and manifest. Preserve the group in the applied result, or share one group-selection helper. Add a regression case with the same alias independencies,devDependencies, andoptionalDependencies.As per path instructions: “Review this user-visible update behavior for pnpm/pacquet parity, scope discipline, and manifest/lockfile correctness.”
Also applies to: 198-221
🤖 Prompt for 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. In `@pnpm/crates/package-manager/src/manifest_spec_bumps.rs` around lines 124 - 126, Preserve the DependencyGroupIndex when assigning applied.manifests instead of stripping it through render_aliases, or reuse a shared group-selection helper with update.rs. Ensure manifest and lockfile updates select the same group when an alias appears in multiple groups. Add a regression case covering the alias in dependencies, devDependencies, and optionalDependencies.Source: Path instructions
🤖 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.
Nitpick comments:
In `@pnpm/crates/package-manager/src/manifest_spec_bumps.rs`:
- Around line 124-126: Preserve the DependencyGroupIndex when assigning
applied.manifests instead of stripping it through render_aliases, or reuse a
shared group-selection helper with update.rs. Ensure manifest and lockfile
updates select the same group when an alias appears in multiple groups. Add a
regression case covering the alias in dependencies, devDependencies, and
optionalDependencies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c53cb388-568a-4ed8-9f59-f8cff747ff40
📒 Files selected for processing (3)
pnpm/crates/cli/tests/suite/update.rspnpm/crates/package-manager/src/manifest_spec_bumps.rspnpm/crates/package-manager/src/update.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- pnpm/crates/cli/tests/suite/update.rs
- pnpm/crates/package-manager/src/update.rs
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13882 +/- ##
==========================================
+ Coverage 88.29% 88.33% +0.04%
==========================================
Files 627 628 +1
Lines 103689 103969 +280
==========================================
+ Hits 91552 91841 +289
+ Misses 12137 12128 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`sharedWorkspaceLockfile: false` anchors importer ids at the active project rather than the workspace root, so the ids the update built its bump targets from named importers the lockfile did not have. The lookup silently found nothing and the range was left unwritten — the very bug this was meant to fix, still present under dedicated lockfiles. Both rules now come from one `lockfile_root_dir` helper that the install derives its own `workspace_root` from, so they cannot drift apart again. A bump-only update also announces the manifest it started from. The reporter pairs that with the updated manifest it already emitted, so an NDJSON consumer no longer sees an update with nothing to diff against.
Micro-Benchmark ResultsLinux |
The group a bumped range belongs to was decided twice — once from the lockfile entry the range was read from, once again from the alias alone when writing `package.json`. A dependency declared in more than one group could have the two pick differently, leaving the manifest and the lockfile naming different entries. The group now travels with the range, so there is one rule and one decision. The write also stops going through `add_dependency`, which moves an alias into the target group by deleting it from the others. An update moves a range; it must not relocate a dependency that happens to be declared twice.
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Follow-up on the remaining review points, all pushed: Group selection duplicated between the lockfile and the manifest write (CodeRabbit, Writing the test surfaced a second problem in the same place: the manifest write went through Changeset must declare
This PR is Rust-only — the TypeScript CLI already has this behavior, which is what the fix is matching — so Patch coverage 95.3% (Codecov) — the 12 uncovered lines are Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Qodo re-fired rule 713436 (changeset must declare Qodo's other finding from the previous run (importer ID root mismatch) is struck through as resolved, and it reports 0 bugs on the current head. Written by an agent (Claude Code, claude-opus-5[1m]). |
|
Code review by qodo was updated up to the latest commit 151e942 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5917373894999995,
"stddev": 0.13251526197524396,
"median": 2.5717049775999996,
"user": 1.71444514,
"system": 1.2910678,
"min": 2.3554088076,
"max": 2.7862117826,
"times": [
2.3554088076,
2.5442393016,
2.7647332695999998,
2.5859352076,
2.6745515336,
2.5507491626,
2.7862117826,
2.6459750445999997,
2.4520950376,
2.5574747475999997
]
},
{
"command": "pacquet@main",
"mean": 2.6142570516,
"stddev": 0.22441793279207448,
"median": 2.5781988301,
"user": 1.8560030400000003,
"system": 1.4942174999999998,
"min": 2.3710246745999997,
"max": 3.0504941666,
"times": [
2.7526705556,
3.0504941666,
2.3872854946,
2.6281979466,
2.7938558896,
2.5281997136,
2.3909100625999997,
2.7671503516,
2.3710246745999997,
2.4727816606
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5256214413000002,
"stddev": 0.16854260719674194,
"median": 1.4294326991000001,
"user": 1.13637964,
"system": 1.1629117,
"min": 1.3491766706000001,
"max": 1.7449857126000001,
"times": [
1.7441396036,
1.7449857126000001,
1.3491766706000001,
1.3914411076000002,
1.4205572706,
1.7407035146,
1.3730956076,
1.6332495276,
1.4297810886000002,
1.4290843096
]
},
{
"command": "pnpr@main",
"mean": 1.4832374272,
"stddev": 0.116107192995563,
"median": 1.4469011946,
"user": 1.17099604,
"system": 1.1585025999999998,
"min": 1.3624176116,
"max": 1.6664783506,
"times": [
1.5960033996,
1.3624176116,
1.4851117746000002,
1.3849896576,
1.4022223456,
1.6664783506,
1.4270335176000002,
1.3828622336,
1.6584865096,
1.4667688716
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26484312018000006,
"stddev": 0.007223674737908223,
"median": 0.26382858538000004,
"user": 0.2326005,
"system": 0.54221002,
"min": 0.25484597838,
"max": 0.27895954138,
"times": [
0.26261943938000004,
0.27895954138,
0.26990752838000004,
0.26208267138,
0.27228676738,
0.26503773138000003,
0.25927119138000004,
0.25809899838000006,
0.25484597838,
0.26532135438000004
]
},
{
"command": "pacquet@main",
"mean": 0.26405511258000003,
"stddev": 0.007658479594504737,
"median": 0.26198910638000006,
"user": 0.22238239999999995,
"system": 0.54681102,
"min": 0.25255670938,
"max": 0.27452318838,
"times": [
0.27452318838,
0.27088761038000003,
0.27346137438,
0.26205890738000004,
0.26043719038,
0.27014870138,
0.25767837938000004,
0.25687975938,
0.26191930538,
0.25255670938
]
},
{
"command": "pnpr@HEAD",
"mean": 0.28128216718000004,
"stddev": 0.007155147696200961,
"median": 0.28162040388000004,
"user": 0.24700050000000004,
"system": 0.54902692,
"min": 0.27213817738,
"max": 0.29504671638,
"times": [
0.27299326438000004,
0.27904695438000005,
0.28082637738000005,
0.28241443038,
0.29504671638,
0.28499479738000005,
0.28337765938000004,
0.28785293438000004,
0.27413036038000005,
0.27213817738
]
},
{
"command": "pnpr@main",
"mean": 0.27858295558,
"stddev": 0.010436379111251611,
"median": 0.27815641588000006,
"user": 0.22395739999999997,
"system": 0.56049322,
"min": 0.26096642338000003,
"max": 0.29613480838,
"times": [
0.28682146538000003,
0.26500058038,
0.28563486638,
0.27853037338000003,
0.27439790038,
0.27604663838000004,
0.27778245838000004,
0.28451404138,
0.29613480838,
0.26096642338000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7499572406599997,
"stddev": 0.04199939833390682,
"median": 2.73879715416,
"user": 1.6166177199999996,
"system": 1.3819590600000002,
"min": 2.7149477476599997,
"max": 2.85668083466,
"times": [
2.7614947546599997,
2.85668083466,
2.76862357466,
2.71948628666,
2.74300040966,
2.75451656066,
2.7159165436599997,
2.7345938986599996,
2.7149477476599997,
2.73031179566
]
},
{
"command": "pacquet@main",
"mean": 2.7331261257599997,
"stddev": 0.01332047113379102,
"median": 2.7387760761599997,
"user": 1.58832762,
"system": 1.38991336,
"min": 2.71240704466,
"max": 2.7476630946599996,
"times": [
2.7427234066599997,
2.7476630946599996,
2.71922980066,
2.74716738966,
2.74211676566,
2.72291050266,
2.71240704466,
2.74247932666,
2.73543538666,
2.71912853966
]
},
{
"command": "pnpr@HEAD",
"mean": 1.63696596056,
"stddev": 0.15092482809899233,
"median": 1.57239608566,
"user": 1.1157692200000002,
"system": 1.1751475599999996,
"min": 1.46637650666,
"max": 1.8436818246600002,
"times": [
1.83829508666,
1.8436818246600002,
1.52917818966,
1.5590784876600001,
1.49249942066,
1.76189305966,
1.58571368366,
1.46637650666,
1.78001861266,
1.51292473366
]
},
{
"command": "pnpr@main",
"mean": 1.7255817631600003,
"stddev": 0.11108847606278131,
"median": 1.74342002316,
"user": 1.08792902,
"system": 1.1759986599999999,
"min": 1.51510210266,
"max": 1.86988509466,
"times": [
1.69172604466,
1.51510210266,
1.56636204866,
1.78918853466,
1.72417949666,
1.77678043166,
1.86988509466,
1.8357538316600002,
1.74310665966,
1.74373338666
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4363086064,
"stddev": 0.025067328491254894,
"median": 0.4339239764,
"user": 0.54042894,
"system": 0.71540874,
"min": 0.3884786459,
"max": 0.4705902009,
"times": [
0.3884786459,
0.4214686149,
0.4216458959,
0.4453677689,
0.4705902009,
0.4238369019,
0.4243327429,
0.4594946519,
0.4643554309,
0.4435152099
]
},
{
"command": "pacquet@main",
"mean": 0.43088593900000005,
"stddev": 0.01921285758399411,
"median": 0.4313033644,
"user": 0.5468068400000001,
"system": 0.6948197399999998,
"min": 0.3974076059,
"max": 0.4563445249,
"times": [
0.4349266789,
0.4452164549,
0.4276800499,
0.4133787909,
0.4563445249,
0.4162056099,
0.4475715189,
0.4506519439,
0.4194762119,
0.3974076059
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3110560005,
"stddev": 0.006046387995477897,
"median": 0.3106163959,
"user": 0.21622333999999999,
"system": 0.53740864,
"min": 0.3001000999,
"max": 0.3198564249,
"times": [
0.3125453339,
0.3086096219,
0.3131076299,
0.3086874579,
0.3076117779,
0.3001000999,
0.3058028109,
0.3166002389,
0.3176386089,
0.3198564249
]
},
{
"command": "pnpr@main",
"mean": 0.3113870811,
"stddev": 0.007145696558847336,
"median": 0.3120422994,
"user": 0.21571794000000005,
"system": 0.53783514,
"min": 0.2986177859,
"max": 0.3224798319,
"times": [
0.30815036889999997,
0.2986177859,
0.3113685939,
0.3034826029,
0.3224798319,
0.3131474439,
0.3127160049,
0.3182383749,
0.31755135489999997,
0.3081184489
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.89524996096,
"stddev": 0.019885494360950145,
"median": 1.9039683374600003,
"user": 0.7898270999999999,
"system": 0.8345671199999998,
"min": 1.8616280909600003,
"max": 1.9196660019600003,
"times": [
1.9196660019600003,
1.8734058689600002,
1.8616280909600003,
1.90650390496,
1.8818479289600003,
1.87756656896,
1.9090561379600002,
1.9148884319600001,
1.9059545529600002,
1.9019821219600002
]
},
{
"command": "pacquet@main",
"mean": 1.8744325545600002,
"stddev": 0.016433629789130544,
"median": 1.87156537796,
"user": 0.7972813999999999,
"system": 0.7910162199999999,
"min": 1.8522628159600003,
"max": 1.9099848729600002,
"times": [
1.86656025796,
1.88300962996,
1.8660837729600002,
1.8592115259600002,
1.8522628159600003,
1.8807105129600001,
1.9099848729600002,
1.8651261249600002,
1.88480553396,
1.8765704979600002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30624827566,
"stddev": 0.011473871828052798,
"median": 0.30458872845999996,
"user": 0.21214429999999998,
"system": 0.5292048200000001,
"min": 0.28978393996,
"max": 0.32394614896,
"times": [
0.29746564596,
0.28978393996,
0.29355254696,
0.30581786196,
0.32394614896,
0.31829503596000003,
0.30335959496,
0.29997764396,
0.31279006696,
0.31749427096
]
},
{
"command": "pnpr@main",
"mean": 0.3199778098600001,
"stddev": 0.03512537902359505,
"median": 0.30886971846,
"user": 0.2186146,
"system": 0.5827909199999999,
"min": 0.30096348496,
"max": 0.41828650696,
"times": [
0.30492998496,
0.30850861596,
0.31148095796,
0.32457689296000003,
0.31013757596,
0.30315464196,
0.41828650696,
0.30874782496000003,
0.30899161196,
0.30096348496
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22255086558909093,
"stddev": 0.022560234121470384,
"median": 0.21691795268000003,
"user": 0.16567732,
"system": 0.055431278181818186,
"min": 0.19470779068000002,
"max": 0.25855356868,
"times": [
0.24778701768000003,
0.21624181268,
0.19470779068000002,
0.21691795268000003,
0.21111431268000003,
0.19562654568,
0.25400477468,
0.25855356868,
0.22964618768,
0.22122228668000002,
0.20223727168000002
]
},
{
"command": "pacquet@main",
"mean": 0.22675800284666667,
"stddev": 0.012166877339131419,
"median": 0.22753632068000001,
"user": 0.17165423666666668,
"system": 0.05074896,
"min": 0.21188223568,
"max": 0.24110987668000003,
"times": [
0.23972843368000002,
0.21306588868,
0.24106832968000003,
0.22733090968000003,
0.22774173168,
0.21636510568,
0.23874281268000003,
0.21461830368,
0.24110987668000003,
0.23549135568000001,
0.21395105068,
0.21188223568
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08749243845419352,
"stddev": 0.00176472008713342,
"median": 0.08734902368000001,
"user": 0.020149707096774192,
"system": 0.010648172258064517,
"min": 0.08451859768,
"max": 0.09154177768,
"times": [
0.09059671168000001,
0.08786698468000001,
0.08764284468000001,
0.08500230568,
0.08776914068000001,
0.08669615668000001,
0.08983613368000001,
0.08495627768000001,
0.08861574268000001,
0.08587713868,
0.09154177768,
0.08995204168000001,
0.08696288668,
0.08630783668000001,
0.08604349168,
0.08734902368000001,
0.08919334568000001,
0.08463670868,
0.08968861568000001,
0.08697989968,
0.08595290068000001,
0.08779198468,
0.08865731968000001,
0.08451859768,
0.08809561468,
0.08821823468000001,
0.08647460068000001,
0.08695012368,
0.08880141068000001,
0.08614279668000001,
0.08714694368
]
},
{
"command": "pnpr@main",
"mean": 0.08808257118000001,
"stddev": 0.0020856346626832176,
"median": 0.08810916518,
"user": 0.022200601249999993,
"system": 0.008390558749999999,
"min": 0.08307495468000001,
"max": 0.09233970568000001,
"times": [
0.08777218768,
0.09020861268000001,
0.09119672968,
0.08800606668000001,
0.08916384068000001,
0.08953676068000001,
0.09233970568000001,
0.08568930568000001,
0.08893207568,
0.08332862168,
0.08742045668000001,
0.08798190068,
0.08821226368000001,
0.09086956468,
0.08899013468000001,
0.08788885668,
0.08923946368,
0.09003163068,
0.08783118768,
0.08924571468,
0.08307495468000001,
0.08907760968,
0.08541639368000001,
0.08874671768,
0.08698712268,
0.08652312168000001,
0.08648695368,
0.08856365368,
0.08685011568,
0.08624208368000001,
0.09055019468,
0.08623827568
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5209377418066667,
"stddev": 0.09193622424127496,
"median": 0.5198434041400001,
"user": 0.5079788644444444,
"system": 0.09098061777777776,
"min": 0.35813063514000004,
"max": 0.69331281314,
"times": [
0.53572307714,
0.5198434041400001,
0.5993314391400001,
0.52769403814,
0.35813063514000004,
0.69331281314,
0.5090863521400001,
0.48229418414,
0.46302373314
]
},
{
"command": "pacquet@main",
"mean": 0.5677145866955556,
"stddev": 0.06407992104108537,
"median": 0.59900697914,
"user": 0.5419495311111111,
"system": 0.11818317333333332,
"min": 0.47194049914,
"max": 0.65318258614,
"times": [
0.62611585214,
0.65318258614,
0.48464210314000006,
0.60043058214,
0.55879033014,
0.51447926014,
0.47194049914,
0.59900697914,
0.6008430881400001
]
},
{
"command": "pnpm@HEAD",
"mean": 3.027731442584445,
"stddev": 0.13186478111979377,
"median": 2.96528207714,
"user": 4.635982531111111,
"system": 0.24441883999999994,
"min": 2.85785850914,
"max": 3.25695232714,
"times": [
3.25695232714,
3.02860912114,
2.95946476214,
3.15753688714,
2.96528207714,
2.91520608514,
3.14978141914,
2.85785850914,
2.95889179514
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.6731815609,
"stddev": 0.16913341108413169,
"median": 4.6992171017999995,
"user": 2.31997786,
"system": 1.6927914599999998,
"min": 4.4665052007999995,
"max": 4.9956199007999995,
"times": [
4.7046616318,
4.7228012378,
4.4665052007999995,
4.8435156948,
4.4801085288,
4.5370329707999995,
4.9956199007999995,
4.693772571799999,
4.744780061799999,
4.543017809799999
]
},
{
"command": "pacquet@main",
"mean": 4.5348656821999995,
"stddev": 0.06322203945992934,
"median": 4.5318017158,
"user": 2.04582996,
"system": 1.5477161599999998,
"min": 4.4435999778,
"max": 4.6702655678,
"times": [
4.4879832868,
4.4435999778,
4.6702655678,
4.536744318799999,
4.5316584068,
4.6035621708,
4.4944389207999995,
4.5319450248,
4.5402075168,
4.508251630799999
]
},
{
"command": "pnpr@HEAD",
"mean": 3.625569926,
"stddev": 0.12661773050804545,
"median": 3.5629669608000003,
"user": 1.5957869599999999,
"system": 1.4638563599999999,
"min": 3.5053595058,
"max": 3.8545891948000004,
"times": [
3.7188776358,
3.6255816078,
3.5473672518000003,
3.5053595058,
3.8545891948000004,
3.8168880068,
3.5670624768000003,
3.5263974228,
3.5347047128000004,
3.5588714448000003
]
},
{
"command": "pnpr@main",
"mean": 3.6111592173,
"stddev": 0.08331209323092315,
"median": 3.5994782663000002,
"user": 1.7053902599999997,
"system": 1.62954016,
"min": 3.5008619838,
"max": 3.7358358458,
"times": [
3.5757207038,
3.5168739888,
3.6792216008,
3.5008619838,
3.5372168378000004,
3.6192348738000004,
3.7358358458,
3.5797216588,
3.7222255198000003,
3.6446791598000003
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13882 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,466.38 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 289.78 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 300.10 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.52 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,349.18 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,505.36 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 272.14 ms |
Summary
pnpm updatere-resolvedpnpm-lock.yamlbut leftpackage.jsondeclaring the range it started from, so a dependency the output reported as updated still read as its old version in the manifest (#13879). The TypeScript CLI rewrites the declared range around the version it resolved; the Rust CLI did not.This makes the Rust CLI match. Verified byte-for-byte against
[email protected]on a fixture covering^,~,=, exact pins,>=,1.x,*,a || b,npm:aliases, dist-tags,workspace:,link:,file:, git shorthands,catalog:entries, and a filtered workspace update.Why the range is computed after resolving, not before.
--latestcan write its range up front because a dist-tag names a version on its own. A compatible bump cannot: the version depends on the ranges the workspace's other importers declare, on the overrides, and on the peer graph. Pre-resolving each dependency on its own (the first shape I tried) disagreed with the install often enough to leave the manifest and the lockfile out of sync — it brokefiltered_compatible_update_keeps_workspace_manifest_preferences, where an unselected project's pin holds the shared version down, andpnpm@11agrees with the existing test. It also added one registry round trip per direct dependency to the common path.So the update names the direct dependencies it targets (
ManifestSpecBumps), the fresh-resolve path moves their ranges onto what it settled on — in the lockfile it is about to write — and reports each one back for thepackage.json/pnpm-workspace.yamlwrite. The two carry the same text, and the version recorded against it satisfies it by construction, so--frozen-lockfilestill passes right after an update. No extra resolution or network.Left alone: dist-tags (they already track the newest version),
workspace:/link:/file:/ git / tarball /jsr:/ named-registry declarations, and anything under--no-save. Acatalog:reference moves the catalog entry rather than the manifest entry, matchingpnpm update -ron the TypeScript side.Also fixes two adjacent bugs this surfaced:
pnpm update --latestwas rewriting"foo": "latest"to"^3.0.1". A dist-tag now keeps tracking its tag under both update modes.add_dependency, which moves an alias into the target group by deleting it from the others —add's semantics, not an update's. A manifest declaring the same alias in two groups had one silently dropped. The range is now written in place, in the group the lockfile entry was read from.TypeScript CLI: no change needed — this is the behavior it already has.
Closes #13879
Squash Commit Body
Checklist
already linked to it solves it.
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 (Claude Code, claude-opus-5[1m]).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
pnpm updatenow writes updated dependency ranges topackage.jsonand relevantcatalog:entries.--latestretains dist-tag declarations instead of replacing them with fixed versions.Bug Fixes
--no-savebehavior remains unchanged.