Repository navigation
feat(update): name the workspace projects each interactive row came from - #13337
Conversation
Inside a workspace the interactive update list showed no way to tell which project an outdated dependency belonged to, so the same package outdated in two projects rendered as two indistinguishable rows. Every outdated entry now records the name of the project it was collected from, and the interactive list gains the `Workspace` column upstream shows when workspaces are enabled. The name is read where the collector already has the manifest in hand, so nothing new is threaded through; it is stripped of control characters with the rest of the row. This completes the interactive parity item of #12101, whose remaining half after the grouping landed was this column. Related to #12101.
|
Warning Review limit reached
Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthrough
ChangesWorkspace-aware outdated data
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant WorkspaceProject
participant OutdatedCollector
participant InteractiveUpdater
participant ChoiceRenderer
WorkspaceProject->>OutdatedCollector: provide manifest name or importer path
OutdatedCollector->>InteractiveUpdater: attach workspace to outdated package
InteractiveUpdater->>ChoiceRenderer: pass deduplicated choices and workspace sets
ChoiceRenderer-->>InteractiveUpdater: render optional Workspace column
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 |
PR Summary by QodoAdd Workspace column to interactive update list
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (6): Last reviewed commit: "perf(update): key the choice deduplicati..." | 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 #13337 +/- ##
==========================================
+ Coverage 87.02% 87.04% +0.02%
==========================================
Files 532 535 +3
Lines 91642 91853 +211
==========================================
+ Hits 79750 79956 +206
- Misses 11892 11897 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Triage of the Qodo findings — none changing, reasons below. 1. Workspace rows deduped away — same as Greptile's P1; answered in detail on that thread. Short version: upstream's deduplication key is 2. Workspace name cloned per entry — one short 3. Changeset missing Greptile has withdrawn its second finding (the blank cell for unnamed projects) on the same match-upstream grounds. Written by an agent (Claude Code, claude-opus-5). |
Two ways the column named a project poorly, both fixed in each stack since the column exists in both. A dependency outdated at the same version in several workspace projects collapses into one choice, because selecting it updates the package in every project. The surviving row named whichever project was seen first, reading as though only that one was affected. The collapsed entries now contribute their projects to the row, which lists them. A workspace project is not required to declare a `name`, and the column took the name verbatim, so such a project got an empty cell and several of them were indistinguishable. The label now falls back to the path that identifies the project in the lockfile. Raised in review of #13337.
|
Thanks — "Workspace rows deduped away" is marked resolved, which matches the fix in 13f5681 (the row still collapses, but now names every project it covers). The remaining two stand as answered earlier:
Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 13f5681 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/cli/src/cli_args/update_interactive/tests.rs`:
- Around line 72-77: Extend the test around the interactive choices’ Workspace
assertions to include an importer whose manifest omits the name field, using an
importer ID such as “packages-a”. Verify that its workspace value falls back to
the importer_id while preserving the existing named-manifest expectations for
the other entry.
🪄 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: c23c3964-f26c-4f3d-996e-a93d0ecd58e8
📒 Files selected for processing (11)
.changeset/interactive-update-workspace-column.md.changeset/interactive-update-workspace-labels.mdpnpm/crates/cli/src/cli_args/outdated.rspnpm/crates/cli/src/cli_args/outdated/tests.rspnpm/crates/cli/src/cli_args/update_interactive.rspnpm/crates/cli/src/cli_args/update_interactive/choices.rspnpm/crates/cli/src/cli_args/update_interactive/choices/tests.rspnpm/crates/cli/src/cli_args/update_interactive/tests.rspnpm11/deps/inspection/outdated/src/outdated.tspnpm11/installing/commands/src/update/getUpdateChoices.tspnpm11/installing/commands/test/update/getUpdateChoices.test.ts
|
Found 1 test failure on Blacksmith runners: Failure
|
…hem all `update_choices` merges the workspaces of entries that collapse into one row, but `collect_choices` deduplicated before it without considering the workspace, so in a recursive interactive update the second project's entry was already gone and the row could only ever name the first. Its key now includes the workspace. `one_dependency_in_two_projects_keeps_both_workspaces` covers the whole path rather than `update_choices` alone, which is what let the gap through, and `a_nameless_project_is_labelled_with_its_importer_path` covers the fallback. On the TypeScript side, the labels the table renders are read out of manifests and registry metadata and went in verbatim, so a crafted workspace name or homepage could emit escape sequences into the prompt or a newline that splits a row — the same exposure already closed on the Rust side. They now go through a cell sanitizer; the colorized target is left alone, since its escapes are deliberate.
Rename the two fixture manifests off single-letter bindings, which the `perfectionist::single-letter-let-binding` rule rejects — the rename was made but never committed, so CI caught what the pre-push hook had already flagged locally. Also key the choice deduplication on borrowed names: the outdated set outlives the map, so the alias and package name need not be cloned.
…rom (pnpm#13337) Inside a workspace the interactive update list showed no way to tell which project an outdated dependency belonged to, so the same package outdated in two projects rendered as two indistinguishable rows. Every outdated entry now records the name of the project it was collected from, and the interactive list gains the `Workspace` column upstream shows when workspaces are enabled. The name is read where the collector already has the manifest in hand, so nothing new is threaded through; it is stripped of control characters with the rest of the row. This completes the interactive parity item of pnpm#12101, whose remaining half after the grouping landed was this column. Related to pnpm#12101.
) The `Workspace` column falls back to the project's lockfile path when a workspace project declares no `name` or an empty one, because either renders a blank label. A name of `" "` is truthy and non-empty, so it slipped past that guard and rendered just as blank. Both stacks now trim before deciding, and the fallback tests cover the absent, empty, and whitespace-only shapes together. Follow-up to pnpm#13337, which landed the column and the first two shapes.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light.png)
Summary
The remaining half of the interactive parity item in #12101. #13298 grouped the list by dependency type; this adds the
Workspacecolumn upstream shows when workspaces are enabled.Inside a workspace the list gave no way to tell which project an outdated dependency belonged to, so the same package outdated in two projects rendered as two indistinguishable rows. Every outdated entry now records the name of the project it was collected from:
The column is present only when workspaces are enabled, matching upstream's
workspacesEnabledgate — the recursive entry point always runs inside one, the single-project entry point asksconfig.workspace_dir.The name is read where
collect_outdated_for_importeralready has the manifest in hand, so no new parameter is threaded through, and it goes throughsanitize_inlinewith the rest of the row.Tests cover the column's presence and absence, that it names the right project per row, and — on the existing collector test, which already builds two fixture projects — that the field is actually populated end to end rather than only rendered.
Also in this PR: two label fixes, in both stacks
Review raised two ways the column named a project poorly. Both were true of the TypeScript CLI as well, so both are fixed on each side rather than letting pacquet diverge.
A collapsed row named only one project. A dependency outdated at the same version in several projects is offered as a single choice, because selecting it updates the package in every one of them — that is how both stacks resolve the selection, which is a flat list of package names. The surviving row named whichever project was seen first, reading as though only that one was affected. Collapsed entries now contribute their projects to the row:
An unnamed project got a blank cell. A workspace project need not declare a
name, and both stacks took the name verbatim, so such a project rendered as an empty cell and several were indistinguishable. The label now falls back to the path that identifies the project in the lockfile — which pnpm already computes asimporterId, and pacquet already has asimporter_id.The column itself remains a pacquet-only addition; the TypeScript CLI already had it.
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).
Summary by CodeRabbit