Skip to content

fix(installer): better handle case where shell dir is not writeable - #714

Merged
twitchyliquid64 merged 1 commit into
mainfrom
tom/installer
Jul 10, 2026
Merged

twitchyliquid64 merged 1 commit into
mainfrom
tom/installer

Conversation

@twitchyliquid64

@twitchyliquid64 twitchyliquid64 commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Shell completion installation now handles unwritable or shared completion directories gracefully.
    • Installations continue successfully with a clear warning when a completion directory cannot be written.
    • Completion files for other supported shells are still generated when one directory is unavailable.
    • Raw permission-denied errors are suppressed during completion and shell configuration setup.
    • Shell initialization setup now continues non-fatally when configuration files cannot be updated.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The installer now suppresses raw redirection permission errors while warning and continuing when rc-hook or shell-completion destinations are unwritable. The specification and proof tests verify exit status, warning content, continued completion generation, and clean output.

Changes

Installer permission handling

Layer / File(s) Summary
Suppress installer redirection failures
scripts/install.sh
Completion generation prepares destinations and temporary files inside stderr-suppressed subshells, cleans up failures, and applies the same suppression to rc-hook directory creation and marker appends.
Document and test non-fatal behavior
docs/specs/07-spec-installer/07-spec-installer.md, scripts/install_test.sh
The specification and tests verify warnings, successful continuation, other-shell completion generation, unwritable-directory protection, and absence of raw permission errors.

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

Possibly related PRs

Suggested reviewers: norrietaylor

Poem

A rabbit watched the installer hop,
Past denied paths without a stop.
Warnings whispered, errors hid,
Shell completions bloomed amid.
“All clear!” twitched my nose with glee.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: improving installer handling when a shell completion directory is not writable.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@twitchyliquid64
twitchyliquid64 enabled auto-merge (squash) July 10, 2026 21:21

@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: 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 `@scripts/install_test.sh`:
- Around line 458-459: The install test only verifies bash completion after the
fish failure; extend the same “other shells’ completions still installed (R9.3)”
assertion block to also check the expected zsh completion file path, using the
appropriate zsh path variable and filename.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a8796f70-bb0c-4804-9bdc-585ec6e7daf9

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce4adf and 3e6cf27.

📒 Files selected for processing (3)
  • docs/specs/07-spec-installer/07-spec-installer.md
  • scripts/install.sh
  • scripts/install_test.sh

Comment thread scripts/install_test.sh
Comment on lines +458 to +459
want_ok "other shells' completions still installed (R9.3)" \
test -f "$H13/xdg-data/bash-completion/completions/min"

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert zsh completion too.

The test currently proves only that bash completion continues after fish fails; a zsh-specific regression could still pass. Add an assertion for the expected zsh completion path.

🤖 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 `@scripts/install_test.sh` around lines 458 - 459, The install test only
verifies bash completion after the fish failure; extend the same “other shells’
completions still installed (R9.3)” assertion block to also check the expected
zsh completion file path, using the appropriate zsh path variable and filename.

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.

2 participants