✨ Resolve screenshot SHAs before byte upload#299
Merged
Conversation
Use the screenshot create endpoint as the CLI upload primitive so existing storage can be reused without sending image bytes. Keep byte upload as the fallback for old servers and transient failures while still surfacing auth and ownership errors.
Vizzly - Visual Test ResultsCLI Reporter - Waiting for buildNo builds received yet for this pull request.
|
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.
Why
Screenshot upload is one of Vizzly's hottest SDK paths. When a build captures thousands of screenshots, sending image bytes for files we already have in storage is wasted work for the CLI, API, and object storage.
The paired Vizzly API change lets the screenshot create endpoint accept
sha256withoutimage_data, resolve reusable storage server-side, and only ask for bytes when the image is missing. This CLI change moves the per-screenshot upload path to that contract.Approach
upload_required: false, preserving the existing skipped/fromExisting result shape for callers.image_data.--upload-allstill forces screenshots through.This keeps the CLI simple: no SDK-side batching, no client-side cache, and no extra state to recover from. The API stays authoritative about whether a screenshot can reuse existing storage.
Confidence
The API payload helper now has a pure test proving SHA resolution omits image bytes. The upload endpoint tests cover resolve misses, resolve hits, old-server fallback, auth failure, and
--upload-all. The full CLI test suite and Biome lint pass locally.Related
vizzly-testing/vizzly#543, which adds the server-side create-with-SHA behavior.