Repository navigation
feat: add minimumReleaseAgeExcludePrune, rename cleanupUnusedCatalogs to catalogPrune - #13653
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds an opt-in ChangesMinimum release-age exclusion cleanup
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ 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 |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the registry-qualified snapshot path now extracts and retains the semantic version under the correct package name. Reviews (7): Last reviewed commit: "refactor: name the pruning settings `min..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pnpm11/workspace/workspace-manifest-writer/src/index.ts (1)
97-107: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRun cleanup before merging newly added exclusions.
The writer merges
addedMinimumReleaseAgeExcludesbefore cleanup. Cleanup can then delete an exclusion added in the same write when it is absent fromresolvedPackageVersions. Rust runs cleanup first and preserves all same-write additions.
pnpm11/workspace/workspace-manifest-writer/src/index.ts#L97-L107: move the cleanup block before theaddedMinimumReleaseAgeExcludesmerge.pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts#L148-L162: add an unmatched exclusion, such as[email protected], and verify it remains while an existing stale exclusion is removed.As per path instructions, “entries added in the same write are never pruned” and TypeScript/pacquet behavior must match.
🤖 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 `@pnpm11/workspace/workspace-manifest-writer/src/index.ts` around lines 97 - 107, In pnpm11/workspace/workspace-manifest-writer/src/index.ts lines 97-107, move the cleanupMinimumReleaseAgeExcludes call before merging addedMinimumReleaseAgeExcludes so same-write additions are never pruned. In pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts lines 148-162, add an unmatched exclusion such as [email protected] and verify it remains while the existing stale exclusion is removed.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.
Inline comments:
In `@pnpm11/installing/commands/src/recursive.ts`:
- Around line 547-548: Update the recursive action aggregation around
allResolvedPackageVersions to track whether any ActionResult.newLockfile was
produced, and pass resolvedPackageVersions as undefined when none was returned.
Preserve and pass the empty map when a lockfile was produced but contains no
resolved versions, so the manifest writer can distinguish “no lockfile” from an
intentionally empty lockfile.
In `@pnpm11/workspace/workspace-manifest-writer/src/index.ts`:
- Around line 302-304: Update the narrowed-version branch that pushes to
survivingSpecs to pass the surviving version union through
mergePackageVersionSpecs() instead of preserving survivingVersions input order.
Add a regression test covering unsorted surviving versions and verify
TypeScript/pacquet behavioral parity, including errors and manifest formatting.
---
Outside diff comments:
In `@pnpm11/workspace/workspace-manifest-writer/src/index.ts`:
- Around line 97-107: In pnpm11/workspace/workspace-manifest-writer/src/index.ts
lines 97-107, move the cleanupMinimumReleaseAgeExcludes call before merging
addedMinimumReleaseAgeExcludes so same-write additions are never pruned. In
pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
lines 148-162, add an unmatched exclusion such as [email protected] and verify it
remains while the existing stale exclusion is removed.
🪄 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: 0be5cf97-834d-4150-8c59-3d1f504c66ee
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lock,!Cargo.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (31)
.changeset/cleanup-outdated-minimum-release-age-excludes.mdpnpm/crates/cli/tests/catalog.rspnpm/crates/config/src/lib.rspnpm/crates/config/src/tests.rspnpm/crates/config/src/version_policy.rspnpm/crates/config/src/workspace_yaml.rspnpm/crates/deps-restorer/src/install_package_from_registry/tests.rspnpm/crates/package-manager/src/add.rspnpm/crates/package-manager/src/catalog_cleanup.rspnpm/crates/package-manager/src/catalog_cleanup/tests.rspnpm/crates/package-manager/src/remove.rspnpm/crates/package-manager/src/update.rspnpm/crates/workspace-manifest-writer/Cargo.tomlpnpm/crates/workspace-manifest-writer/src/edit.rspnpm/crates/workspace-manifest-writer/src/lib.rspnpm/crates/workspace-manifest-writer/src/tests.rspnpm11/config/reader/src/Config.tspnpm11/config/version-policy/src/index.tspnpm11/installing/commands/package.jsonpnpm11/installing/commands/src/installDeps.tspnpm11/installing/commands/src/recursive.tspnpm11/installing/commands/src/remove.tspnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.tspnpm11/installing/commands/tsconfig.jsonpnpm11/installing/deps-installer/src/install/extendInstallOptions.tspnpm11/installing/deps-installer/src/install/index.tspnpm11/lockfile/utils/src/index.tspnpm11/lockfile/utils/src/resolvedPackageVersions.tspnpm11/lockfile/utils/test/resolvedPackageVersions.tspnpm11/workspace/workspace-manifest-writer/src/index.tspnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
There was a problem hiding this comment.
Pull request overview
Adds a new workspace setting, cleanupOutdatedMinimumReleaseAgeExcludes, to automatically prune stale minimumReleaseAgeExclude entries in pnpm-workspace.yaml based on what the freshly resolved lockfile contains (implemented in both the TypeScript CLI and the Rust pnpm/ port).
Changes:
- Add lockfile-derived “resolved package versions” collection utilities and pass them through install/remove/update flows to the workspace manifest writer.
- Implement the cleanup pass in the workspace manifest writer (TypeScript + Rust) and add coverage tests for pruning behavior and edge cases (globs, unparsable entries, non-semver resolutions).
- Expose
parseVersionPolicyRulefor reuse and add changeset/lockfile updates for the new public setting.
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts | New Jest suite covering cleanup behavior in TS manifest writer. |
| pnpm11/workspace/workspace-manifest-writer/src/index.ts | Adds cleanup option + implementation for pruning outdated excludes. |
| pnpm11/lockfile/utils/test/resolvedPackageVersions.ts | Tests for extracting resolved package versions from a lockfile. |
| pnpm11/lockfile/utils/src/resolvedPackageVersions.ts | New helper to map lockfile packages to name → resolved versions. |
| pnpm11/lockfile/utils/src/index.ts | Exports the new lockfile utility function. |
| pnpm11/installing/deps-installer/src/install/index.ts | Forwards newLockfile through install/mutate results to callers. |
| pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts | Adds cleanupOutdatedMinimumReleaseAgeExcludes to strict options + defaults. |
| pnpm11/installing/commands/tsconfig.json | Adds project reference to lockfile/utils. |
| pnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.ts | New helper to compute resolved versions only when cleanup is enabled. |
| pnpm11/installing/commands/src/remove.ts | Wires cleanup option + resolved versions into workspace manifest update after remove. |
| pnpm11/installing/commands/src/recursive.ts | Accumulates resolved versions for recursive operations and forwards to manifest writer. |
| pnpm11/installing/commands/src/installDeps.ts | Wires cleanup option + resolved versions into workspace manifest update after install. |
| pnpm11/installing/commands/package.json | Adds dependency on @pnpm/lockfile.utils. |
| pnpm11/config/version-policy/src/index.ts | Exports parseVersionPolicyRule for reuse by cleanup logic. |
| pnpm11/config/reader/src/Config.ts | Adds the new setting to the config type surface. |
| pnpm/crates/workspace-manifest-writer/src/tests.rs | Adds Rust tests for the cleanup pass parity and edge cases. |
| pnpm/crates/workspace-manifest-writer/src/lib.rs | Adds options + error plumbing for cleanup and merging release-age excludes. |
| pnpm/crates/workspace-manifest-writer/src/edit.rs | Implements cleanup + merge helpers on the Rust manifest writer side. |
| pnpm/crates/workspace-manifest-writer/Cargo.toml | Adds pacquet-config dependency for version-policy helpers. |
| pnpm/crates/package-manager/src/update.rs | Runs the cleanup pass post-install for update flows (Rust). |
| pnpm/crates/package-manager/src/remove.rs | Runs the cleanup pass post-install for remove flows (Rust). |
| pnpm/crates/package-manager/src/add.rs | Runs the cleanup pass post-install for add flows (Rust). |
| pnpm/crates/package-manager/src/catalog_cleanup.rs | Adds lockfile-based cleanup pass orchestration + resolved-versions extraction (Rust). |
| pnpm/crates/package-manager/src/catalog_cleanup/tests.rs | New test ensuring non-semver packages register by name only (Rust). |
| pnpm/crates/deps-restorer/src/install_package_from_registry/tests.rs | Extends config fixture with the new setting default (Rust tests). |
| pnpm/crates/config/src/workspace_yaml.rs | Adds workspace-yaml parsing for the new setting (Rust). |
| pnpm/crates/config/src/version_policy.rs | Adds pruning logic + types for resolved versions (Rust). |
| pnpm/crates/config/src/tests.rs | Adds config test ensuring workspace-yaml setting is read (Rust). |
| pnpm/crates/config/src/lib.rs | Adds the new config field and docs (Rust). |
| pnpm/crates/cli/tests/catalog.rs | Adds CLI-level Rust test validating cleanup behavior end-to-end. |
| pnpm-lock.yaml | Updates workspace importer deps and lock entries due to new package usage. |
| Cargo.lock | Adds pacquet-config dependency to workspace-manifest-writer crate. |
| .changeset/cleanup-outdated-minimum-release-age-excludes.md | Changeset announcing the new workspace setting and behavior. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13653 +/- ##
==========================================
+ Coverage 88.23% 88.25% +0.01%
==========================================
Files 624 624
Lines 101779 101918 +139
==========================================
+ Hits 89809 89945 +136
- Misses 11970 11973 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.5062693912199996,
"stddev": 0.13454960229293536,
"median": 2.47540826132,
"user": 1.6407179799999998,
"system": 1.36407122,
"min": 2.33362309732,
"max": 2.68917558532,
"times": [
2.62508302632,
2.42670664232,
2.42400788032,
2.6149136193199998,
2.5241098803199997,
2.6651916943200002,
2.68917558532,
2.41969877032,
2.34018371632,
2.33362309732
]
},
{
"command": "pacquet@main",
"mean": 2.47130054562,
"stddev": 0.17058334396610947,
"median": 2.3808249738200002,
"user": 1.5908127799999998,
"system": 1.32935882,
"min": 2.34894549832,
"max": 2.78911304232,
"times": [
2.40368244632,
2.75263640332,
2.37674805832,
2.57075144032,
2.36717826732,
2.36525795832,
2.35379045232,
2.78911304232,
2.34894549832,
2.38490188932
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5307067048199998,
"stddev": 0.14959392537262975,
"median": 1.47774507532,
"user": 1.1497670799999997,
"system": 1.20614862,
"min": 1.37610992832,
"max": 1.78699506032,
"times": [
1.43525512932,
1.51446226532,
1.37610992832,
1.44102788532,
1.78699506032,
1.72381063032,
1.57268890032,
1.66675567632,
1.39507831932,
1.39488325332
]
},
{
"command": "pnpr@main",
"mean": 1.57605836272,
"stddev": 0.18308239507399068,
"median": 1.5367548603199999,
"user": 1.1099599799999997,
"system": 1.17781282,
"min": 1.37815359932,
"max": 1.79464795032,
"times": [
1.79464795032,
1.77229794732,
1.38622421332,
1.51933353332,
1.78638047732,
1.75857912132,
1.37815359932,
1.38695254132,
1.42383805632,
1.55417618732
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25955783174,
"stddev": 0.018471122293576465,
"median": 0.25156451994,
"user": 0.22488037999999996,
"system": 0.5131418799999999,
"min": 0.23850910544,
"max": 0.28239544344,
"times": [
0.23850910544,
0.24983375344000003,
0.24867701944,
0.25329528644,
0.23860332244000002,
0.24547346044,
0.28214317844000003,
0.27931862344,
0.27732912444,
0.28239544344
]
},
{
"command": "pacquet@main",
"mean": 0.25194121983999995,
"stddev": 0.012607667180053652,
"median": 0.24853887994,
"user": 0.20838018000000003,
"system": 0.5084403799999999,
"min": 0.23700989844,
"max": 0.27167774544,
"times": [
0.26651156944,
0.24161170544000002,
0.24834043744,
0.27167774544,
0.25293085244,
0.26761272744000003,
0.24752248044,
0.23700989844,
0.23745745944000002,
0.24873732244000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27103290324,
"stddev": 0.003737449646186194,
"median": 0.27031026594,
"user": 0.23448518,
"system": 0.5300139799999999,
"min": 0.26757334444,
"max": 0.27704345744000003,
"times": [
0.27697585044,
0.27025347844000003,
0.27060381744,
0.26757334444,
0.26767663844,
0.26782107944,
0.27412855144000003,
0.26788576144000004,
0.27036705344,
0.27704345744000003
]
},
{
"command": "pnpr@main",
"mean": 0.27062704484,
"stddev": 0.008291373498516365,
"median": 0.27003757444,
"user": 0.22061028,
"system": 0.5392069799999999,
"min": 0.26112770344,
"max": 0.28864540644000003,
"times": [
0.27123078644,
0.27649199144000003,
0.27400083144000004,
0.26333768644,
0.26884436244,
0.27435076844,
0.26112770344,
0.26293128144,
0.26530963044,
0.28864540644000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.66412669206,
"stddev": 0.07243892819916016,
"median": 2.6436936637599997,
"user": 1.7865434399999998,
"system": 1.4668375800000002,
"min": 2.5747007537599997,
"max": 2.80982288476,
"times": [
2.61423398176,
2.5747007537599997,
2.60236414676,
2.63068710776,
2.62324542376,
2.74872534576,
2.65670021976,
2.80982288476,
2.70298021476,
2.67780684176
]
},
{
"command": "pacquet@main",
"mean": 2.6813171718600004,
"stddev": 0.03673409373321298,
"median": 2.66752852726,
"user": 1.81964464,
"system": 1.43690838,
"min": 2.6360518487599998,
"max": 2.74649144776,
"times": [
2.70123531676,
2.71315645776,
2.66638409676,
2.6573919997599997,
2.74649144776,
2.66867295776,
2.64111711776,
2.6360518487599998,
2.66247886876,
2.72019160676
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5380792256600002,
"stddev": 0.10990382307802249,
"median": 1.47791658076,
"user": 1.16056034,
"system": 1.2090874800000002,
"min": 1.4257291247600001,
"max": 1.7086461677600002,
"times": [
1.46193255576,
1.6274450027600003,
1.46367135276,
1.66205012976,
1.44559830176,
1.4431168287600002,
1.4921618087600002,
1.65044098376,
1.4257291247600001,
1.7086461677600002
]
},
{
"command": "pnpr@main",
"mean": 1.56439035336,
"stddev": 0.12642730373955477,
"median": 1.5252799917600002,
"user": 1.09403844,
"system": 1.2685776800000002,
"min": 1.4294708067600002,
"max": 1.82979635276,
"times": [
1.54857732176,
1.59415417476,
1.5039846067600002,
1.4689675957600001,
1.73861722776,
1.47977546376,
1.82979635276,
1.5446051257600002,
1.5059548577600002,
1.4294708067600002
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.43826096360000005,
"stddev": 0.01731522221294469,
"median": 0.43680719310000005,
"user": 0.58585072,
"system": 0.7156623999999999,
"min": 0.4147604146,
"max": 0.4649413196,
"times": [
0.4147604146,
0.4338067706,
0.4563330856,
0.4180166926,
0.4203332446,
0.4649413196,
0.4496535546,
0.4327624496,
0.4521944886,
0.43980761560000003
]
},
{
"command": "pacquet@main",
"mean": 0.43012522580000007,
"stddev": 0.03298795381420451,
"median": 0.4338751031,
"user": 0.59152392,
"system": 0.6666106999999999,
"min": 0.3830687486,
"max": 0.4725224826,
"times": [
0.4640793506,
0.4638795946,
0.4529197316,
0.3830687486,
0.3976189556,
0.3993224666,
0.4297209026,
0.4725224826,
0.43802930360000003,
0.40009072160000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31719961990000006,
"stddev": 0.02155333232267634,
"median": 0.3073947786,
"user": 0.21932491999999998,
"system": 0.5258089,
"min": 0.2967385706,
"max": 0.3642979296,
"times": [
0.2969156646,
0.3066220416,
0.3302673096,
0.3642979296,
0.3035531656,
0.3081675156,
0.3367785326,
0.3238746576,
0.3047808116,
0.2967385706
]
},
{
"command": "pnpr@main",
"mean": 0.31472728940000005,
"stddev": 0.010359879180002696,
"median": 0.3165206506,
"user": 0.22403921999999996,
"system": 0.5212256000000001,
"min": 0.2960473326,
"max": 0.3292817266,
"times": [
0.3268729106,
0.3081052086,
0.3048279006,
0.3221304196,
0.2960473326,
0.3158693066,
0.3185140546,
0.3084520396,
0.3292817266,
0.3171719946
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.75951659164,
"stddev": 0.02054972292871016,
"median": 1.75136659254,
"user": 0.8181487000000001,
"system": 0.78331158,
"min": 1.73941854304,
"max": 1.8006379590400001,
"times": [
1.75657672204,
1.78210911404,
1.8006379590400001,
1.77892355004,
1.7490701280399998,
1.7459074050399999,
1.74081054904,
1.7480488890399999,
1.73941854304,
1.75366305704
]
},
{
"command": "pacquet@main",
"mean": 1.75154202124,
"stddev": 0.029727426249953854,
"median": 1.75065896304,
"user": 0.8329106,
"system": 0.7795902799999999,
"min": 1.7126158330399999,
"max": 1.79856716804,
"times": [
1.78512335904,
1.78327580704,
1.79856716804,
1.75098775104,
1.75292867704,
1.75033017504,
1.73405910304,
1.73471559804,
1.71281674104,
1.7126158330399999
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30010405063999995,
"stddev": 0.010218235446101832,
"median": 0.30012927354,
"user": 0.20504059999999996,
"system": 0.5136449799999999,
"min": 0.28839649804,
"max": 0.32201600604,
"times": [
0.32201600604,
0.29487361804,
0.31075215204,
0.30098834704,
0.29997831004000003,
0.29203808004000004,
0.30217666004,
0.28839649804,
0.28954059804,
0.30028023704
]
},
{
"command": "pnpr@main",
"mean": 0.34775536944,
"stddev": 0.05561820122519136,
"median": 0.32141218654000003,
"user": 0.2503665,
"system": 0.6159914799999999,
"min": 0.29950501004,
"max": 0.45193018404,
"times": [
0.33930102304000004,
0.29950501004,
0.32432228004,
0.40330244704,
0.41893913704,
0.45193018404,
0.31850209304,
0.29976815404,
0.30744816504,
0.31453520104
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21311299838,
"stddev": 0.015706545737233978,
"median": 0.21041864938000004,
"user": 0.18043642000000001,
"system": 0.055718149999999994,
"min": 0.19488060488000003,
"max": 0.24269776888000003,
"times": [
0.22925793588,
0.20966310988000003,
0.19488060488000003,
0.19765776188000003,
0.23315779488000002,
0.24269776888000003,
0.22107708588000002,
0.21514614188000003,
0.19654104388000002,
0.19834341088000002,
0.21117418888000003,
0.20775913288000003
]
},
{
"command": "pacquet@main",
"mean": 0.20546555749538464,
"stddev": 0.014190866728285706,
"median": 0.20365871788000003,
"user": 0.16210726615384613,
"system": 0.05642251538461539,
"min": 0.18744491388000004,
"max": 0.23605784188000004,
"times": [
0.21086900588000002,
0.21097362088000002,
0.22684528388000003,
0.19389793888000004,
0.20365871788000003,
0.20358747488000004,
0.23605784188000004,
0.18744491388000004,
0.20801931188000003,
0.20156062588000004,
0.20772720188000002,
0.18846423888000002,
0.19194607088
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08761207494060606,
"stddev": 0.0012315099370095934,
"median": 0.08739854688000001,
"user": 0.02046566242424243,
"system": 0.00969772424242424,
"min": 0.08591123188000001,
"max": 0.09153919688,
"times": [
0.08629882988000001,
0.08762742588,
0.08762950088,
0.08818174788000001,
0.08701132688,
0.08615885688000001,
0.08716969688000001,
0.08760000488,
0.08744187788,
0.08758525588,
0.08765437688000001,
0.08718699888,
0.08689702388000001,
0.08767243088,
0.08681003088,
0.08953945788,
0.09067553388,
0.08967191688000001,
0.08591123188000001,
0.08756243388,
0.08739854688000001,
0.08677525588,
0.08819376988000001,
0.09153919688,
0.08650134088,
0.08722422788,
0.08733812288000001,
0.08840376388,
0.08649085088,
0.08736364088000001,
0.08694963188,
0.08829847788,
0.08643568688
]
},
{
"command": "pnpr@main",
"mean": 0.08742477131750004,
"stddev": 0.0008571413610093145,
"median": 0.08725527138,
"user": 0.020825982499999996,
"system": 0.00949318125,
"min": 0.08569910388,
"max": 0.09015725888000001,
"times": [
0.08851657688,
0.08569910388,
0.08751832188,
0.08768475388000001,
0.08726344088,
0.08675885488,
0.08973959488000001,
0.09015725888000001,
0.08676927388000001,
0.08718352188,
0.08768623688,
0.08798461788,
0.08703395988000001,
0.08699472788000001,
0.08712837888000001,
0.08797967688000001,
0.08646142488,
0.08759554688,
0.08724710188000001,
0.08811422188000001,
0.08775997488000001,
0.08688926888000001,
0.08691206288,
0.08698740288000001,
0.08642074888000001,
0.08741082988,
0.08749185088,
0.08752287988,
0.08707456688000001,
0.08712732688000001,
0.08731757388,
0.08716159988000001
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.909168782648889,
"stddev": 0.2762195040125459,
"median": 0.8206534647600001,
"user": 0.8696706111111111,
"system": 0.14282064,
"min": 0.64762927676,
"max": 1.46465884276,
"times": [
0.74851066476,
0.8206534647600001,
0.82185470276,
0.9016413457600001,
1.46465884276,
0.79973836876,
1.2782126447600002,
0.6996197327600001,
0.64762927676
]
},
{
"command": "pacquet@main",
"mean": 0.86659478476,
"stddev": 0.24737879369352028,
"median": 0.8205187627600001,
"user": 0.8355772777777778,
"system": 0.11931075111111111,
"min": 0.6607555197600001,
"max": 1.47029375076,
"times": [
0.6644494997600001,
0.8250157227600001,
0.8651762597600001,
0.6607555197600001,
0.7640990837600001,
0.9818196947600001,
0.8205187627600001,
1.47029375076,
0.7472247687600001
]
},
{
"command": "pnpm@HEAD",
"mean": 2.925284063093333,
"stddev": 0.0847740158188643,
"median": 2.90437598176,
"user": 4.4553515,
"system": 0.27200552888888885,
"min": 2.84503322076,
"max": 3.09729389876,
"times": [
2.99031246976,
2.8477475817599998,
2.89555541876,
2.84503322076,
3.09729389876,
2.98972340376,
2.9054222577599997,
2.90437598176,
2.85209233476
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.56252255364,
"stddev": 0.16354892326404413,
"median": 4.493079381339999,
"user": 1.7296951,
"system": 1.3849659199999997,
"min": 4.40765198284,
"max": 4.85073136684,
"times": [
4.63916219484,
4.80787465184,
4.51582137584,
4.46608148884,
4.41990393384,
4.85073136684,
4.40765198284,
4.47033738684,
4.63405661684,
4.41360453784
]
},
{
"command": "pacquet@main",
"mean": 4.50258510724,
"stddev": 0.10190281312266986,
"median": 4.45463471634,
"user": 1.7071852,
"system": 1.38453312,
"min": 4.40581291884,
"max": 4.69518503484,
"times": [
4.41056147084,
4.45911142284,
4.43552187984,
4.69518503484,
4.44444188084,
4.65150747484,
4.45015800984,
4.56413606884,
4.40581291884,
4.5094149108399995
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5201794368400003,
"stddev": 0.06097138547165428,
"median": 3.53180063884,
"user": 1.1716210999999999,
"system": 1.23380672,
"min": 3.44655112384,
"max": 3.60534492884,
"times": [
3.54974670284,
3.59283779984,
3.52740183884,
3.4478624178399997,
3.45149535384,
3.44655112384,
3.5361994388399998,
3.47545588484,
3.60534492884,
3.56889887884
]
},
{
"command": "pnpr@main",
"mean": 3.5728926288400005,
"stddev": 0.15710795727295107,
"median": 3.52243077484,
"user": 1.1651700000000003,
"system": 1.2310942199999997,
"min": 3.44680179984,
"max": 3.87470964584,
"times": [
3.84678742084,
3.44680179984,
3.57186821684,
3.52067346284,
3.47095498284,
3.5241880868399997,
3.46550513184,
3.46163552284,
3.87470964584,
3.54580201784
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13653 |
| 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,425.73 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 288.40 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 296.74 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.91 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,376.11 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,446.55 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 267.57 ms |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 33 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (2)
pnpm11/workspace/workspace-manifest-writer/src/index.ts:107
cleanupOutdatedMinimumReleaseAgeExcludescurrently runs after mergingaddedMinimumReleaseAgeExcludes, so entries added in the same write can be immediately pruned if they aren’t present inresolvedPackageVersions(this contradicts the intended “added entries survive” behavior and the Rust implementation/tests). Run the cleanup pass before mergingaddedMinimumReleaseAgeExcludes.
pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts:177- The test for “entries added in the same write survive the cleanup” only covers the case where the added entry is also present in
resolvedPackageVersions. Add a regression case where an added entry is not inresolvedPackageVersions(it should still be kept) to prevent reintroducing the ordering bug between cleanup and merge.
|
This configuration parameter is named with reference to |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 33 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (1)
pnpm11/lockfile/utils/test/resolvedPackageVersions.ts:46
resolvedPackageVersionsFromLockfile()relies on dep path parsing to handle registry-qualified keys (<name>@<registryName>:<version>). Since this is a new public helper that will drive workspace-manifest cleanup, it would be good to add a regression test that a registry-qualified dep path contributes the semver version (not an empty set / non-semver).
|
Is it possible to apply this to |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/cli/tests/suite/catalog.rs (1)
448-461: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAdd a Rust CLI case for
sharedWorkspaceLockfile: false.
catalog.rs::setup()creates a shared-workspace harness, and this test writes onlypnpm-workspace.yamlundercleanupOutdatedMinimumReleaseAgeExcludes: true. Add a real CLI test that setssharedWorkspaceLockfile: falseand verifies the same pruning behavior with per-project lockfiles.🤖 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/catalog.rs` around lines 448 - 461, Extend the catalog test coverage around setup() with a separate CLI case that configures sharedWorkspaceLockfile: false, uses per-project lockfiles, and verifies cleanupOutdatedMinimumReleaseAgeExcludes still preserves the listed catalog versions when adding the dependency. Keep the existing shared-workspace test unchanged and assert the resulting pruning behavior through the CLI.Sources: Path instructions, 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.
Nitpick comments:
In `@pnpm/crates/cli/tests/suite/catalog.rs`:
- Around line 448-461: Extend the catalog test coverage around setup() with a
separate CLI case that configures sharedWorkspaceLockfile: false, uses
per-project lockfiles, and verifies cleanupOutdatedMinimumReleaseAgeExcludes
still preserves the listed catalog versions when adding the dependency. Keep the
existing shared-workspace test unchanged and assert the resulting pruning
behavior through the CLI.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 8cc474ac-ac1a-4f9a-afbc-79a40cb7338b
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lock,!Cargo.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (31)
.changeset/cleanup-outdated-minimum-release-age-excludes.mdpnpm/crates/cli/tests/suite/catalog.rspnpm/crates/config/src/lib.rspnpm/crates/config/src/tests.rspnpm/crates/config/src/version_policy.rspnpm/crates/config/src/workspace_yaml.rspnpm/crates/deps-restorer/src/install_package_from_registry/tests.rspnpm/crates/package-manager/src/add.rspnpm/crates/package-manager/src/catalog_cleanup.rspnpm/crates/package-manager/src/catalog_cleanup/tests.rspnpm/crates/package-manager/src/remove.rspnpm/crates/package-manager/src/update.rspnpm/crates/workspace-manifest-writer/Cargo.tomlpnpm/crates/workspace-manifest-writer/src/edit.rspnpm/crates/workspace-manifest-writer/src/lib.rspnpm/crates/workspace-manifest-writer/src/tests.rspnpm11/config/reader/src/Config.tspnpm11/config/version-policy/src/index.tspnpm11/installing/commands/package.jsonpnpm11/installing/commands/src/installDeps.tspnpm11/installing/commands/src/recursive.tspnpm11/installing/commands/src/remove.tspnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.tspnpm11/installing/commands/tsconfig.jsonpnpm11/installing/deps-installer/src/install/extendInstallOptions.tspnpm11/installing/deps-installer/src/install/index.tspnpm11/lockfile/utils/src/index.tspnpm11/lockfile/utils/src/resolvedPackageVersions.tspnpm11/lockfile/utils/test/resolvedPackageVersions.tspnpm11/workspace/workspace-manifest-writer/src/index.tspnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
🚧 Files skipped from review as they are similar to previous changes (30)
- pnpm11/installing/commands/tsconfig.json
- pnpm11/installing/commands/package.json
- pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts
- pnpm/crates/deps-restorer/src/install_package_from_registry/tests.rs
- pnpm11/lockfile/utils/src/index.ts
- pnpm/crates/workspace-manifest-writer/Cargo.toml
- pnpm/crates/config/src/workspace_yaml.rs
- pnpm/crates/config/src/tests.rs
- pnpm11/lockfile/utils/src/resolvedPackageVersions.ts
- pnpm11/config/version-policy/src/index.ts
- pnpm11/installing/commands/src/remove.ts
- pnpm/crates/config/src/lib.rs
- pnpm/crates/package-manager/src/remove.rs
- .changeset/cleanup-outdated-minimum-release-age-excludes.md
- pnpm/crates/workspace-manifest-writer/src/tests.rs
- pnpm/crates/package-manager/src/update.rs
- pnpm11/workspace/workspace-manifest-writer/src/index.ts
- pnpm/crates/package-manager/src/catalog_cleanup/tests.rs
- pnpm11/lockfile/utils/test/resolvedPackageVersions.ts
- pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
- pnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.ts
- pnpm11/config/reader/src/Config.ts
- pnpm/crates/package-manager/src/add.rs
- pnpm/crates/workspace-manifest-writer/src/edit.rs
- pnpm11/installing/deps-installer/src/install/index.ts
- pnpm11/installing/commands/src/recursive.ts
- pnpm11/installing/commands/src/installDeps.ts
- pnpm/crates/config/src/version_policy.rs
- pnpm/crates/package-manager/src/catalog_cleanup.rs
- pnpm/crates/workspace-manifest-writer/src/lib.rs
- pacquet: register versions of registry-qualified lockfile snapshot keys so versioned exclusions for named-registry packages are not pruned - recursive (non-shared lockfile): pass undefined instead of an empty resolved-versions map when no install produced a new lockfile - writer: canonicalize narrowed version unions with mergePackageVersionSpecs
Matches the pacquet write order: entries approved during the same install are merged after pruning, so the cleanup pass can never prune an exclusion that was just added.
With `sharedWorkspaceLockfile: false` the install anchors the lockfile at the project directory, so the cleanup pass found no lockfile at the workspace dir and silently skipped. Read the lockfile from the directory the install actually wrote it to.
cleanupOutdatedMinimumReleaseAgeExcludes configminimumReleaseAgeExcludeCleanup config
minimumReleaseAgeExcludeCleanup configminimumReleaseAgeExcludePrune, rename cleanupUnusedCatalogs to catalogPrune
…nd `catalogPrune` Renames the new setting from `cleanupOutdatedMinimumReleaseAgeExcludes` to `minimumReleaseAgeExcludePrune`, so it sorts with the list it acts on the way `minimumReleaseAgeStrict`, `minimumReleaseAgeIgnoreMissingTime` and `trustPolicyIgnoreAfter` sort with their families. "Outdated" was also the wrong adjective: it reads as `pnpm outdated`, or as the release-age ageing rule this pass does not implement. Renames `cleanupUnusedCatalogs` to `catalogPrune` for the same reason, so both settings name the same operation with the verb pnpm already uses in `pnpm prune` and `pnpm store prune`. It is singular because the pass prunes the `catalog:` block as well as `catalogs:`, exactly as `catalogMode` governs both. The former name stays accepted: pacquet applies it just before the `apply!` macro, and the TypeScript reader folds it with `catalogPrune ??= cleanupUnusedCatalogs`, so the canonical key wins when a file carries both. No warning is emitted — it is an alias, not a deprecation. Two fixes to the pass itself: Require a lockfile that covers every project `minimumReleaseAgeExclude` governs. Under `sharedWorkspaceLockfile: false` the install anchors a lockfile per project, so every entry a sibling project needs looked unresolved and was deleted — a workspace could lose its whole exclude list to one `pnpm add`. The pass now no-ops there, as it already did for `lockfile: false` and for an install that resolved no new lockfile. That also makes the per-project accumulation in `recursive.ts` dead, so the `newLockfile` plumbing through its action results goes away with it. Drop the writer's `cleanup_outdated_minimum_release_age_excludes` flag. The resolved-versions map already decides whether the pass runs, and every caller derived both from the same setting, so the pair could only ever disagree by mistake. The same simplification removes pacquet's unused `added_minimum_release_age_excludes` option, its `VersionPolicy` error variant and the `add_minimum_release_age_excludes` edit: pacquet writes approved exclusions through `minimum_release_age::persist_and_report_excludes` during the install, which already precedes the post-install prune. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
41ee153 to
9190f05
Compare
Code Review by Qodo
1. Historical comment phrasing added
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Ah, this PR only removes entries that package versions corresponding to are no longer included in the project(s). Sorry for having bothered you. |
|
@zkochan Should we also include these two configurations in version 10? |
Summary
Adds an opt-in setting
minimumReleaseAgeExcludePrune. When it is on, thecommands that persist
pnpm-workspace.yaml—pnpm add,pnpm update,pnpm remove— prune theminimumReleaseAgeExcludeentries that the freshlywritten lockfile no longer resolves, so the list stops growing forever as
pnpm audit --fixkeeps appending to it.Per entry:
away once none of its versions remain (a narrowed union is rewritten
canonically, semver-sorted and
||-joined);@scope/*) is always kept — it is forward-looking and cannever be proven stale;
break an install.
The pass may only drop an entry it can prove nothing resolves, so it needs a
lockfile covering every project the setting governs. It is therefore skipped
when the lockfile is not the workspace-shared one
(
sharedWorkspaceLockfile: false), whenlockfile: falsemakes the on-disklockfile stale, and when the install resolved no new lockfile at all (a frozen
install, or resolution delegated to the pnpr server) — passing an empty set of
resolved versions there would prune every entry.
This is a partial fix: it removes entries that nothing installs anymore, not
entries whose version has since aged past
minimumReleaseAge. That secondrule can later become a value of this same setting.
Also renames
cleanupUnusedCatalogstocatalogPrune, so the two pruningsettings share one vocabulary —
pnpm pruneandpnpm store prunealready usethat verb, as do git's
fetch.pruneandgc.prune.cleanupUnusedCatalogskeeps working; when a file carries both,
catalogPrunewins.Related to #11668
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.
PR description 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
New Features
cleanupOutdatedMinimumReleaseAgeExcludesworkspace setting.add,update, andremoveautomatically remove staleminimumReleaseAgeExcludeentries based on resolved package versions.Documentation