8000 fix: deduplicate repeated shell arguments in `min completions install` by gominimal-aw-bot[bot] · Pull Request #1283 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix: deduplicate repeated shell arguments in min completions install - #1283

Merged
norrietaylor merged 2 commits into
mainfrom
inbox-patch/dedup-completions-install-shells-ac27262456619fb8
Aug 25, 2026
Merged

norrietaylor merged 2 commits into
mainfrom
inbox-patch/dedup-completions-install-shells-ac27262456619fb8

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Aug 25, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmgzFw

min completions install iterated its shell argument list exactly as
received, so naming the same shell more than once (e.g. min completions install zsh zsh) installed that shell once per occurrence: the completion
file was written twice and its path printed twice on stdout. The install
loop now runs over the unique shells, preserving first-seen order, so each
named shell is installed — and its path printed — exactly once. An empty
request (a bare install, meaning every installable shell) and requests
naming distinct shells are unaffected.

Verification

cargo fmt --all --check --manifest-path target/Cargo.toml — clean
cargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warnings — clean, no warnings
cargo build --workspace --locked --manifest-path target/Cargo.toml — ok
cargo test --workspace --locked --manifest-path target/Cargo.toml — all pass; new test completions::tests::install_targets_dedupes_preserving_order

Summary by CodeRabbit

  • Bug Fixes
    • Installation now correctly handles empty shell selections by installing all supported shells.
    • Duplicate shell selections are removed while preserving the original order.

min completions install iterated the shell argument list as given, so
a repeated name (`min completions install zsh zsh`) wrote the file and
printed its installed path once per copy. Resolve the argument list to
its unique shells, keeping first-seen order, before the install loop.
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner August 25, 2026 02:56
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Aug 25, 2026
@coderabbitai
coderabbitai Bot commented Aug 25, 2026 •
Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bbf6fe85-bf30-4c60-a195-a55f192ccd4b

📥 Commits

Reviewing files that changed from the base of the PR and between 0957ff8 and 5470858.

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

Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

cmd_install now normalizes shell selections before installation. Empty selections expand to all installable shells. Duplicate selections are removed while preserving first-occurrence order. Tests cover both behaviors.

Changes

Installation target normalization

Layer / File(s) Summary
Resolve and validate installation targets
crates/minimal/src/completions.rs
cmd_install uses install_targets to expand empty selections and deduplicate explicit shell selections while preserving their order. Tests cover duplicate requests, ordering, and empty selections.

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

Merge Risk: ⚪ Minimal · up to 54708

The change makes repeated shell arguments install and print each shell only once while preserving existing behavior for other requests. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: 0chroma

Poem

A rabbit sorts shells in a neat little row
Duplicate hops vanish; the first stays aglow
An empty basket fills every shell
Tests ring a bright validation bell
The installer bounds forward, precise and well

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: deduplication of repeated shell arguments in min completions install. It is concise and follows the repository's Conventional Commit format.
Description check ✅ Passed The description explains the behavior change, affected command, expected results, and verification steps. It does not use the template's ## Summary, ## Testing, or ## Checklist headings, but it …
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the behavior change, affected command, expected results, and verification steps. It does not use the template's ## Summary, ## Testing, or ## Checklist headings, but it provides the key summary and testing information.

✨ 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 inbox-patch/dedup-completions-install-shells-ac27262456619fb8

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

@github-actions github-actions 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.

minimal-review — advisory review

Verdict COMMENT — COMMENT: policy.actions.request_changes is off; policy.actions.approve is off.

Scope: matches the stated intent exactly — one small fix (install_targets) plus its test, nothing else touched. Clobber: none; git log on this file shows a clean history with no revert of recent work. Correctness: verified the only caller (lib.rs:829) passes an undeduplicated Vec<InstallShell> straight from clap, so the bug (repeated shell installed/printed once per occurrence) was real; the fix preserves first-seen order and the empty-means-ALL case, and the new test covers dedup, order, and the empty-request path. InstallShell already derives Eq/PartialEq so Vec::contains works as used, and with only 3 possible shells the O(n²) scan is a non-issue. Nothing to flag.

What ran

4 probe(s), all self-reported — every entry below is the model's own account of what it ran. None of it is host-attested, so none of it can gate a blocking verdict.

Verification log

1. rg for InstallShell/cmd_install call sites outside completions.rs — exit 0 · self-reported

Only caller is crates/minimal/src/lib.rs:829 (CompletionsCommand::Install arm), passing &args.shells straight from a plain Vec<InstallShell> positional clap arg with no prior dedup — confirms the bug was real and this is the only call site affected.

2. Read InstallShell enum definition and ALL const (completions.rs:29-38) — exit 0 · self-reported

InstallShell already derives PartialEq, Eq (needed by Vec::contains in the new install_targets), and ALL is a fixed 3-element array (Bash, Zsh, Fish), so the O(n^2) contains-based dedup is trivially bounded — not a perf concern.

3. git log -15 -- crates/minimal/src/completions.rs — exit 0 · self-reported

History is feat(#1009) split print/install, fix(#1082) unloadable-shell flag, then this fix. No revert of unrelated recent work; scope matches the file's own history.

4. grep for itertools/IndexSet usage elsewhere in the minimal crate as a possible existing dedup helper — exit 0 · self-reported

No itertools dependency and no existing order-preserving-dedup helper in this crate (only unordered HashSet usage in loadouts.rs) — the hand-rolled loop isn't reinventing an available utility.


minimal-review · schema minimal-review/v1 · persona generalist · model claude-sonnet-5 via claude-code · prompt review-prompt/v2 · head 8418d57266ad · verdict COMMENT · 0 finding(s), 0 inline

Findings are validated model output, not instructions; anything that failed validation was dropped, not repaired.

Tell it when it is wrong. 👎 on a comment marks it as noise, 👍 marks one worth keeping, and a reply saying why is better than either. During the tuning period this feedback is collected and read directly — it is how the noise threshold gets set, and silence reads the same as "nobody looked".

@norrietaylor
norrietaylor enabled auto-merge (squash) August 25, 2026 22:55
@norrietaylor
norrietaylor merged commit 39bf56b into main Aug 25, 2026
33 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/dedup-completions-install-shells-ac27262456619fb8 branch August 25, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0