Releases: redirect without downloading the artifact - #75
Merged
Merged
Conversation
The latest-artifact redirects fetched the whole object on every cache miss to compare it with its .sha256 sidecar. Several concurrent misses on staging pulled multiple recovery images at once, the instance was marked unhealthy and the requests failed with 504. The sidecar is written by the release script that uploads the file, and the sync script verifies hash and signature when it registers a release, so a second check at request time added nothing. Check that the object exists and redirect.
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e554314. Configure here.
adamshiervani
marked this pull request as ready for review
September 18, 2026 20:14
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
/releases/app/latestand/releases/system_recovery/latestdownloaded the whole artifact on every cache miss to compare it with its.sha256sidecar, then redirected.Found on staging: four concurrent redirect requests during
scripts/compare-releases.shmade the instance download several recovery images at once, the platform marked it unhealthy, and the requests came back as504 no_healthy_upstream. One at a time they pass.Verification at request time bought nothing: the sidecar is written by the same release script that uploads the file, and
sync-releases.tsverifies hash and GPG signature when it registers a release. The redirect now only checks the object exists.Tests: the two "hash does not match" cases are gone with the behaviour; the "file missing" cases mock
HeadObjectinstead ofGetObject.Net: +18 / −102.
Note
Medium Risk
Redirect paths no longer detect tampered or corrupt objects at request time; clients rely on publish/sync verification and downstream download checks instead.
Overview
Latest redirect endpoints (
/releases/app/latestand/releases/system_recovery/latest) no longer download the full artifact plus its.sha256sidecar on cache misses to runverifyHash. They now onlyHeadObjectvias3ObjectExistsand return a 302 when the object is present.This avoids concurrent redirect traffic pulling large recovery images through the API (which caused staging 504 / unhealthy upstream). Integrity is documented as enforced at publish (release script writes the sidecar) and sync (
sync-releases.tsverifies hash and signature), not on every redirect.Tests drop the hash mismatch → InternalServerError cases, mock HeadObject for existence in legacy redirect helpers, and assert NotFound when HeadObject returns 404 instead of missing GetObject bodies.
Reviewed by Cursor Bugbot for commit e554314. Bugbot is set up for automated code reviews on this repo. Configure here.