Allow permanently disabling lstk update checks - #491
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
7838fda to
6c6a856
Compare
|
@gtsiolis What's your thought regarding the open question (see Section "Open questions")? Do you see a UX issue in having the |
|
@carillan81 What's your suggestion on how update notifications for bundled extensions work in this context (e.g., externally-managed lstk)? Do we to treat lstk and lstk extension updates separately? Happy to discuss. |
|
Extensions are only updated when |
Great, thank you for the clarification @carillan81 👍 Then, our PRs complement each other nicely ✨ |
Motivation
lstk asks to update on every start with no way to turn it off. With weekly releases, "skip this version" buys a few days — the reporter sees the prompt almost daily.
It is also wrong when another tool owns the binary. mise, nix, asdf, scoop and chocolatey manage the version themselves; replacing it desynchronises them, and on nix the store is read-only so the update fails after a full download.
Solution
[cli] update_check, alsoLSTK_UPDATE_CHECK:promptnotifyoffExternally-managed installs default to
notifyand name the manager rather than advisinglstk update.lstk updaterefuses on them (--forceoverrides); an explicitlstk updateandlstk update --checkare never gated by the setting.Prompt: before / after
[S] Skip this version— per-version, buys days[N] Never ask again— persistsupdate_check = "notify"[S]is removed rather than kept alongside[N]: it is the option the ticket says does not solve the problem, it was the third way to say "no" on one prompt, and it was the only per-version persisted state — a stale skip silenced evennotifymode.cli.update_skipped_versiongoes with it; a leftover key is inert.Docs
Docs needed
New user-facing surface to document:
[cli] update_checkconfig key and theLSTK_UPDATE_CHECKenvironment variable (prompt/notify/off), and that neither gates an explicitlstk update.notifyand are not updated in place;lstk update --forceoverrides.--jsongains theUPDATE_EXTERNALLY_MANAGEDerror code (docs/structured-output.mdupdated in this PR).[S] Skip this versionand gains[N] Never ask again.Manual testing (using fish shell) — 13 scenarios, all passing
Covered: each of the three modes; env var overriding config; an invalid value rejected rather than coerced; a mise install naming the manager in its note;
lstk updaterefusing on mise and nix (plain and--json); a read-only install directory refused;update --checkstill working underoff;[N]persistingupdate_check = 'notify'and the next run only noting; the first-run prompt omitting[N]; and a mise install refusing to prompt even under an explicitprompt.To replicate. Build a version-stamped binary (a
devbuild skips the check entirely) and point Docker at nothing, sostartemits the update output and then fails at the health check without starting an emulator:Pressing
[U]performs a real download; setLSTK_UPDATE_GITHUB_API_ENDPOINTandLSTK_UPDATE_GITHUB_DOWNLOAD_ENDPOINTto a dead address to make it inert.Open questions
Where the update prompt sits in the start flow.
NotifyUpdateruns as the first action of the start goroutine, ahead of the Docker health check, auth, and the emulator picker. On a genuine first runconfig.tomldoes not exist yet — the picker creates it — so[N]has nowhere to persist and is omitted rather than offered and silently dropped:The trade-off: moving the notification after the picker would make
[N]available on every run, but prompting early is worth more — a user on an old or broken CLI should be offered the update before the CLI attempts real work, and a late prompt would be preempted by exactly the Docker failure an update might fix. The gap is narrow, since a first run almost always means a fresh install already on the latest version. Deliberately left as is; flagging it for a second opinion.Review
Worth a human review. New user-facing surface (config key, env var, flag, error code) and a changed prompt, plus one behaviour change that is not opt-in: a detected mise/nix/asdf install silently defaults to
notify.Automatic detection of externally managed (e.g., mise package installer) provides convenience by default, but add a bunch of complexity. The alternative would be solely relying on manual configuration.
Openspec preview: https://github.com/localstack/lstk/tree/7838fda1ee900535f4375f612919153606c1684b/openspec/changes/add-update-check-config
Related
#465 was an earlier, independent attempt at the same design, closed 2026-08-25.
#482 extending updates for extensions
Closes DEVX-1029