Skip to content

fix: flag completions install for shells that will not load the file - #1082

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/completions-loader-warn-726a3ebf2803df90
Jul 31, 2026
Merged

fix: flag completions install for shells that will not load the file#1082
norrietaylor merged 1 commit into
mainfrom
inbox-patch/completions-loader-warn-726a3ebf2803df90

Conversation

@gominimal-aw-bot

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

Copy link
Copy Markdown
Contributor

Fixes #1027
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmglFQ

min completions install wrote each shell's file and returned success without checking the shell would ever load it. install_one now guards the two shells whose target path is not self-sufficient: bash is skipped with a warning when no bash-completion loader (the only reader of ~/.local/share/bash-completion/completions) is found on the system, and zsh emits the fpath+=(...) line the user needs when its completions dir cannot be confirmed on $fpath. fish is untouched (native XDG path). This follows the module's existing "warn on stderr, not fail" convention for shell dirs (informed by #714).

Verification

  • cargo fmt --all --check --manifest-path target/Cargo.toml — clean
  • cargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warnings — 0 warnings
  • cargo build --workspace --locked --manifest-path target/Cargo.toml — Finished, ok
  • cargo test --workspace --locked --manifest-path target/Cargo.toml — all passed (minimal crate 134/134; new fpath_membership_is_exact green)

Generated by inbox-patch ·

Note

Block shell completion install when no bash-completion loader is detected

  • Bash: aborts install_one with an error if no bash-completion loader is found (checks BASH_COMPLETION_USER_DIR env var and seven standard loader paths); previously the file would be written silently with no loader to source it.
  • Zsh: emits a stderr note if the target directory is not present on $fpath, advising the user to update ~/.zshrc before compinit.
  • Adds bash_completion_present, zsh_dir_on_fpath, and fpath_contains helpers in completions.rs with unit tests for path membership.
  • Behavioral Change: Bash completion install now fails hard instead of succeeding silently when the shell environment cannot load the file.

Macroscope summarized 1135f2e.

`min completions install` wrote each shell's file and exited 0 with
no check that the shell would ever source it. `install_one` now
guards the two shells whose written path is not self-sufficient:

- bash has no completion search path of its own; the file is read
  only by the separate bash-completion project's loader. When no
  loader is found on the system, skip bash with a warning rather
  than leave an inert file.
- zsh autoloads the file only when its directory is on `$fpath`
  before `compinit`. When that cannot be confirmed, print the
  `fpath+=(...)` line the user needs.

fish is unaffected: its XDG completions path is native.
@coderabbitai

coderabbitai Bot commented Jul 29, 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: 54 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: 49226c90-48b6-414d-b982-e49b20cb1dcf

📥 Commits

Reviewing files that changed from the base of the PR and between 6fa4175 and 1135f2e.

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

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

@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 05:05
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 05:05
@norrietaylor
norrietaylor merged commit 63cb4e9 into main Jul 31, 2026
29 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/completions-loader-warn-726a3ebf2803df90 branch July 31, 2026 05:06
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.

min completions install reports success for shells that will never load the file

1 participant