feat(snapshots): Download via archive endpoint with build-and-poll#3344
Merged
Conversation
Contributor
|
The server-side snapshot download/ endpoint was removed and replaced by an
archive/ endpoint that splits archive creation from download: a GET probes
readiness ({ready: bool}), a POST triggers an async build (202), and
GET ?download streams the zip once built.
Update snapshots download to match: probe readiness, trigger a build when not
ready, poll until ready (2s interval, 300s timeout), then download and extract
as before. Works for both --snapshot-id and --app-id resolution.
02ef040 to
887ffc2
Compare
szokeasaurusrex
approved these changes
Jun 25, 2026
szokeasaurusrex
left a comment
Member
There was a problem hiding this comment.
Lgtm, but I would consider adding parameters to override the timeout and possibly also the polling interval
Contributor
Author
Most of the time this polling should only happen once or twice before succeeding so it should be really fast Also i dont think this feature will get a ton of usage so im inclined to not worry too much about such customization.. |
Member
|
@NicoHinderling fair enough, but if we expect it to complete quickly, we might want to lower the timeout to just 10-20 seconds. But not a huge deal if it is not expected to be used widely |
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 server-side snapshot
download/endpoint was removed and replaced by anarchive/endpoint that separates archive creation from download. AGET .../archive/probes readiness ({"ready": bool}), aPOST .../archive/triggers an async build (202), andGET .../archive/?downloadstreams the zip once it exists.snapshots downloadnow matches that flow: it probes readiness, triggers a build when the archive isn't ready, polls until ready (2s interval, 300s timeout), then downloads and extracts as before. This applies to both--snapshot-idand--app-idresolution, since the latter just resolves to a snapshot id first.The build-and-poll loop is the new behavior worth reviewing —
wait_for_archiveinsrc/commands/snapshots/download.rs. Integration tests cover the two distinct paths: archive already ready (no build triggered) and not-ready (build + poll + download).