feat(no-ticket): add update notifications and cloudsmith upgrade - #399
Draft
cloudsmith-iduffy wants to merge 1 commit into
Draft
feat(no-ticket): add update notifications and cloudsmith upgrade#399cloudsmith-iduffy wants to merge 1 commit into
cloudsmith upgrade#399cloudsmith-iduffy wants to merge 1 commit into
Conversation
The release workflow publishes a per-target install manifest to the public Cloudsmith raw repository with a versions/latest alias. The CLI now polls that manifest to learn the latest released version. A background thread refreshes a cached latest-version record at most once a day and a notice is printed on stderr when a newer version exists. The check rides alongside the command and waits at most one second at exit, at most once a day. It stays silent in CI, without a TTY, in JSON output modes, under `cloudsmith mcp`, and when CLOUDSMITH_NO_UPDATE_CHECK is set. All HTTP goes through the shared session so proxy and custom-CA setups keep working. `cloudsmith upgrade` (alias: `update`) detects the install channel. A standalone binary downloads the archive for its own target, verifies the manifest checksum and swaps the install directory atomically. The pip, pipx, uv, Homebrew, Docker and aqua channels get the exact upgrade command for that channel printed instead. Co-Authored-By: Claude Fable 5 <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.
Description
The CLI now tells users when a newer version exists and gives them a working path to it, whatever way they installed it.
The version metadata already existed: the release workflow publishes a per-target
manifest.txtraw package to the publiccloudsmith/clirepository, with aversions/latestalias (the Homebrew formula's livecheck polls it today). The CLI now polls the same endpoint — no server-side or workflow changes.Update notice. At most once a day, a daemon thread fetches the latest manifest alongside whatever command is running and caches
{checked_at, latest_version}in the app directory. When a newer version is cached, a two-line notice prints on stderr after the command. The check stamps the cache before fetching, waits at most one second at exit, and stays silent in CI, without a TTY, in-F jsonmodes (re-checked at close time, after the subcommand parses its own-F), undercloudsmith mcp, and whenCLOUDSMITH_NO_UPDATE_CHECK=1is set. All HTTP goes through the shared session, so proxies and custom CAs keep working. The startup-import guard stays green —requests/tomlkitare deferred.cloudsmith upgrade(aliasupdate). Detects the install channel:ghand rustup do.Channel detection: frozen builds by executable path (aqua dir, Homebrew Cellar, official container image layout —
/.dockerenv,/run/.containerenv, or Kubernetes env), Python installs via the distribution path andINSTALLERrecord.Type of Change
Additional Notes
Deliberately deferred: Windows self-swap, a channel-agnostic
metadata.jsonin the release workflow (room for announcements and minimum-version messaging), an embedded build-target file in the PyInstaller bundle, GPG verification of Linux archives during self-update, and a config-file key for the opt-out.Two behaviors to weigh in review: the notice also prints after a failing command, and it arms on
--help/--version. Both match npm-style update notifiers; easy to restrict if we'd rather not.Smoke-tested live: the manifest endpoint answers anonymously in about a second, and
cloudsmith upgradecorrectly reports up to date on 1.25.0.🤖 Generated with Claude Code