feat(selfupdate): X8 — throttled, fail-silent update notifier (spec 14) - #25
Merged
Conversation
selfupdate.Notifier prints a one-line "new release available" notice after a
command, wired into the CLI root's PersistentPostRun (stderr). It is:
- throttled — hits GitHub at most once per 24h, caching {checkedAt,latest} under
the XDG cache dir; within the TTL it reads the cache (no network).
- fail-silent — any error (offline, rate limit, bad cache) yields no notice and
never affects the command's exit.
- quiet by default where it should be — skipped for --json/--quiet output, for
dev/dirty builds (no clean semver to compare), and when
DEVSTACK_NO_UPDATE_NOTIFIER is set.
- bounded — the refresh check runs under a 2s context timeout.
Unit-tested with an injected clock + check fn + temp cache: notice-when-newer,
silent-when-current, cache throttle (1 network call within TTL, refresh after),
fail-silent on error, dev-build skip, env opt-out.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chunk X8 (M6)
selfupdate.Notifierprints a one-line "new release available" notice after a command (CLI rootPersistentPostRun, stderr):{checkedAt,latest}under the XDG cache dir; within the TTL it reads the cache (no network).--json/--quiet, dev/dirty builds (no clean semver), andDEVSTACK_NO_UPDATE_NOTIFIER.Tests
Injected clock + check fn + temp cache: notice-when-newer, silent-when-current, cache throttle (1 call within TTL, refresh after), fail-silent, dev-build skip, env opt-out.
Gate
make ci+make smokegreen (dev/stamped builds stay silent).🤖 Generated with Claude Code