Skip to content

ci: gate the Storybook build - #7

Merged
Sawtaytoes merged 1 commit into
masterfrom
chore/ci-storybook-gate
Jul 31, 2026
Merged

ci: gate the Storybook build#7
Sawtaytoes merged 1 commit into
masterfrom
chore/ci-storybook-gate

Conversation

@Sawtaytoes

Copy link
Copy Markdown
Owner

The gap

ci.yml ran typecheck / unit-tests / docker-deploy. Nothing checked that packages/web's Storybook still builds.

Why it matters

storybook build writes index.json and iframe.html even 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.dev composes this build as a ref (storybook-container/refs.jsoncastkit / packages/web), and its build.sh answers 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

  • Root build:storybook script (delegates to @castkit/web build-storybook), matching the repo's existing dev:server / start:prod root-delegate pattern so the gate is one command locally too.
  • A storybook CI 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 the stories: glob in packages/web/.storybook/main.ts stopped matching. Floor of 4 against a current 6; it catches the glob dropping out, not each story added.

Deliberately not in docker-deploy's needs. Storybook is a dev preview and is not in the runtime image; the views it renders are already covered for the deploy by typecheck + 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 master before the change: exit 0, 6 entries, 2.5s. The current Storybook is not broken — the gap was purely that nothing was checking.

Per AGENTS.md this repo's convention is pushing straight to master; this PR is paper-trail and can merge as soon as CI is green.

🤖 Generated with Claude Code

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>
@Sawtaytoes
Sawtaytoes merged commit b44f7d3 into master Jul 31, 2026
4 checks passed
@Sawtaytoes
Sawtaytoes deleted the chore/ci-storybook-gate branch July 31, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant