Repository navigation
fix(lockfile.verification): reuse local dependency walks per importer - #17375
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Reuse checker state pnpm11/lockfile/verification/src/localDirectoryDepIsUpToDate.ts |
A checker factory retains visited-snapshot and recorded-peer state across checks. |
Share the checker across project dependencies pnpm11/lockfile/verification/src/linkedPackagesAreUpToDate.ts, pnpm11/lockfile/verification/test/allProjectsAreUpToDate.test.ts, .changeset/quiet-lizards-travel.md |
The project check creates one checker and passes it to local-directory dependency checks. A regression test confirms that the read count for a shared dependency’s dependencies property is the same through one route and two routes, and is greater than zero. The changeset declares patch releases. |
Priority:
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant ProjectCheck
participant DependencyCheck
participant LocalDirectoryChecker
ProjectCheck->>DependencyCheck: check project dependencies with shared context
DependencyCheck->>LocalDirectoryChecker: check snapshot and dependency aliases
LocalDirectoryChecker-->>DependencyCheck: return up-to-date result
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Reuse verification state across shared local-directory subgraphs to reduce repeated traversal [#17374] |
✅ | |
Preserve transitive freshness, cycles, and peer-scope correctness while sharing traversal state [#17374] |
❓ | The change shares visited-snapshot state and recorded peers, but the supplied test summary does not show separate coverage for freshness, cycles, or peer-scope correctness. |
Possibly related issues
- pnpm/pnpm#17374: The change shares verification state across direct dependencies to avoid repeated walks of shared local-directory subgraphs.
Suggested labels: product: pnpm@11
Suggested reviewers: charan-rathore
Merge Risk: 
Minimal · up to becb4
-
The shared-directory verification change is ready to merge after normal checks.
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
🔧 ESLint
-
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.
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 @coderabbitai help to get the list of available commands.
|
Execution Profiles recorded for 1 job, triggered by
|
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? |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
52e2ac4 to
85a5562
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
…tory check The importer check now creates a checker per project, so the single-call wrapper had no callers left. Its contract moves to the checker factory, which also documents that its checks share visited snapshots. Reword the changeset. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…rect dependency The regression test asserted a fixed count of `dependencies` reads, which depends on how often one walk reads the manifest. It now asserts that two direct dependencies sharing a directory read it as often as one does. The changeset no longer claims one check per project, since the walk deduplicates per peer scope. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Code review by qodo was updated up to the latest commit 6977517 |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@coderabbitai review Written by an agent (Claude Code, claude-opus-5-5). |
|
Code review by qodo was updated up to the latest commit becb466 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
|
Review-and-fix pass complete. Head: becb466. Changes pushed
Qodo summary-only finding 3 (no timing numbers): addressed. The PR description now has before/after timings from the issue's repro. Repeat install went from ~1.75s to ~0.37s, frozen install from ~1.0s to ~0.35s, and the lockfile stayed unchanged. Review status
No remaining work within scope. pnpm v12 is unaffected, as the issue reports. Written by an agent (Claude Code, claude-opus-5-5). |
Summary
Closes #17374.
The v11 lockfile check walked each direct
file:dependency's local directory subtree with a fresh visited map. A project whose direct local dependencies share transitive local directories (the issue's 5×40 DAG) re-walked the shared graph once per direct dependency. The check now creates one checker per importer, so all of an importer's direct local dependencies share the visited snapshots and peer scopes.pnpm v12 is not affected (see the issue), so this is a v11-only fix.
The checker collects the lockfile's recorded peers on its first check, so a project with no local directory dependency pays nothing extra.
Measurements
The issue's
compact-repro.mjs(200file:packages, 5 levels × 40), Node 24, Linux. Same bundle, three runs each. The baseline patches the shared map back to a fresh one per direct dependency.The lockfile stayed unchanged in every run.
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.
Description updated by an agent (Claude Code, claude-opus-5-5).
Summary by CodeRabbit