feat(artifacts): follow signed-URL delivery for artifact and HTML report downloads#88
Open
riglar wants to merge 1 commit into
Open
feat(artifacts): follow signed-URL delivery for artifact and HTML report downloads#88riglar wants to merge 1 commit into
riglar wants to merge 1 commit into
Conversation
…ort downloads The dcd API can now deliver artifact bundles and HTML report ZIPs as pre-signed object-storage URLs instead of proxying the bytes (devicecloud-dev/dcd#1124), cutting its egress and memory. Opt in by sending delivery:'url' on POST /results/:uploadId/download and ?delivery=url on GET /results/:uploadId/html-report, then follow the returned { url } (no auth headers — it's pre-signed). Backwards and forwards compatible: an older API ignores the extra field/param and streams the ZIP inline (detected via content-type), and a 501 (API supports url delivery but storage unconfigured) falls back to an inline request. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
Client side of devicecloud-dev/dcd#1124 (API PR: devicecloud-dev/dcd#1128).
Why
The dcd API previously assembled artifact/report ZIPs in memory and streamed them through itself — ~558 GB/month of its egress and the dominant driver of its memory footprint. The API now supports assembling the bundle into object storage and returning a pre-signed URL, so the download bypasses the API entirely.
What
downloadArtifactsZipsendsdelivery: 'url'onPOST /results/:uploadId/download;downloadReportGenericadds?delivery=urlonGET /results/:uploadId/html-report(html only — junit stays inline, allure is a separate endpoint untouched by the API change).followSignedUrlDeliveryhelper: a JSON response (content-typesniff) means signed-URL delivery — parse{ url }, fetch it without auth headers (it's pre-signed), and stream to disk. Any other content-type is the ZIP itself, streamed exactly as before.deliveryfield sent, API streams inline (still streamed server-side, so the memory win applies regardless).Testing
test/unit/report-download.service.test.ts{ url }, asserts auth headers are not sent to storage, file lands on disk) and the 501 inline fallbackpnpm typecheck,pnpm lint(32 warnings, same as baseline), fullpnpm testsuite: 169 passing🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.