Repository navigation
Conversation
|
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:
📝 WalkthroughWalkthroughCompatible catalog and dependency range changes now update lockfile specifiers while retaining locked versions when semver checks pass. TypeScript and Rust install paths validate candidates, preserve referenced snapshots, remove stale ones, and fall back to resolution when reuse is unsupported. ChangesLockfile fast-update reuse
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ProjectInstall
participant FastUpdateCoordinator
participant CatalogOrImporterUpdater
participant LockfileVerifier
participant Resolver
ProjectInstall->>FastUpdateCoordinator: detect compatible lockfile change
FastUpdateCoordinator->>CatalogOrImporterUpdater: update candidate specifiers
CatalogOrImporterUpdater-->>FastUpdateCoordinator: updated candidate or rejection
FastUpdateCoordinator->>LockfileVerifier: validate candidate
LockfileVerifier-->>FastUpdateCoordinator: validation result
FastUpdateCoordinator->>Resolver: reuse locked resolution when valid
Resolver-->>ProjectInstall: complete install without re-resolution
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoReuse lockfiles for compatible catalog range changes
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Confidence Score: 3/5The PR is not yet safe to merge because catalog cleanup can still remove a snapshot referenced through When the default catalog remains present but a referenced alias is removed, preliminary validation succeeds against the existing snapshot; cleanup then compares the importer only with Files Needing Attention: pnpm/crates/package-manager/src/fast_update_catalogs.rs Reviews (6): Last reviewed commit: "test: cover forced resolution after fast..." | Re-trigger Greptile |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. TypeScript lacks refresh-hook parity test
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
|
Code review by qodo was updated up to the latest commit 078e10b |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/deps-installer/src/install/index.ts`:
- Around line 718-780: The fast-update flow must not clear locked drift when
both catalogs and overrides changed. Update the logic around onlyChangedSetting,
outdatedLockfileSettingName, and the tryFastUpdateLockfile callback to detect
simultaneous catalog and override changes, then either apply both
tryFastUpdateCatalogs and tryFastUpdateOverrides updates with validation or
bypass the fast path so full resolution handles the changes.
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts`:
- Around line 12-19: Update tryFastUpdateLockfile so failures from
opts.verifyLockfile?.(candidate) are caught and treated as candidate rollback by
returning false only for the known verification error codes raised by
verifyLockfileResolutions; rethrow all other errors. Keep candidate assignment
to lockfile and the existing update/isLockfileUpToDate failure behavior
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1893f020-8c46-4fdc-b2d5-c7c315aa0fb4
📒 Files selected for processing (10)
.changeset/fast-catalog-ranges.mdpnpm/crates/cli/tests/lockfile_resolution_reuse.rspnpm/crates/package-manager/src/fast_update_catalogs.rspnpm/crates/package-manager/src/fast_update_catalogs/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/lib.rspnpm11/installing/deps-installer/src/install/index.tspnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.tspnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.tspnpm11/installing/deps-installer/test/install/catalogFastUpdate.ts
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13477 +/- ##
==========================================
+ Coverage 87.74% 87.76% +0.02%
==========================================
Files 547 549 +2
Lines 95265 95452 +187
==========================================
+ Hits 83589 83777 +188
+ Misses 11676 11675 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code review by qodo was updated up to the latest commit 9cbcad5 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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 (2)
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.ts (1)
39-47: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winForce fallback when any catalog snapshot is incompatible.
An invalid or incompatible entry is retained and processing continues. If another entry is compatible,
changedbecomes true and the function returns true, skipping resolution while the incompatible entry remains locked to its old range/version. Track validation failure and returnfalsebefore assigninglockfile.catalogs; add a mixed-entry regression case. As per path instructions, “incompatible/ambiguous cases must fall back.”🤖 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/installing/deps-installer/src/install/tryFastUpdateCatalogs.ts` around lines 39 - 47, Update the catalog snapshot validation flow around semver.valid, semver.validRange, and semver.satisfies so any invalid or incompatible entry marks the overall operation as needing fallback. Before assigning lockfile.catalogs, return false whenever such a validation failure occurred, even if another entry set changed to true; add a regression case covering mixed compatible and incompatible entries.Source: Path instructions
pnpm/crates/cli/tests/lockfile_resolution_reuse.rs (1)
130-137: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAssert that the catalog update skipped resolution.
This test can pass after a fresh resolve that reuses the same locked version. Capture the command result and assert the same “resolution step is skipped” signal used by the importer-range test.
Proposed fix
-pacquet_at(&workspace).with_arg("install").assert().success(); +let assert = pacquet_at(&workspace).with_arg("install").assert().success(); +assert!( + String::from_utf8_lossy(&assert.get_output().stdout) + .contains("Lockfile is up to date, resolution step is skipped"), +);As per path instructions, regression tests must prove whether resolution requests are skipped or triggered.
🤖 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/lockfile_resolution_reuse.rs` around lines 130 - 137, Update the test around the install invocation in the lockfile reuse scenario to capture the command result, then assert the established “resolution step skipped” signal used by the importer-range test. Keep the existing catalog entry assertions, ensuring the regression test verifies resolution was skipped rather than merely observing the reused version.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 `@pnpm/crates/package-manager/src/install.rs`:
- Around line 2502-2508: Restrict the save branch containing
lockfile_synthesized_from_current, lockfile_was_fast_updated, and
updated.save_to_path to executions that remain on the frozen path, such as by
requiring take_frozen_path. Do not save the speculative lockfile candidate when
checksum updates or a custom resolver force normal resolution; allow the fresh
resolver to persist its own result.
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts`:
- Around line 28-46: The tryFastUpdateImporters flow currently mutates
importer.specifiers before all aliases validate, so a later failure leaves
partial changes. In
pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts:28-46,
stage compatible updates separately and apply them only after every project and
alias succeeds; failed validation must leave the lockfile unchanged. In
pnpm11/installing/deps-installer/test/install/catalogFastUpdate.ts:44-68, add a
compatible alias followed by an incompatible alias and assert both original
specifiers remain unchanged.
---
Outside diff comments:
In `@pnpm/crates/cli/tests/lockfile_resolution_reuse.rs`:
- Around line 130-137: Update the test around the install invocation in the
lockfile reuse scenario to capture the command result, then assert the
established “resolution step skipped” signal used by the importer-range test.
Keep the existing catalog entry assertions, ensuring the regression test
verifies resolution was skipped rather than merely observing the reused version.
In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.ts`:
- Around line 39-47: Update the catalog snapshot validation flow around
semver.valid, semver.validRange, and semver.satisfies so any invalid or
incompatible entry marks the overall operation as needing fallback. Before
assigning lockfile.catalogs, return false whenever such a validation failure
occurred, even if another entry set changed to true; add a regression case
covering mixed compatible and incompatible entries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: efe5db53-8970-4a44-9fbf-a750d308e9b6
📒 Files selected for processing (12)
.changeset/fast-catalog-ranges.mdpnpm/crates/cli/tests/lockfile_resolution_reuse.rspnpm/crates/package-manager/src/fast_update_catalogs.rspnpm/crates/package-manager/src/fast_update_catalogs/tests.rspnpm/crates/package-manager/src/fast_update_importers.rspnpm/crates/package-manager/src/fast_update_importers/tests.rspnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/lib.rspnpm11/installing/deps-installer/src/install/index.tspnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.tspnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.tspnpm11/installing/deps-installer/test/install/catalogFastUpdate.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- .changeset/fast-catalog-ranges.md
- pnpm/crates/package-manager/src/fast_update_catalogs/tests.rs
- pnpm11/installing/deps-installer/src/install/index.ts
Summary
dependencies,devDependencies, andoptionalDependencies; retain the normal resolution fallback for incompatible ranges, non-semver specs, dependency-group changes, and other resolution-sensitive edits.This implements the first conservative dependency-range optimizations from pnpm/pnpm#13474. The broader fast-path roadmap remains a design task.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Codex, GPT-5).
Summary by CodeRabbit