Skip to content

feat(snapshots): Download via archive endpoint with build-and-poll#3344

Merged
NicoHinderling merged 1 commit into
masterfrom
nico/feat/snapshots-archive-endpoint
Jun 25, 2026
Merged

feat(snapshots): Download via archive endpoint with build-and-poll#3344
NicoHinderling merged 1 commit into
masterfrom
nico/feat/snapshots-archive-endpoint

Conversation

@NicoHinderling

Copy link
Copy Markdown
Contributor

The server-side snapshot download/ endpoint was removed and replaced by an archive/ endpoint that separates archive creation from download. A GET .../archive/ probes readiness ({"ready": bool}), a POST .../archive/ triggers an async build (202), and GET .../archive/?download streams the zip once it exists.

snapshots download now 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-id and --app-id resolution, since the latter just resolves to a snapshot id first.

The build-and-poll loop is the new behavior worth reviewing — wait_for_archive in src/commands/snapshots/download.rs. Integration tests cover the two distinct paths: archive already ready (no build triggered) and not-ready (build + poll + download).

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 887ffc2

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.
@NicoHinderling NicoHinderling force-pushed the nico/feat/snapshots-archive-endpoint branch from 02ef040 to 887ffc2 Compare June 24, 2026 21:00
@NicoHinderling NicoHinderling marked this pull request as ready for review June 24, 2026 21:01
@NicoHinderling NicoHinderling requested review from a team and szokeasaurusrex as code owners June 24, 2026 21:01

@szokeasaurusrex szokeasaurusrex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, but I would consider adding parameters to override the timeout and possibly also the polling interval

@NicoHinderling

Copy link
Copy Markdown
Contributor Author

Lgtm, but I would consider adding parameters to override the timeout and possibly also the polling interval

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..

@NicoHinderling NicoHinderling merged commit 8788954 into master Jun 25, 2026
29 checks passed
@NicoHinderling NicoHinderling deleted the nico/feat/snapshots-archive-endpoint branch June 25, 2026 13:58
@szokeasaurusrex

Copy link
Copy Markdown
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

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.

2 participants