Repository navigation
Self-update: check, download on click, restart into the new release - #294
Merged
Merged
Conversation
The release workflow compiles the manifest URL into its builds (only those update themselves) and publishes update-manifest.json, listing URL, sha256 and size of every zip.
…, cleanup Layer 0 mechanics of the self-update: an interrupted download resumes with Range, network and server errors are retried with backoff, the result is checked against the manifest's size and sha256. Installing extracts next to the installation and renames into place: the whole bundle on macOS (after codesign verification and a team check), the executable elsewhere (on Windows the running exe is renamed away first).
…into it code_assistant_core::updates::UpdateService checks 15 s after start and every 4 hours, keeps the state (available, downloading, downloaded, installing, plus the last error per step) and publishes it as an app-scoped UiEvent. At start it removes downloads of versions not newer than the running one and notices an install that did not apply. The GPUI title bar shows a chip while a newer release is in sight: a click downloads it, then restarts into it (asking first while sessions are working). Failed checks stay out of the title bar; the About dialog shows the state and checks by hand.
The label stays "Downloading", so the chip keeps its width; the ring is the context indicator's, the percentage moved to the tooltip.
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.
The GPUI app now updates itself from GitHub releases, modelled on T3 Code. When a newer release is out, a chip appears in the title bar. A click downloads it, and a second click restarts the app into it.
docs/self-update.mddescribes the design.Releases
update-manifest.jsonwith the version and each archive's URL, sha256 and size (scripts/update-manifest.sh).…/releases/latest/download/update-manifest.json) into its builds throughCODE_ASSISTANT_UPDATE_FEED. Only those builds update; localcargo builds show "Disabled" and keep their binary. The feed is a plain download rather than the REST API, so the 60 requests/hour limit doesn't apply.CODE_ASSISTANT_UPDATE_FEEDoverrides the feed, andCODE_ASSISTANT_DISABLE_AUTO_UPDATEturns updates off.app_updatecrate (layer 0).partfile. Every new attempt resumes withRange(206 appends, 200 starts over, 416 discards the part). Network errors, 5xx, 408 and 429 are retried up to 5 times with backoff. Size and sha256 are verified at the end.dittoextraction,codesign --verify --deep --strict, and the same TeamIdentifier as the running app.*.oldand removed on a later start.from→target) lets the next start tell whether the update applied.UpdateService(core)VoiceService. It checks 15 s after start and then every 4 hours, and on request.UiEvent::UpdateStateChanged.GPUI
set_restart_pathon the installed path.Verification
cargo fmt --check,cargo clippy --all-targets --all-features -D warningsandcargo deny checkare clean, and the workspace tests pass.app_updateruns against a local axum server: resume, ignored Range, 416, retries, fatal statuses, checksum..appbundle in the running app (the live run updated a plain executable; the bundle swap is unit-tested).Known gaps