Offer update-anyway choices when auto-update hits local changes - #52
Conversation
Prompt to stash or discard uncommitted changes during automatic menu updates instead of silently skipping, while still skipping in non-interactive sessions. Co-authored-by: Michael <Narehood@users.noreply.github.com>
📝 WalkthroughWalkthroughThe installer version changes to 3.8.1. Automatic updates now skip dirty working trees in non-interactive sessions and prompt interactively. Documentation and update-flow tests cover the new behavior. ChangesUpdate flow
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/update-flow.sh (1)
89-97: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftTest the update branches, not only the prompt text.
These assertions pass when the strings exist anywhere in
install.sh; they do not verify runtime behavior. Add a dirty-repository test for non-TTY skipping, interactive cancellation, stashing, and discarding.🤖 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 `@tests/update-flow.sh` around lines 89 - 97, Strengthen the update-flow test around the dirty-repository handling in install.sh by executing each relevant branch rather than only grepping for prompt text: verify non-TTY mode skips the update, interactive cancellation leaves the repository unchanged, stashing proceeds with the update while preserving changes, and discarding removes the local changes before continuing. Reuse the existing test setup and assertions in tests/update-flow.sh, and retain prompt checks only if they remain necessary.
🤖 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 `@README.md`:
- Around line 117-118: Update the README paragraph describing automatic updates
to document the interactive “0. Cancel” option, including that selecting it
preserves local changes; keep the existing dirty-tree and non-interactive
behavior description intact and align the wording with install.sh’s update flow.
---
Nitpick comments:
In `@tests/update-flow.sh`:
- Around line 89-97: Strengthen the update-flow test around the dirty-repository
handling in install.sh by executing each relevant branch rather than only
grepping for prompt text: verify non-TTY mode skips the update, interactive
cancellation leaves the repository unchanged, stashing proceeds with the update
while preserving changes, and discarding removes the local changes before
continuing. Reuse the existing test setup and assertions in
tests/update-flow.sh, and retain prompt checks only if they remain necessary.
🪄 Autofix
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a35220b9-da79-414e-82ff-9996e37127e0
📒 Files selected for processing (3)
README.mdinstall.shtests/update-flow.sh
| prompts to stash or discard local changes when the working tree is dirty (or skips in | ||
| non-interactive sessions). |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Document the cancel option.
Interactive automatic updates also offer 0. Cancel and keep local changes when selected. Add this behavior so the paragraph matches install.sh Lines 575-579.
🤖 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 `@README.md` around lines 117 - 118, Update the README paragraph describing
automatic updates to document the interactive “0. Cancel” option, including that
selecting it preserves local changes; keep the existing dirty-tree and
non-interactive behavior description intact and align the wording with
install.sh’s update flow.
Summary
When auto-update finds uncommitted local changes, prompt instead of silently skipping.
Behavior
Why
Hosts with dirty working trees (common after local edits) were stuck at “automatic update was skipped” with no way to proceed from the prompt.
Summary by CodeRabbit