feat: opt-in Storybook bundle upload for per-build hosting (PER-8973) - #1341
Draft
Shivanshu-07 wants to merge 5 commits into
Draft
feat: opt-in Storybook bundle upload for per-build hosting (PER-8973)#1341Shivanshu-07 wants to merge 5 commits into
Shivanshu-07 wants to merge 5 commits into
Conversation
Adds storybook.uploadBundle config + --upload-bundle flag (default off; directory mode only). After the snapshot run, zips storybook-static and uploads to percy-api for hosting. Best-effort: 200 MB cap (injectable) with an actionable error, capped exponential-backoff retries (~65s horizon, transient-only — a 4xx like feature_disabled is terminal), and a failure beacon (state_hint=failed) so client-side failures surface on the review page and in the success metric. 9 jasmine specs pass. Adds archiver + form-data deps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…8973) Replaces zip+POST with the CAS handshake: walk storybook-static, SHA-256 every file, POST /check (one call -> missing shas + signed PUT URLs with replay headers), PUT each missing blob DIRECTLY to GCS (bounded parallelism, replaying the signed x-goog-content-sha256 etc.), then POST /commit with the manifest. Dedup falls out of the missing-set; bytes never touch percy-api. Keeps opt-in gate, injectable caps, failure beacon (size_cap/client_failed), best-effort (never throws). Drops the archiver dep (no more zipping). 8/8 jasmine, eslint clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
POST each missing blob to the verifier upload URL returned by /check (with the X-Upload-Token + X-Expected-Sha), instead of PUT to a GCS signed URL. The verifier re-hashes and writes the CAS blob only if it matches. Tests updated (8/8 jasmine pass). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The final snapshot map already computes the Storybook-encoded args/globals query values for the capture URL; carry them (plus the story id) on the snapshot as the storybook property so @percy/client sends them to the API and the review UI can deep-link the hosted bundle to the exact captured variant (including additionalSnapshots args overrides). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…k args Storybook's URL parser decodes !true/!false to real booleans; a plain false would apply as the truthy string "false" and reproduce the wrong variant. Capture URLs are unchanged (capture applies args via channel events, not the URL). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
SDK side of per-build Storybook hosting (PER-8973). Part of a 4-repo feature — API + edge worker: percy/percy-api#6506; web: percy/percy-web (linked below).
Adds opt-in upload of the built
storybook-staticbundle to Percy for hosting:storybook.uploadBundleconfig +--upload-bundleflag, default off, directory mode only (no behavior change on upgrade)feature_disabledis terminal); failure beacon (state_hint=failed) so client-side failures surface on the review page and in the success metricTesting
Post-Deploy Monitoring & Validation
No additional operational monitoring requiredbeyond the API-side metrics — the SDK change is opt-in and best-effort; upload outcomes are tracked server-side (see the API PR).🤖 Generated with Claude Code