Skip to content

fix(pacquet-cli): align outdated table borders when output is colorized - #13227

Merged
zkochan merged 5 commits into
mainfrom
fix-outdated-output
Jul 23, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix-outdated-output

Conversation

@zkochan

@zkochan zkochan commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Summary

pnpm outdated renders a misaligned table on a terminal: the columns and box-drawing borders drift out of alignment, producing what looks like a spurious empty column.

The report is rendered (in the Rust pnpm/ port) with the tabled crate, whose ANSI-handling (ansi) feature is not enabled by default. When the output goes to a TTY the cells are colorized — the blue headers, the green/yellow/red highlighted segment of the Latest version, and the dim (dev) / (github action) labels — and without the feature tabled counts the invisible color-escape bytes toward each cell's width. Because different cells carry different amounts of escape codes, columns get padded inconsistently and the borders no longer line up.

Enabling tabled's ansi feature makes it measure width by display columns, ignoring SGR escapes. This also corrects the outdated --long, recursive, licenses, and audit tables, which share the crate.

The TypeScript CLI is not affected: it renders with @zkochan/table, which is already ANSI-width-aware (verified directly — colored cells still produce equal-width, aligned rows). So this is a Rust-only fix; there is no counterpart change to make on the TS side.

Squash Commit Body

pacquet renders the `pnpm outdated` report with the `tabled` crate, whose
ANSI-handling (`ansi`) feature is not enabled by default. On a terminal the
cells are colorized (blue headers, green/yellow/red `Latest` version segments,
dim `(dev)`/`(github action)` labels), and without the feature `tabled` counts
the invisible color-escape bytes toward each cell's width. Cells carry
different amounts of escape codes, so columns were padded inconsistently and
the box-drawing borders drifted out of alignment.

Enable the `tabled` `ansi` feature so widths are measured by display columns,
ignoring SGR escapes. This also corrects the `outdated --long`, recursive,
`licenses`, and `audit` tables, which share the crate.

The TypeScript CLI is unaffected: it renders with `@zkochan/table`, which is
already ANSI-width-aware, so this is a Rust-only fix.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting. (Rust-only bug; the TS CLI is already correct — see Summary.)
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, claude-opus-4-8).


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed table border misalignment and drifting column widths in pnpm outdated when ANSI-colored output is enabled.
    • Ensured borders remain correctly aligned in both the standard and recursive table displays under colored output.
  • Tests

    • Added ANSI-aware assertions to confirm vertical border columns stay consistent across rows with styled/colored table cells.

zkochan and others added 2 commits July 23, 2026 11:13
pacquet renders the `pnpm outdated` report with the `tabled` crate, whose
ANSI-handling (`ansi`) feature is not enabled by default. On a terminal the
cells are colorized (blue headers, green/yellow/red `Latest` version segments,
dim `(dev)`/`(github action)` labels), and without the feature `tabled` counts
the invisible color-escape bytes toward each cell's width. Cells carry
different amounts of escape codes, so columns were padded inconsistently and
the box-drawing borders drifted out of alignment.

Enable the `tabled` `ansi` feature so widths are measured by display columns,
ignoring SGR escapes. This also corrects the `outdated --long`, recursive,
`licenses`, and `audit` tables, which share the crate.

The TypeScript CLI is unaffected: it renders with `@zkochan/table`, which is
already ANSI-width-aware, so this is a Rust-only fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Satisfy the `perfectionist::macro-trailing-comma` dylint rule for the
multi-line `assert!` in the colored-table alignment regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Enables ANSI support for tabled, adds visible-width border checks for colored output, tests ANSI-styled outdated tables, and documents the alignment fix.

Changes

Outdated table ANSI alignment

Layer / File(s) Summary
ANSI-aware table rendering validation
Cargo.toml, pnpm/crates/cli/src/cli_args/outdated/tests.rs, .changeset/outdated-table-ansi-alignment.md
Enables tabled’s ansi feature, adds helpers and tests that verify colored table borders remain aligned, and records the rendering fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: product: pacquet

Suggested reviewers: copilot, yeshyungseok

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-outdated-output

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix pacquet-cli outdated table alignment when output is colorized

🐞 Bug fix 🧪 Tests ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Enable tabled ANSI-aware width calculation to keep colored tables aligned.
• Add regression test ensuring colored outdated tables keep consistent border widths.
• Publish a patch changeset documenting the pnpm outdated alignment fix.
Diagram

graph TD
  U["TTY output (colored)"] --> O["pacquet-cli: outdated"] --> R["Table renderers"] --> T{{"tabled (ansi)"}} --> OUT["Aligned borders"]
  TEST[["Outdated table tests"]] --> R
  subgraph Legend
    direction LR
    _usr["Runtime"] ~~~ _svc["Module"] ~~~ _ext{{"External crate"}} ~~~ _test[["Test"]]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Strip ANSI escapes before building the table
  • ➕ Does not require enabling extra tabled feature/deps
  • ➕ Explicit control over what escapes are supported
  • ➖ Easy to get wrong (partial escapes, nested styling)
  • ➖ Would lose styling unless re-applied after layout
  • ➖ Duplicates functionality already provided by tabled's ansi feature
2. Switch to a different table renderer (ANSI-aware by default)
  • ➕ Potentially fewer feature flags / better default behavior
  • ➖ Higher migration risk across multiple commands (outdated/licenses/audit/etc.)
  • ➖ New dependency surface and possible output diffs

Recommendation: Keep the current approach: enabling tabled’s ansi feature is the lowest-risk fix because it addresses the root cause (width calculation) within the existing renderer and benefits all commands sharing tabled tables. The added regression test appropriately locks in the behavior for colorized output.

Files changed (4) +101 / -2

Tests (1) +55 / -1
tests.rsAdd regression test to ensure colored tables keep borders aligned +55/-1

Add regression test to ensure colored tables keep borders aligned

• Adds helpers to compute visible line width ignoring ANSI SGR escapes and a test that forces color output to verify consistent display width across rows for both regular and recursive outdated tables.

pnpm/crates/cli/src/cli_args/outdated/tests.rs

Documentation (1) +5 / -0
outdated-table-ansi-alignment.mdAdd changeset for colorized 'pnpm outdated' table alignment fix +5/-0

Add changeset for colorized 'pnpm outdated' table alignment fix

• Introduces a patch changeset for 'pacquet' describing the fix to 'pnpm outdated' table border alignment when output is colorized.

.changeset/outdated-table-ansi-alignment.md

Other (2) +41 / -1
Cargo.tomlEnable 'tabled' ANSI support via feature flag +1/-1

Enable 'tabled' ANSI support via feature flag

• Updates the 'tabled' dependency to enable the 'ansi' feature so table width calculations ignore ANSI SGR escape sequences.

Cargo.toml

Cargo.lockLockfile updates for 'tabled' ANSI feature dependencies +40/-0

Lockfile updates for 'tabled' ANSI feature dependencies

• Adds transitive crates required by 'tabled''s 'ansi' feature (e.g., 'ansi-str', 'ansitok', 'vte', 'arrayvec') and updates dependency edges accordingly.

Cargo.lock

@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     12.3±0.59ms    30.5 MB/sec    1.01     12.4±0.70ms    30.2 MB/sec
packument/parse                1.00     40.0±1.31µs  1656.5 MB/sec    1.07     42.8±0.67µs  1548.9 MB/sec
tarball/download_dependency    1.12      2.7±0.19ms  1577.6 KB/sec    1.00      2.5±0.10ms  1761.8 KB/sec

@greptile-apps

greptile-apps Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (4): Last reviewed commit: "test(pacquet-cli): color outdated table ..." | Re-trigger Greptile

@qodo-code-review

qodo-code-review Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Global color override races ✓ Resolved 🐞 Bug ☼ Reliability
Description
colored_table_borders_stay_aligned flips the process-global owo_colors override without
synchronization and only unsets it at the end of the test, so parallel tests can observe forced
coloring and become nondeterministic. If an assertion panics before cleanup, the override remains
enabled for subsequent tests in the same process, compounding flakiness.
Code

pnpm/crates/cli/src/cli_args/outdated/tests.rs[R185-205]

+fn colored_table_borders_stay_aligned() {
+    owo_colors::set_override(true);
+
+    let packages = [
+        pkg("actions/checkout", "7.0.0", "7.0.1", DependencyGroup::Dev),
+        pkg("typescript", "6.0.3", "7.0.2", DependencyGroup::Dev),
+        pkg("@typescript/native-preview", "1.0.0", "26.1.1", DependencyGroup::Dev),
+    ];
+    assert_borders_aligned(&render_table(&packages, false));
+
+    let workspace = [OutdatedInWorkspace {
+        package: pkg("typescript", "6.0.3", "7.0.2", DependencyGroup::Dev),
+        dependents: vec![DependentProject {
+            name: "app".to_string(),
+            location: PathBuf::from("packages/app"),
+        }],
+    }];
+    assert_borders_aligned(&render_recursive_table(&workspace, false));
+
+    owo_colors::unset_override();
+}
Relevance

⭐⭐⭐ High

They’ve accepted fixes preventing cross-test global state leakage/flakiness; guard/RAII cleanup for
overrides fits that pattern.

PR-#12926

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test enables owo_colors override and only unsets it at the end, with no locking or
Drop-based cleanup; since the outdated rendering functions gate colorization via owo_colors’
global if_supports_color(Stream::Stdout, ...), any concurrent test that renders output during this
window can see unexpected ANSI escapes, causing nondeterministic assertions/output.

pnpm/crates/cli/src/cli_args/outdated/tests.rs[154-205]
pnpm/crates/cli/src/cli_args/outdated.rs[1031-1062]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A new test enables `owo_colors::set_override(true)` and later calls `unset_override()`, but this uses process-global state. With Rust tests running in parallel by default, this can leak forced-color behavior into other tests and cause flaky CI. If the test fails/panics before reaching `unset_override()`, the override can remain set for the remainder of the test process.

### Issue Context
Color decisions in `outdated` rendering use `if_supports_color(Stream::Stdout, ...)`, so a global override affects any test that renders colored output.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/outdated/tests.rs[154-205]

### Suggested fix
1. Serialize access to the global override with a `static` mutex in the test module (e.g., `static COLOR_OVERRIDE_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(());`).
2. Use an RAII guard to ensure cleanup even on panic:
  - Call `owo_colors::set_override(true)` after acquiring the lock.
  - Create a small guard type whose `Drop` impl calls `owo_colors::unset_override()`.
3. Keep the lock held for the duration of the test so other tests cannot run concurrently while the override is enabled.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a bump for pacquet and does not include an explicit pnpm bump
entry as required by the changeset compliance rule. This can cause the release tooling to omit or
misclassify the user-visible fix in pnpm release notes/versioning.
Code

.changeset/outdated-table-ansi-alignment.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Multiple prior reviews rejected adding a mandatory pnpm changeset entry when only pacquet is
affected.

PR-#12981
PR-#13086
PR-#12991

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each new/modified changeset to explicitly include a pnpm package
entry with a valid bump type. The added changeset front-matter contains only "pacquet": patch and
no pnpm entry.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/outdated-table-ansi-alignment.md[1-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The changeset front-matter is missing a `pnpm` entry.

## Issue Context
Compliance requires changesets to explicitly include the `pnpm` package with a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/outdated-table-ansi-alignment.md[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Duplicate visible_width helper added ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
A new visible_width helper was added in outdated/tests.rs even though a similar
ANSI-escape-skipping visible_width already exists in pacquet-default-reporter. This duplicates
logic and risks divergence/bug fixes being applied in only one place.
Code

pnpm/crates/cli/src/cli_args/outdated/tests.rs[R154-170]

+/// Display width of `line`, ignoring ANSI SGR escape sequences.
+fn visible_width(line: &str) -> usize {
+    let mut chars = line.chars();
+    let mut width = 0;
+    while let Some(ch) = chars.next() {
+        if ch == '\u{1b}' {
+            for escape_ch in chars.by_ref() {
+                if escape_ch == 'm' {
+                    break;
+                }
+            }
+        } else {
+            width += 1;
+        }
+    }
+    width
+}
Relevance

⭐ Low

Repo has rejected dedup/refactor requests for duplicated helper logic in tests/CLI as too intrusive.

PR-#13151
PR-#13202
PR-#13196

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713439 requires reusing existing shared functionality instead of duplicating it.
The PR adds a new visible_width implementation in outdated/tests.rs, while a similar ANSI-aware
visible_width already exists as a shared formatter helper in default-reporter/src/format.rs.

Rule 713439: Avoid reimplementing existing functionality; extract and reuse shared modules
pnpm/crates/cli/src/cli_args/outdated/tests.rs[154-170]
pnpm/crates/default-reporter/src/format.rs[68-89]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`visible_width` is reimplemented in `pnpm/crates/cli/src/cli_args/outdated/tests.rs` despite an existing implementation elsewhere in the repo.

## Issue Context
There is already a public `visible_width` helper in `pnpm/crates/default-reporter/src/format.rs` that skips ANSI escape sequences. Duplicating the same concept increases maintenance cost and can create inconsistent behavior.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/outdated/tests.rs[154-170]
- pnpm/crates/default-reporter/src/format.rs[68-89]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
pnpm/crates/cli/src/cli_args/outdated/tests.rs (1)

193-202: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise the long rendering branches.

The regression test only passes false, leaving both Details-column paths untested. Add colored assertions for render_table(..., true) and render_recursive_table(..., true); add equivalent coverage for licenses/audit if they use separate table renderers.

As per path instructions, regression tests should prove the user-visible behavior and have matching coverage.

Suggested coverage
     assert_borders_aligned(&render_table(&packages, false));
+    assert_borders_aligned(&render_table(&packages, true));

     assert_borders_aligned(&render_recursive_table(&workspace, false));
+    assert_borders_aligned(&render_recursive_table(&workspace, true));
🤖 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/src/cli_args/outdated/tests.rs` around lines 193 - 202,
Extend the regression tests around render_table and render_recursive_table to
exercise the long=true Details-column branches, asserting the colored output and
border alignment alongside the existing false cases. If licenses or audit have
separate table renderers, add equivalent long-mode colored assertions for those
renderers as well.

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/cli/src/cli_args/outdated/tests.rs`:
- Around line 172-178: Update assert_borders_aligned to strip ANSI escape
sequences and extract every vertical border position from each row, then assert
those positions match across all rows. Do not rely solely on equal total display
widths, so compensating column shifts are detected.
- Around line 184-205: The colored_table_borders_stay_aligned test leaves the
process-global owo_colors override active if an assertion panics. Add a
Drop-based guard that enables the override on setup and reliably calls
unset_override during cleanup, and ensure these override-dependent tests run
serially by applying the repository’s existing serial-test mechanism or
equivalent test-thread constraint.

---

Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/outdated/tests.rs`:
- Around line 193-202: Extend the regression tests around render_table and
render_recursive_table to exercise the long=true Details-column branches,
asserting the colored output and border alignment alongside the existing false
cases. If licenses or audit have separate table renderers, add equivalent
long-mode colored assertions for those renderers as well.
🪄 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: 0b361c83-729d-4cb2-b17f-affd3b6564c9

📥 Commits

Reviewing files that changed from the base of the PR and between 2c6d294 and 5595a55.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (3)
  • .changeset/outdated-table-ansi-alignment.md
  • Cargo.toml
  • pnpm/crates/cli/src/cli_args/outdated/tests.rs

@codecov-commenter

codecov-commenter commented Jul 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.93%. Comparing base (62236cb) to head (f63e010).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13227      +/-   ##
==========================================
- Coverage   86.94%   86.93%   -0.01%     
==========================================
  Files         527      527              
  Lines       90053    90101      +48     
==========================================
+ Hits        78298    78333      +35     
- Misses      11755    11768      +13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…se visible_width

Address review feedback on the colored-table alignment test:

- The test flipped the process-global `owo_colors` override and only cleared
  it at the end, so a panic mid-test would leave forced color on for the rest
  of the process and a concurrent test could observe it. Guard the override
  with an RAII `ForcedColor` (clears on drop) and serialize the toggling tests
  behind a module-local mutex.
- Reuse the existing `pacquet_default_reporter::format::visible_width` instead
  of a second, less-correct ANSI-width helper in the test module.
Copilot AI review requested due to automatic review settings July 23, 2026 09:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…le test

Comparing only total row width could miss an inner separator shifting while
another column compensates. Extract the visible column index of every
box-drawing vertical border (skipping ANSI escapes) and assert those positions
match across all rows, which directly tests that the borders line up.
Copilot AI review requested due to automatic review settings July 23, 2026 09:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan

zkochan commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Notes on the two remaining summary-level findings:

Changeset missing pnpm entry — intentional, not a defect. This is a Rust-only change to the pacquet CLI; the TypeScript pnpm package renders outdated with @zkochan/table, which is already ANSI-width-aware, so there is nothing to change on that side. Repo policy (see the root CLAUDE.md / AGENTS.md, "Changesets for the Rust products") is explicit that a Rust-only changeset must target pacquet and must not include "pnpm", since pnpm in a changeset always means the TypeScript package. The Qodo note itself flags this Low with prior rejections on the same rule.

Duplicate visible_width helper — resolved by removing the width helper entirely. As of 9bc84fe the test no longer computes a display width at all; it compares the visible column positions of the vertical borders instead. The remaining border_columns helper is purpose-specific (it returns border positions, not a width) and has no shared equivalent.


Written by an agent (Claude Code, claude-opus-4-8).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9bc84fe

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

…lobal override

The regression test forced `owo_colors`' process-global color override on for
its duration. Even guarded by an RAII reset and a module-local mutex, other
tests in the same binary that render color-gated output could still observe the
override while it was set, since they don't take the lock.

Drop the override entirely: color the cells with `owo_colors`' unconditional
styling (which emits ANSI regardless of TTY detection) and feed them through a
modern-style `tabled` table the way the renderers do. The test now touches no
process-global state, so it is fully parallel-safe and still fails without the
`tabled` `ansi` feature.
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 23, 2026
Copilot AI review requested due to automatic review settings July 23, 2026 09:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
pnpm/crates/cli/src/cli_args/outdated/tests.rs (1)

192-200: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep only the non-obvious test-isolation rationale.

Most of this comment narrates the test fixture. Reduce it to why direct ANSI styling is required: it avoids owo_colors process-global state in parallel tests.

Proposed revision
-// Enabling `tabled`'s `ansi` feature makes it size a colored cell by its
-// visible glyphs, not its escape bytes; without it the columns and borders
-// drift apart. Feed a modern-style table the kind of ANSI-colored cells the
-// `outdated` renderers emit — a highlighted version segment, a dim group
-// label, bright-blue headers — and confirm every vertical border lands on the
-// same column. Coloring the cells directly (`owo_colors` unconditional
-// styling) rather than forcing the global color override keeps the test free
-// of process-global state, so it can't leak into or be perturbed by other
-// tests running in the same binary.
+// Build ANSI sequences directly to avoid `owo_colors`' process-global override,
+// keeping this parallel test isolated.

As per coding guidelines, Rust comments should explain only “non-obvious reasons or invariants.”

🤖 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/src/cli_args/outdated/tests.rs` around lines 192 - 200,
Shorten the comment above the ANSI-colored table test to retain only the
non-obvious isolation rationale: style cells directly with owo_colors to avoid
its process-global color state affecting or being affected by parallel tests.
Remove the fixture, rendering, and table-layout narration.

Sources: Coding guidelines, 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.

Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/outdated/tests.rs`:
- Around line 192-200: Shorten the comment above the ANSI-colored table test to
retain only the non-obvious isolation rationale: style cells directly with
owo_colors to avoid its process-global color state affecting or being affected
by parallel tests. Remove the fixture, rendering, and table-layout narration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e695b53-5cf6-4e9e-b5f2-ab440cbc5594

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc84fe and f63e010.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
📒 Files selected for processing (1)
  • pnpm/crates/cli/src/cli_args/outdated/tests.rs

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit f63e010

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan
zkochan merged commit 10382e0 into main Jul 23, 2026
32 checks passed
@zkochan
zkochan deleted the fix-outdated-output branch July 23, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants