feat: self-update command + background update notification - #509
Merged
Conversation
Add command for self-updating the binary: - — check + interactive [y/N] prompt - — auto-confirm (CI/automation) - — check only, no download Background startup notification: - Non-blocking check on every command run (cached 24h) - Cache stored at ~/.codecora/cora-code/update-cache.json - Disable via config: update_check: false - Disable via env: CORA_NO_UPDATE_CHECK=1 Implementation: - GitHub 302 redirect parsing (no API rate limit) - SHA256 checksum verification - Binary smoke-test post-download - Atomic rename for safe replacement - Version normalization (strip 'v' prefix) Closes #508
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.
What
Add
cora upgradecommand for self-updating the binary, plus background startup notification that alerts users when a new release is available.Why
Cora-code has no update mechanism — users must manually check GitHub releases and re-download. This creates version fragmentation and friction. Closes #508.
How
cora upgrade— fetches latest release from GitHub (302 redirect parsing, no API rate limit), downloads tarball, verifies SHA256 checksum, smoke-tests binary, atomically replaces running binarystd::thread::spawnon every command run, cached 24h at~/.codecora/cora-code/update-cache.json, prints banner if update availablereqwest::blockinglike uteke) since cora-code main is asyncv0.13.0→0.13.0)Usage
Disable Background Notification
Config (
~/.cora/config.yaml):Environment:
export CORA_NO_UPDATE_CHECK=1Testing
cargo testpasses (22/22: 16 unit + 6 config)cargo fmt --all -- --checkpassescargo clippypasses (0 warnings)cargo buildpassescora upgrade --checkcorrectly detects v0.13.0 as latest, shows "Already up to date"cora upgrade --helpshows--yesand--checkflagscora --helpshowsupgradecommand in listcora upgrade --yesfull download + replace (needs new release to test)Related Issues
Closes #508
Checklist
feat/upgrade-command-508)develop