Skip to content

Align auto-update prompt across all installers#1083

Merged
gtrrz-victor merged 4 commits intomainfrom
align-auto-update-flows-for-all-installers
Apr 30, 2026
Merged

Align auto-update prompt across all installers#1083
gtrrz-victor merged 4 commits intomainfrom
align-auto-update-flows-for-all-installers

Conversation

@gtrrz-victor
Copy link
Copy Markdown
Contributor

@gtrrz-victor gtrrz-victor commented Apr 30, 2026

https://entire.io/gh/entireio/cli/trails/270

Summary

PR #1057 added a 3-option auto-update prompt (Update / Skip / Skip until next version) for brew users. Other installers (mise, scoop, curl-bash) still saw the older Y/N huh form with no skip-until-next-version support.

This PR collapses the brew-only dispatch in MaybeAutoUpdate so every auto-installable install manager goes through the same prompt. The wording stays byte-identical to the brew prompt — only the cmdStr interpolated into option 1 varies (mise upgrade entire, scoop update entire/cli, curl -fsSL https://entire.io/install.sh | bash). The skip-until-next-version cache in ~/.config/entire/version_check.json is already installer-agnostic, so persistence works for free.

The unused Y/N huh form (realConfirmUpdate) and its confirmUpdate test seam are deleted.

Windows + unknown installer behaviour is unchanged: still prints the downloads-page hint, no prompt (no command to auto-run).

Outputs

  • brew:
Entire CLI 0.0.1 (unknown)
Go version: go1.26.2
OS/Arch: darwin/arm64

Update available! 0.0.1 -> 9.9.9
Release notes: https://github.com/entireio/cli/releases/tag/v9.9.9
┃   Update now (runs `brew upgrade entire`)                                                                                                                                 
┃ > Skip                                                                                                                                                                                               
┃   Skip until next version  

  • scoop:
Entire CLI 0.0.1 (unknown)
Go version: go1.26.2
OS/Arch: darwin/arm64

Update available! 0.0.1 -> 9.9.9
Release notes: https://github.com/entireio/cli/releases/tag/v9.9.9
┃   Update now (runs `scoop update entire/cli`)                                                                                                                                 
┃ > Skip                                                                                                                                                                                               
┃   Skip until next version  

  • mise:
Entire CLI 0.0.1 (unknown)
Go version: go1.26.2
OS/Arch: darwin/arm64

Update available! 0.0.1 -> 9.9.9
Release notes: https://github.com/entireio/cli/releases/tag/v9.9.9
┃   Update now (runs `mise upgrade entire`)                                                                                                                                 
┃ > Skip                                                                                                                                                                                               
┃   Skip until next version  

  • bash install.sh script:
Entire CLI 0.0.1 (unknown)
Go version: go1.26.2
OS/Arch: darwin/arm64

Update available! 0.0.1 -> 9.9.9
Release notes: https://github.com/entireio/cli/releases/tag/v9.9.9
┃   Update now (runs `curl -fsSL https://entire.io/install.sh | bash`)                                                                                                                                 
┃ > Skip                                                                                                                                                                                               
┃   Skip until next version  

Test plan

  • mise run check (build + lint + unit + integration + Vogon canary) — passing locally
  • Manual smoke per installer via ./test-auto.sh [brew|mise|scoop|bash] (script bundled in branch but untracked) — verifies prompt shows correct runs <cmd> per installer
  • Confirm option 3 ("Skip until next version") persists across runs (./test-auto.sh mise --keep-home)
  • Confirm ENTIRE_NO_AUTO_UPDATE=1 still suppresses the prompt for every installer

🤖 Generated with Claude Code


Note

Medium Risk
Changes the CLI’s auto-update interaction and command execution path for non-brew installers, so regressions could affect update prompting/auto-run behavior across platforms despite strong test coverage.

Overview
Auto-update prompting is unified so all auto-installable install managers (brew, mise, scoop, curl-bash fallback) use the same 3-option menu (Update now / Skip / Skip until next version), instead of only brew getting the 3-option prompt while others used a separate Y/N confirmation flow.

The old huh-based confirmUpdate path is removed, the prompt/choice parsing is renamed to installer-agnostic chooseUpdate/parseUpdateChoice, and non-interactive/kill-switch behavior consistently prints the exact manual update command; Windows + unknown installer continues to show the releases download page (no prompt/auto-run). Tests are refactored and expanded to validate the prompt text/command interpolation and skip-until-next-version caching across installers (including mise).

Reviewed by Cursor Bugbot for commit ecba1ad. Configure here.

The 3-option prompt (update / skip / skip until next version) added in
PR #1057 only ran for brew. mise, scoop, and the curl-bash fallback
still showed the older Y/N huh form with no skip-until-next-version
support. Collapse the brew-only branch in MaybeAutoUpdate so every
auto-installable install manager goes through the same prompt with the
installer command substituted into option 1. Wording stays byte-identical
to the brew prompt; only the cmdStr varies. Drop the now-unused Y/N huh
form and confirmUpdate seam.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 8b5a28921a47
@gtrrz-victor gtrrz-victor requested a review from a team as a code owner April 30, 2026 11:13
Copilot AI review requested due to automatic review settings April 30, 2026 11:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Unifies the auto-update prompt flow so all auto-installable installers (brew/mise/scoop/curl-bash) show the same 3-option update prompt, and removes the legacy Y/N confirm path.

Changes:

  • Collapses the brew-only auto-update dispatch into a single prompt path with installer-specific command interpolation.
  • Removes the old confirm-based prompt seam and updates tests accordingly.
  • Extends/adjusts test coverage to assert prompt wording and skip-until-next-version persistence for non-brew installers.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cmd/entire/cli/versioncheck/autoupdate.go Removes brew-only branching and standardizes the 3-option prompt + unified selection parsing.
cmd/entire/cli/versioncheck/autoupdate_test.go Refactors fixtures and adds table-driven coverage across installers + updates helper utilities.
cmd/entire/cli/versioncheck/versioncheck_test.go Adds a mise persistence test and updates seams to the unified chooser.

Comment thread cmd/entire/cli/versioncheck/autoupdate_test.go Outdated
gtrrz-victor and others added 2 commits April 30, 2026 13:45
Replace the hand-rolled stdin reader (bufio + parseUpdateChoice) with a
huh.Select form so the prompt matches the rest of the CLI's interactive
UX (arrow-key TUI in normal mode, plain numbered prompt under
ACCESSIBLE=1). The choose seam now takes (currentVersion, latestVersion,
cmdStr) instead of an io.Writer; tests mock the seam directly so the
behavioural assertions are unchanged. Drop the now-dead helpers
(printUpdateMessage, chooseUpdateFromReader, parseUpdateChoice) and
their unit tests; the huh.Select itself is exercised by the manual smoke
script (test-auto.sh).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 7b7758d3b29f
Thread the ambient context.Context into chooseUpdate so the huh form
respects cancellation (form.RunWithContext) and a stalled prompt can
be cleaned up if the parent command is interrupted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 57d2e9111433
@gtrrz-victor
Copy link
Copy Markdown
Contributor Author

Follow-up commits 82f70d81d and f65211426: swap the hand-rolled stdin reader for huh.Select and thread the ambient context.

  • Default: arrow-key TUI prompt, matches the rest of the CLI's interactive UX (rewind, sessions, clean, etc).
  • Accessibility: ACCESSIBLE=1 flips huh.WithAccessible(true) for a plain numbered prompt readable by screen readers (project convention per CLAUDE.md).
  • Cancellation: the form runs via RunWithContext(ctx) so a stalled prompt is cleaned up when the parent command is interrupted.
  • Non-interactive paths unchanged: kill switch / CI / no-TTY still bail to the "To update, run: <cmd>" manual hint.
  • Wording note: the prompt text is now huh-rendered (Title / Description / Options), so the byte-identical "Press enter to continue / Choose an option [1]: " wording from PR Brew: Prompt users to update when new version is released #1057 is replaced by huh's renderer. Behaviour is identical: 3 actions, default is "Update now", skip-until-next-version persists in the cache.
  • Dead helpers (printUpdateMessage, chooseUpdateFromReader, parseUpdateChoice) and their unit tests removed. The test seam mocks the choose function directly, so all behavioural tests still pass; huh.Select itself is exercised by the manual smoke script.

Per Copilot review: the table-driven tests using nonWindowsAutoInstallers()
would fail on a Windows host because canAutoInstall() blocks brew and the
curl-bash fallback there. Pin the goos seam to a non-Windows value at the
start of each table-driven test so they're robust regardless of the host
runtime.GOOS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 587b53a75aa0
Copy link
Copy Markdown
Collaborator

@Soph Soph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@gtrrz-victor gtrrz-victor merged commit d512723 into main Apr 30, 2026
9 checks passed
@gtrrz-victor gtrrz-victor deleted the align-auto-update-flows-for-all-installers branch April 30, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants