Skip to content

chore(install): replace gum with whiptail - #2880

Merged
vpetersson merged 2 commits into
masterfrom
chore/install-replace-gum-with-whiptail
May 12, 2026
Merged

chore(install): replace gum with whiptail#2880
vpetersson merged 2 commits into
masterfrom
chore/install-replace-gum-with-whiptail

Conversation

@vpetersson

Copy link
Copy Markdown
Contributor

Issues Fixed

No linked issue — drops an unnecessary third-party dependency from the installer bootstrap.

Description

bin/install.sh previously installed gum from the Charm.sh apt repo (custom GPG key + sources.list entry) just to render styled prompts. Replaced with whiptail, which ships with Debian/Raspbian by default, so the installer no longer needs to add a third-party apt repo before doing anything else.

  • Interactive prompts: gum confirmwhiptail --yesno, gum choosewhiptail --menu, gum inputwhiptail --inputbox, error notices → whiptail --msgbox.
  • Banner / section headers print between long-running apt/ansible steps, so they stay as plain echo (modal dialogs per section would force the user to press Enter repeatedly).
  • Brand colors retained via NEWT_COLORS for the dialogs (purple chrome on white, yellow accents) and ANSI escapes (bold magenta / yellow) for the banner and section headers. CSS palette from sass/_variables.scss is approximated against whiptail's 16 named colors.
  • Removed the markdown styling from INTRO_MESSAGE and the user-input summary since whiptail renders content verbatim.
  • Dropped the now-unused VERSION_PROMPT_CHOICES array.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

Drops the Charm.sh apt repo and the gum binary; whiptail ships with
Debian/Raspbian and covers the interactive prompts the installer
needs (yesno, menu, inputbox, msgbox). Brand colors are retained via
NEWT_COLORS (purple/yellow) and matching ANSI escapes on the plain
banner/section headers that print between long-running apt/ansible
steps.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@vpetersson
vpetersson requested a review from a team as a code owner May 12, 2026 19:46
@vpetersson vpetersson self-assigned this May 12, 2026
@vpetersson
vpetersson requested a review from Copilot May 12, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Replace the typed-tag flow with a whiptail menu populated from the
live GitHub release list (filtered to non-draft, non-prerelease
entries with a docker-tag asset, capped at the 10 most recent). The
"latest" rolling-release entry stays pinned at the top and an "other"
escape hatch preserves the inputbox path for tags outside the recent
window.

Also harden the curl|bash entry path:

- reject `sh install.sh` early with a clear message before
  `set -o pipefail` aborts cryptically
- reject running as root (the script writes user-owned venvs and a
  sudoers entry, which must not land under /root)
- probe github.com before burning an apt-get update so offline runs
  fail fast with an actionable error
- run `set_device_type` as a preflight so unsupported hardware fails
  before the long install pipeline starts
- install curl + ca-certificates in install_prerequisites since the
  release-menu fetch and connectivity probe run before install_packages
- standardize the curl flags used by the new fetches on
  `-fsSL --max-time …` so transient network errors surface instead
  of returning empty strings silently

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@vpetersson
vpetersson requested a review from Copilot May 12, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@sonarqubecloud

Copy link
Copy Markdown

@vpetersson
vpetersson requested a review from Copilot May 12, 2026 19:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@vpetersson
vpetersson merged commit e28d217 into master May 12, 2026
6 checks passed
vpetersson added a commit that referenced this pull request May 12, 2026
* Master's #2881 (e2e-test findings) added an `installer_venv` persistent
  venv provisioned by `bin/install.sh::provision_host_agent_venv` and
  kept the systemd unit ExecStart pointed at that stable path. Drops the
  duplicate ansible-side `.anthias-venv` task and reverts the
  unit-template path I'd introduced — master's approach is upstream
  and avoids rewriting the unit path on devices installed pre-refactor.
* Master's #2880 replaced the gum UI with whiptail. The auto-merge took
  whiptail's wiring; my arm64-aware INTRO_MESSAGE / set_device_type /
  Pi-tag-skip branches survived alongside it.
* Master's #2878 viewer locale changes auto-merged with my arm64
  start_viewer.sh conditional.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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