Skip to content

fix: surface min loadout list parse failures on stderr and exit non-zero - #1152

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/loadout-list-parse-failures-ec775fa842800979
Jul 31, 2026
Merged

fix: surface min loadout list parse failures on stderr and exit non-zero#1152
norrietaylor merged 1 commit into
mainfrom
inbox-patch/loadout-list-parse-failures-ec775fa842800979

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmgtQQ

min loadout list folded every discovered .toml file — including ones that fail to parse — into its table. Three defects followed: a multi-line TOML parse error in the counts column corrupted the layout; the command exited 0 even when a file failed to parse, hiding the failure from scripts; and each error printed the file path twice (the row prefixed a path LoadError already names). Now parse failures go to stderr (single path) and are kept out of the table, and the command exits non-zero when any file fails; the table of valid loadouts stays intact. Surfacing CLI errors this way follows the existing convention (informed by #95).

Verification

cargo fmt --all --check --manifest-path target/Cargo.toml — clean, no drift
cargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warnings — 0 warnings
cargo build --workspace --locked --manifest-path target/Cargo.toml — ok
cargo test --workspace --locked --manifest-path target/Cargo.toml — all suites pass; new test cmd_loadout_list_errors_on_malformed_entry ok

Note

Surface loadout list parse failures on stderr and exit non-zero

  • cmd_loadout_list now partitions discovered loadout entries into successes and failures instead of embedding errors as table rows.
  • Parse errors are printed to stderr and the command exits non-zero if any failures are present; the table shows only valid loadouts.
  • LoadoutRow::from_entry in loadouts.rs now accepts a pre-parsed loadout, removing the error-embedding code path.
  • Behavioral Change: malformed .toml files previously appeared as rows with an (error at …) message; they are now excluded from the table and cause a non-zero exit.

Macroscope summarized 4aa6b2a.

`min loadout list` folded every discovered entry, including files
that failed to parse, into the output table. The multi-line TOML
parse error landed in the counts column and corrupted the layout,
the command still returned `Ok(())` so callers saw a success, and
each error printed the file path twice because the row format
prefixed a path that `LoadError`'s Display already includes.

Partition the entries instead: parseable loadouts become table
rows, while parse failures are reported on stderr (no duplicate
path) and make the command exit non-zero when any file is broken.
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7c8b6b86-eb1b-43df-b636-56fc01cad0c7

📥 Commits

Reviewing files that changed from the base of the PR and between 4a738d4 and 4aa6b2a.

📒 Files selected for processing (1)
  • crates/minimal/src/loadouts.rs

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

@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 22:10
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 22:10
@norrietaylor

Copy link
Copy Markdown
Member

Reviewed — sound

The partition is the right shape: parse failures go to stderr, the table of valid loadouts still prints, and the non-zero exit comes after the output so a human still sees the usable rows while a script can detect the breakage. That is a better answer than either dropping the table or aborting on first error.

Keeping failures out of the table is load-bearing for a reason the comment states well — multi-line parse errors were corrupting the column layout, which was one of the three defects in gominimal/inbox#391, not just cosmetic fallout.

Two details worth noting as correct rather than accidental:

  • eprintln!("{e}") without re-prefixing the path — LoadError's Display already names the file, so adding it here would reproduce the doubling that #1151 is separately fixing.
  • The singular/plural branch in the bail! avoids 1 loadout files failed.

No changes requested.

@norrietaylor
norrietaylor merged commit f4dd7fa into main Jul 31, 2026
30 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/loadout-list-parse-failures-ec775fa842800979 branch July 31, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant