Skip to content

feat: self-update command + background update notification - #509

Merged
ajianaz merged 2 commits into
developfrom
feat/upgrade-command-508
Aug 6, 2026
Merged

feat: self-update command + background update notification#509
ajianaz merged 2 commits into
developfrom
feat/upgrade-command-508

Conversation

@ajianaz

@ajianaz ajianaz commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

What

Add cora upgrade command 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 binary
  • Background notification — non-blocking std::thread::spawn on every command run, cached 24h at ~/.codecora/cora-code/update-cache.json, prints banner if update available
  • Uses async reqwest (not reqwest::blocking like uteke) since cora-code main is async
  • Version comparison normalizes GitHub tag prefix (v0.13.00.13.0)

Usage

cora upgrade --check   # Check only, no download
cora upgrade           # Interactive [y/N] prompt
cora upgrade --yes     # Auto-confirm (CI/automation)

Disable Background Notification

Config (~/.cora/config.yaml):

update_check: false

Environment:

export CORA_NO_UPDATE_CHECK=1

Testing

  • cargo test passes (22/22: 16 unit + 6 config)
  • cargo fmt --all -- --check passes
  • cargo clippy passes (0 warnings)
  • cargo build passes
  • Manual smoke-test: cora upgrade --check correctly detects v0.13.0 as latest, shows "Already up to date"
  • cora upgrade --help shows --yes and --check flags
  • cora --help shows upgrade command in list
  • cora upgrade --yes full download + replace (needs new release to test)

Related Issues

Closes #508

Checklist

  • Branch name follows convention (feat/upgrade-command-508)
  • Branch is from develop
  • Commit messages follow Conventional Commits
  • No secrets or credentials committed
  • One logical change per PR (no mixed concerns)

ajianaz added 2 commits August 6, 2026 09:33
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
@ajianaz
ajianaz merged commit cfe5cfe into develop Aug 6, 2026
15 of 16 checks passed
@ajianaz
ajianaz deleted the feat/upgrade-command-508 branch August 6, 2026 02:55
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.

feat: self-update command + startup update notification

1 participant