Repository navigation
Conversation
|
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 ignored due to path filters (1)
📒 Files selected for processing (30)
🚧 Files skipped from review as they are similar to previous changes (27)
📝 WalkthroughWalkthroughAdds ChangesWorkspace-aware update flow
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
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 |
PR Summary by QodoSupport pacquet
AI Description
Diagram
High-Level Assessment
Files changed (31)
|
Confidence Score: 5/5The PR appears safe to merge because no blocking failure related to the prior lifecycle threads remains. No blocking failure remains. Reviews (6): Last reviewed commit: "refactor(update): extract the --workspac..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13288 +/- ##
==========================================
+ Coverage 86.96% 86.98% +0.01%
==========================================
Files 530 530
Lines 90954 91171 +217
==========================================
+ Hits 79099 79303 +204
- Misses 11855 11868 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks — triage of the Qodo findings: Fixed
Not changing, with reasons
Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit a93a226 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Code review by qodo was updated up to the latest commit 105904d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pnpm11/installing/commands/src/installDeps.ts (1)
399-410: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the duplicated
userNamedDeps-gated workspace-selector branch into a shared helper. The same "expand-from-manifest when nothing was named, else rewrite withskipPackagesOutsideWorkspace: !userNamedDeps" logic is now copy-pasted three times, and this PR adds a new parameter that all three copies must keep in sync going forward.
pnpm11/installing/commands/src/installDeps.ts#L399-L410: replace this branch with a call to a new shared helper, e.g.resolveWorkspaceSelectors(params, userNamedDeps, manifest, includeDirect, workspacePackages)exported fromupdateWorkspaceDependencies.ts.pnpm11/installing/commands/src/recursive.ts#L279-L287: replace this branch (shared-lockfile path) with the same shared helper call.pnpm11/installing/commands/src/recursive.ts#L409-L417: replace this branch (per-project path) with the same shared helper call.♻️ Proposed shared helper
+// updateWorkspaceDependencies.ts +export function resolveWorkspaceSelectors ( + currentInput: string[], + userNamedDeps: boolean, + manifest: ProjectManifest, + includeDirect: IncludedDependencies, + workspacePackages: WorkspacePackages +): string[] { + if (!currentInput || currentInput.length === 0) { + return userNamedDeps ? currentInput : updateToWorkspacePackagesFromManifest(manifest, includeDirect, workspacePackages) + } + return createWorkspaceSpecs(currentInput, workspacePackages, { skipPackagesOutsideWorkspace: !userNamedDeps }) +}🤖 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/commands/src/installDeps.ts` around lines 399 - 410, Extract the duplicated workspace-selector resolution into an exported helper such as resolveWorkspaceSelectors in updateWorkspaceDependencies.ts, preserving the userNamedDeps behavior: expand from the manifest when no selectors were named, otherwise call createWorkspaceSpecs with skipPackagesOutsideWorkspace set to !userNamedDeps. Replace the three duplicated branches in pnpm11/installing/commands/src/installDeps.ts lines 399-410, pnpm11/installing/commands/src/recursive.ts lines 279-287, and pnpm11/installing/commands/src/recursive.ts lines 409-417 with calls to this helper, passing the existing params, userNamedDeps, manifest, includeDirect, and workspacePackages values.
🤖 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/test/update/update.ts`:
- Around line 228-251: Update the test case around preparePackages and
update.handler so updateConfig.ignoreDependencies targets the declared
`@pnpm.e2e/foo` dependency instead of the undeclared bar pattern. Add assertions
verifying foo remains unchanged while project-2 is linked, ensuring the
regression test covers both ignored registry and workspace dependency behavior.
---
Nitpick comments:
In `@pnpm11/installing/commands/src/installDeps.ts`:
- Around line 399-410: Extract the duplicated workspace-selector resolution into
an exported helper such as resolveWorkspaceSelectors in
updateWorkspaceDependencies.ts, preserving the userNamedDeps behavior: expand
from the manifest when no selectors were named, otherwise call
createWorkspaceSpecs with skipPackagesOutsideWorkspace set to !userNamedDeps.
Replace the three duplicated branches in
pnpm11/installing/commands/src/installDeps.ts lines 399-410,
pnpm11/installing/commands/src/recursive.ts lines 279-287, and
pnpm11/installing/commands/src/recursive.ts lines 409-417 with calls to this
helper, passing the existing params, userNamedDeps, manifest, includeDirect, and
workspacePackages values.
🪄 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: 47a0ec31-2e79-431d-a46e-82886100eb6a
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!Cargo.lock
📒 Files selected for processing (30)
.changeset/pacquet-update-workspace-and-depth.md.changeset/update-workspace-only-links-named-deps.mdpnpm/crates/cli/src/cli_args/audit.rspnpm/crates/cli/src/cli_args/dedupe.rspnpm/crates/cli/src/cli_args/import.rspnpm/crates/cli/src/cli_args/update.rspnpm/crates/cli/src/cli_args/update/tests.rspnpm/crates/cli/tests/update.rspnpm/crates/config/src/lib.rspnpm/crates/config/src/pnpm_default_parity.rspnpm/crates/config/src/workspace_yaml.rspnpm/crates/napi/src/install.rspnpm/crates/package-manager/Cargo.tomlpnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/install/tests.rspnpm/crates/package-manager/src/install_package_from_registry/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile/tests.rspnpm/crates/package-manager/src/update.rspnpm/crates/package-manager/src/update/tests.rspnpm/crates/resolving-deps-resolver/src/lib.rspnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rspnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspnpm11/installing/commands/src/installDeps.tspnpm11/installing/commands/src/recursive.tspnpm11/installing/commands/src/updateWorkspaceDependencies.tspnpm11/installing/commands/test/update/update.tspnpm11/installing/commands/test/updateWorkspaceDependencies.test.ts
This comment has been minimized.
This comment has been minimized.
|
The
CI is re-running on fec1d27 anyway; I'll follow up if it reproduces. Written by an agent (Claude Code, claude-opus-5). |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pnpm11/installing/commands/src/recursive.ts (1)
229-232: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftPreserve selector intent instead of using
params.length.A wildcard or mixed selector is treated as an explicitly named dependency. After matching, a registry dependency selected by
*reachescreateWorkspaceSpecs()with skipping disabled and throws instead of remaining unchanged. The same boolean also makes an ignored-only importer expand back to all workspace dependencies in the shared-lockfile path when--depth > 0.
pnpm11/installing/commands/src/recursive.ts#L229-L232: retain whether each match came from a literal package selector, pattern selector, or ignore filtering.pnpm11/installing/commands/src/updateWorkspaceDependencies.ts#L40-L44: require workspace presence only for literal-selector matches; keep empty-after-ignore distinct from “update all workspace dependencies.”Add focused regressions for wildcard/mixed selectors containing registry dependencies and an ignored-only importer with shared lockfile plus positive depth. As per path instructions, user-visible behavior must retain parity and changed behavior needs regression coverage.
🤖 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/commands/src/recursive.ts` around lines 229 - 232, Preserve selector provenance instead of deriving intent from params.length: in pnpm11/installing/commands/src/recursive.ts:229-232, retain whether each match came from a literal selector, pattern/wildcard selector, or ignore filtering before calling createWorkspaceSpecs(). In pnpm11/installing/commands/src/updateWorkspaceDependencies.ts:40-44, require workspace presence only for literal-selector matches and keep an empty-after-ignore result distinct from updating all workspace dependencies. Add regressions for wildcard/mixed selectors containing registry dependencies and ignored-only importers with shared lockfiles and positive depth.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.
Outside diff comments:
In `@pnpm11/installing/commands/src/recursive.ts`:
- Around line 229-232: Preserve selector provenance instead of deriving intent
from params.length: in pnpm11/installing/commands/src/recursive.ts:229-232,
retain whether each match came from a literal selector, pattern/wildcard
selector, or ignore filtering before calling createWorkspaceSpecs(). In
pnpm11/installing/commands/src/updateWorkspaceDependencies.ts:40-44, require
workspace presence only for literal-selector matches and keep an
empty-after-ignore result distinct from updating all workspace dependencies. Add
regressions for wildcard/mixed selectors containing registry dependencies and
ignored-only importers with shared lockfiles and positive depth.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1823c3d2-1926-4f43-8035-6cc73c0a9409
📒 Files selected for processing (4)
pnpm11/installing/commands/src/installDeps.tspnpm11/installing/commands/src/recursive.tspnpm11/installing/commands/src/updateWorkspaceDependencies.tspnpm11/installing/commands/test/update/update.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- pnpm11/installing/commands/test/update/update.ts
- pnpm11/installing/commands/src/installDeps.ts
Summary
Two of the gaps tracked in #12101 — pacquet's
pnpm update --workspaceand per-dependency--depth— plus the two TypeScript--workspacebugs that stood in the way of making the stacks agree.--workspace(pacquet). A workspace-link update rewrites each matched direct dependency to aworkspace:specifier before the install resolves it, so the existingworkspace:resolver produces the link and its errors (ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACEand friends). Which dependencies are matched follows the TypeScript CLI: with no selectors, every direct dependency (minusupdateConfig.ignoreDependencies) that a workspace project publishes; with selectors, the direct dependencies they match, where naming one the workspace does not publish fails withERR_PNPM_WORKSPACE_PACKAGE_NOT_FOUND.--latestand running outside a workspace are rejected up front with the same codes the TypeScript CLI uses.The written specifier reproduces
calcSpecifierForWorkspaceDep: undersaveWorkspaceProtocol: 'rolling'(the default) the declared range operator is written alone (workspace:*/^/~), otherwise the linked version is written under that operator.saveWorkspaceProtocoltherefore joins pacquet's config and leaves the not-ported list inpnpm_default_parity.--depth(pacquet). The flag was only consulted as a> 0predicate gating the name matcher, so a compatible bump always behaved asdepth = Infinity.UpdateDepthnow travels with the seed policy into the resolver and gates reuse per node, matching pnpm'scurrentDepth <= updateDepth: a node past the ceiling keeps its locked resolution even when its name is an update target.--workspacefixes (TypeScript). Two cases linked dependencies the user never named. Both come fromparamsbeing rewritten into the matched dependency names before the workspace block reads it, so the block could no longer tell "the user named nothing" from "the user's selectors matched nothing":updateConfig.ignoreDependenciesset,paramsbecomes the non-ignored dependency names, andcreateWorkspaceSpecsthen threwERR_PNPM_WORKSPACE_PACKAGE_NOT_FOUNDfor the project's ordinary registry dependencies — sopnpm update --workspacecould not be run at all in a workspace that ignores any dependency.paramsempty, which read as "no selectors given" and answered by linking every workspace dependency.Both now key off whether the user named any package.
Related to #12101 —
--global, the recursive sibling-manifest rewrite, and full interactive parity are still open there.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 (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
save-workspace-protocol(off/on/rolling) support and honored it from workspace configuration.pnpm update --workspaceto link only explicitly targeted workspace deps, preserve non-targeted registry specs, avoid errors when dependencies are ignored, and handle unmatched selectors without modifyingpackage.json.--workspaceusage (including rejecting--workspacewith--latest) and clearer missing-workspace errors.pnpm update --depthso depth limits apply per dependency, with correct--depth 0behavior.--workspaceand--depth 0, including new negative cases.