Skip to content

fix(install): announce fallback apt-get update, make its test hermetic - #106

Merged
ddtcorex merged 1 commit into
masterfrom
fix/installer-cli-only-sudo-and-test-hermeticity
Aug 4, 2026
Merged

fix(install): announce fallback apt-get update, make its test hermetic#106
ddtcorex merged 1 commit into
masterfrom
fix/installer-cli-only-sudo-and-test-hermeticity

Conversation

@ddtcorex

@ddtcorex ddtcorex commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes two small issues found while reviewing the CLI-only installer support merged in #103 (db0b0d7 on master):

  1. desktop_install_enabled() (install.sh) silently ran sudo apt-get update when APT package lists were unpopulated, before ever explaining itself — inconsistent with every other sudo call in the script. Now logs an info() line first.
  2. tests/install_script_test.go's "falls back to CLI only when unavailable" case only shimmed apt-cache, not sudo — on a machine whose real /var/lib/apt/lists happens to be empty, go test could trigger a genuine sudo apt-get update. sudo enforces its own secure_path, so a PATH-only apt-get shim would not reliably intercept it; shimming sudo itself does. Independently verified (outside the Go test, by sourcing install.sh directly with apt_lists_populated forced to fail) that the shim now correctly intercepts the call and the new info() message prints.

No behavior change to the installer's actual CLI-only-vs-Desktop decision logic — both fixes are additive (a log line, a test shim).

Validation

go build ./...
go vet ./...
gofmt -s -l .
go test ./...
make test   # lint + fmt-check + vet + unit + frontend + integration (Docker available)
bash -n install.sh

All pass. Also manually confirmed the fix end-to-end by sourcing install.sh with apt_lists_populated overridden to force the fallback branch, and a logging sudo shim in PATH — confirmed the new info() message prints and the shim (not a real sudo) is invoked.

Linked issue

Closes #105

…metic

desktop_install_enabled() silently ran `sudo apt-get update` when APT
package lists were unpopulated, before the script ever explained
itself or asked permission - inconsistent with every other sudo call
in this script. Log an info() line first.

tests/install_script_test.go's "falls back to CLI only" case only
shimmed apt-cache, so on a machine whose real /var/lib/apt/lists
happens to be empty, running `go test` would trigger a genuine `sudo
apt-get update` (sudo enforces its own secure_path, so shimming
apt-get instead would not reliably intercept it). Shim sudo itself to
keep the test hermetic regardless of the test machine's real APT
state.
@ddtcorex ddtcorex added this to Govard Aug 4, 2026
@github-project-automation github-project-automation Bot moved this to 🆕 New in Govard Aug 4, 2026
@ddtcorex ddtcorex moved this from 🆕 New to 👀 In review in Govard Aug 4, 2026
@ddtcorex
ddtcorex merged commit 47921cc into master Aug 4, 2026
7 checks passed
@ddtcorex
ddtcorex deleted the fix/installer-cli-only-sudo-and-test-hermeticity branch August 4, 2026 18:18
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Govard Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Installer: unannounced sudo apt-get update, non-hermetic test

1 participant