Skip to content

Catch outdated catalogs to the left of CI#221

Open
thashepherd wants to merge 2 commits intostorybookjs:mainfrom
thashepherd:prevent-bump-ci-failure
Open

Catch outdated catalogs to the left of CI#221
thashepherd wants to merge 2 commits intostorybookjs:mainfrom
thashepherd:prevent-bump-ci-failure

Conversation

@thashepherd
Copy link
Copy Markdown

@thashepherd thashepherd commented Apr 28, 2026

Summary

image

Many of these failures are due to catalogs being out of date:

image

Easy to catch; I added a pre-push hook to catch outdated catalogs and a bump:catalog script that uses taze to automate the fix.

I don't believe that this change requires a changeset. Claude's PR summary follows.

Details

  • Adds husky-managed git hooks: pre-commit runs lint-staged (oxfmt + oxlint on staged files); pre-push runs taze --fail-on-outdated against the Storybook catalog and blocks pushes when it''s stale.
  • Adds pnpm bump:catalog — wraps taze to refresh @storybook/* + storybook + eslint-plugin-storybook to their @next versions in pnpm-workspace.yaml, then runs pnpm install.
  • Updates apps/internal-storybook/tests/check-deps.e2e.test.ts failure message to suggest pnpm bump:catalog instead of the old hand-rolled sed recipe.
  • Bumps the catalog from 10.4.0-alpha.810.4.0-alpha.10 (separate commit) so the new pre-push hook is satisfied.
  • Drops the . arg from format / format:check so lint-staged can pass staged file paths through cleanly.

Why

apps/internal-storybook/tests/check-deps.e2e.test.ts has been red on main for several builds because the Storybook @next train advances faster than someone manually edits the catalog. Until now there was no in-repo command for fixing it. This adds a fix command and an earlier feedback loop so devs see drift before CI does.

Notes

Human again here. I found a small bug in taze while setting this up and created an issue, antfu-collective/taze#260. It's the reason why we have to use

"bump:catalog": "pnpm dlx taze next --include \"@storybook/*,storybook,eslint-plugin-storybook,pnpm\" --include-locked -w && pnpm install",

instead of

"bump:catalog": "pnpm dlx taze next --include \"@storybook/*,storybook,eslint-plugin-storybook\" --include-locked -w && pnpm install",

Test plan

  • CI runs cleanly on this branch (the catalog bump should make check-deps.e2e.test.ts pass)
  • Editing a staged .ts file and running git commit triggers pre-commit auto-format / lint
  • Pushing without bumping a stale catalog is blocked by pre-push with a taze diff

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

⚠️ No Changeset found

Latest commit: 27b4286

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 28, 2026

Deploy Preview for storybook-mcp-self-host-example canceled.

Name Link
🔨 Latest commit 27b4286
🔍 Latest deploy log https://app.netlify.com/projects/storybook-mcp-self-host-example/deploys/69f3b1a4e27b5400081f67de

@thashepherd thashepherd changed the title Prevent CI failure on Storybook catalog drift Catch outdated catalogs to the left of CI Apr 28, 2026
@thashepherd thashepherd marked this pull request as ready for review April 28, 2026 02:45
Copilot AI review requested due to automatic review settings April 28, 2026 02:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds local guardrails to catch “outdated Storybook catalog” drift before CI by introducing git hooks, a bump:catalog helper script, and updating the dependency-check E2E error message; also bumps the Storybook catalog versions to satisfy the new checks.

Changes:

  • Add Husky-managed pre-commit (lint-staged) and pre-push (taze fail-on-outdated) hooks.
  • Add pnpm bump:catalog script (taze-based) and adjust formatting scripts to support lint-staged file arguments.
  • Update internal Storybook dependency-check test messaging and bump Storybook-related catalog versions/lockfiles.

Reviewed changes

Copilot reviewed 5 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Bumps Storybook catalog entries to 10.4.0-alpha.10.
pnpm-lock.yaml Adds Husky/lint-staged to root dev deps; lockfile updates.
packages/addon-mcp/pnpm-lock.yaml Propagates Storybook catalog bump to package lockfile.
eval/pnpm-lock.yaml Propagates Storybook catalog bump to eval lockfile.
apps/internal-storybook/pnpm-lock.yaml Propagates Storybook catalog bump to internal Storybook lockfile.
package.json Adds bump:catalog, Husky/lint-staged config, and adjusts format scripts.
apps/internal-storybook/tests/check-deps.e2e.test.ts Updates failure instructions to pnpm bump:catalog.
.husky/pre-commit Runs lint-staged on commit.
.husky/pre-push Runs taze outdated check on push.
Files not reviewed (4)
  • apps/internal-storybook/pnpm-lock.yaml: Language not supported
  • eval/pnpm-lock.yaml: Language not supported
  • packages/addon-mcp/pnpm-lock.yaml: Language not supported
  • pnpm-lock.yaml: Language not supported

Comment thread .husky/pre-push Outdated
Comment thread .husky/pre-push Outdated
Comment thread .husky/pre-commit
Comment thread .husky/pre-push Outdated
thashepherd and others added 2 commits April 30, 2026 15:44
* pre-commit runs lint-staged (oxfmt + oxlint on staged files)
* pre-push runs taze --fail-on-outdated, catching Storybook
  catalog drift before CI does
* `pnpm bump:catalog` refreshes the Storybook catalog from @next
  via taze; the include filter contains `pnpm` to dodge
  antfu-collective/taze#260
* check-deps.e2e.test.ts error message now points at the new
  script instead of a hand-rolled sed
* format/format:check drop the `.` arg so lint-staged can pass
  staged file paths through cleanly

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 30, 2026 19:46
@thashepherd thashepherd force-pushed the prevent-bump-ci-failure branch from 4db0349 to 27b4286 Compare April 30, 2026 19:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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.

2 participants