CLI - Notify users if there's an update available#4363
Open
clockwork-labs-bot wants to merge 3 commits intomasterfrom
Open
CLI - Notify users if there's an update available#4363clockwork-labs-bot wants to merge 3 commits intomasterfrom
clockwork-labs-bot wants to merge 3 commits intomasterfrom
Conversation
Instead of duplicating release-checking logic in spacetimedb-cli, add the update notice to spacetimedb-update's proxy path. This runs before exec'ing the CLI, so users see the notice regardless of which CLI command they run. Uses the same GitHub releases API and mirror URL as spacetime version upgrade. Caches the result for 24 hours to avoid network overhead on every invocation. Network checks use a 5s timeout and are best-effort (failures are silently ignored). Closes #1822
8e5efe4 to
ad4ee26
Compare
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.
Summary
Adds a version update check to the
spacetimedb-updateproxy, so users are notified when a newer version of SpacetimeDB is available.Changes
Adds
crates/update/src/update_notice.rs— a lightweight update check that runs in the proxy path before exec'ing the CLI:~/.spacetime/.update_check_cache. Only hits the network once every 24 hours.SPACETIME_UPDATE_RELEASES_URLenv var asspacetime version upgrade.semvercrate (already a dependency).Output
When a newer version is available:
Design
Per @bfops's feedback: the check lives in
spacetimedb-update(the proxy binary) rather thanspacetimedb-cli, reusing the existing release infrastructure. Sincespacetimeis an alias forspacetimedb-updatewhich proxies to the CLI, this is the natural place for it.Closes #1822