Skip to content

v0.2.2: passive update-availability nudge - #22

Merged
sbroenne merged 1 commit into
mainfrom
update-nudge
Jul 10, 2026
Merged

v0.2.2: passive update-availability nudge#22
sbroenne merged 1 commit into
mainfrom
update-nudge

Conversation

@sbroenne

Copy link
Copy Markdown
Owner

Summary

Adds a passive update-availability nudge (the DIY option, notify-only — no self-swap of the binary). Ships as v0.2.2.

When adomd runs interactively, it does a best-effort check against the GitHub Releases API and, if a newer release exists, prints a single line to stderr:

adomd: version 0.2.3 is available (you have 0.2.2). https://github.com/sbroenne/adomd-cli/releases/tag/v0.2.3
adomd: set ADOMD_NO_UPDATE_CHECK=1 to silence this check.

Design guarantees

  • Never touches stdout — JSON output is unaffected.
  • Throttled to at most one network call per day; result cached in %LocalAppData%\adomd-cli\update-check.json.
  • Fast/safe — 2s HTTP timeout, every failure swallowed (offline, rate-limited, etc.).
  • Automation-friendly — auto-suppressed when stderr is redirected (scripts/CI), and hard opt-out via ADOMD_NO_UPDATE_CHECK=1.
  • No binary swapping — it only tells you; you download and replace adomd.exe yourself. Reuses the existing GitHub Releases + SHA256 infrastructure.

Tests

  • 72 tests total (+10). New coverage: tag parsing (v-prefix, pre-release/build metadata stripping), version comparison, and the opt-out/redirect gating logic.

Verification

  • Build clean, dotnet format clean, 72/72 tests pass.
  • Confirmed the live GitHub API returns a parseable tag (v0.2.1) and that probe stdout stays clean, parseable JSON with the notifier wired in.
  • Note: the stderr line is intentionally suppressed when stderr is redirected, so it doesn't appear in captured/CI output by design — the gating and parse/compare logic are covered by unit tests instead.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

Add UpdateNotifier: a best-effort, fail-silent check that prints a
one-line 'newer version available' notice to stderr when run
interactively. Throttled to once/day (cached under %LocalAppData%),
tight HTTP timeout, never touches stdout, suppressed when stderr is
redirected, and disabled via ADOMD_NO_UPDATE_CHECK. Pure version
parse/compare and opt-out gating are unit tested (72 tests total).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sbroenne
sbroenne merged commit 9d64873 into main Jul 10, 2026
3 checks passed
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.

1 participant