ci: gate the Storybook build - #7
Merged
Merged
Conversation
Nothing checked that packages/web's Storybook still builds, and the artifacts lie about it: `storybook build` writes index.json and iframe.html even when it fails partway, so a broken build is byte-indistinguishable from a working one and the only signal is the exit code. mux-magic's Storybook sat broken on two branches for exactly that reason. It matters past this repo too — storybook.octen.dev composes this build as a ref, and its build.sh answers a failed ref by keeping the previous output and logging a warning. A Storybook that stops building goes stale in the composed sidebar rather than disappearing from it. Also asserts a floor on the indexed entry count, for the build that succeeds with an empty index because the stories glob stopped matching. Not in docker-deploy's `needs`: Storybook is a dev preview and is not in the runtime image. Co-Authored-By: Claude Opus 5 (1M context) <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.
The gap
ci.ymlran typecheck / unit-tests / docker-deploy. Nothing checked thatpackages/web's Storybook still builds.Why it matters
storybook buildwritesindex.jsonandiframe.htmleven when it fails partway. A broken build is byte-indistinguishable from a working one; the only signal is the exit code. mux-magic's Storybook sat broken on two branches for exactly that reason (MDX importing@storybook/blocks, removed in Storybook 9) while still producing a plausible static site.It matters past this repo:
storybook.octen.devcomposes this build as a ref (storybook-container/refs.json→castkit/packages/web), and itsbuild.shanswers a failed ref by keeping the previous output and logging a warning nobody reads. A Storybook that stops building does not vanish from the composed sidebar — it silently goes stale.What this adds
build:storybookscript (delegates to@castkit/web build-storybook), matching the repo's existingdev:server/start:prodroot-delegate pattern so the gate is one command locally too.storybookCI job:yarn build:storybook, then an assert that the index is not empty. That second check is the sibling false-green — a build that succeeds with an empty index because thestories:glob inpackages/web/.storybook/main.tsstopped matching. Floor of 4 against a current 6; it catches the glob dropping out, not each story added.Deliberately not in
docker-deploy'sneeds. Storybook is a dev preview and is not in the runtime image; the views it renders are already covered for the deploy bytypecheck+unit-tests. A story-only or.storybook-only break should read as its own red check without holding back the server image. (This differs from charcuterie, where the Storybook gate does join the release gate — there the published artifact is the components themselves.)Verified
Built clean on
masterbefore the change: exit 0, 6 entries, 2.5s. The current Storybook is not broken — the gap was purely that nothing was checking.Per
AGENTS.mdthis repo's convention is pushing straight tomaster; this PR is paper-trail and can merge as soon as CI is green.🤖 Generated with Claude Code