Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/storybook-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ jobs:
- name: Validate manifest matches design-system-mcp contract
run: node packages/design-system-mcp/scripts/validate-manifest.mjs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it ok that we're removing the smoke test on parseComponents?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah in my mind the validate-manifest.mjs was an initial-but-naive implementation of what this new snapshot approach handles more holistically. The previous script just checked that some components exist and are parseable, and was introduced originally to help protect against shape changes in the manifest. Since the new snapshot will similarly break when there are shape changes, it will serve as equal protection.

Although, now that I think of it, it could still have some value insofar as extending that coverage to how @wordpress/design-system-mcp parses the manifest, since that's separate logic that would also need to be updated. Maybe it's best to restore it after all 🙂

@aduth aduth Jul 30, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Restored the MCP validation in ccfc8f8.


# Regenerates the committed snapshot of components/props/descriptions
# from the freshly built manifest. Fails if a component or prop is
# newly missing a description (see the allowlist for known gaps).
- name: Generate manifest snapshot
run: npm run storybook:manifest-snapshot

# Fails when the generated snapshot or pruned allowlist differs from
# what's committed, surfacing documentation changes for sign-off.
# This is similar to the "Check local changes" step of the static
# checks workflow, but the other workflow does not build Storybook,
# which is an expensive operation and only happens here.
- name: Check manifest snapshot is up to date
run: |
if ! git diff --exit-code -- storybook/components-manifest.yml storybook/prop-description-allowlist.json; then
echo "::error::The Storybook manifest snapshot is out of date. Review the diff above to confirm the change is expected, then run 'npm run storybook:build && npm run storybook:manifest-snapshot' locally and commit the updated storybook/components-manifest.yml and storybook/prop-description-allowlist.json."
exit 1
fi

- name: Build E2E Storybook
env:
NODE_ENV: test
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"storybook:dev": "concurrently \"npm run dev\" \"wait-on .dev-ready && npm run --workspace @wordpress/storybook storybook:dev\"",
"storybook:e2e:dev": "concurrently \"npm run dev\" \"wait-on .dev-ready && npm run --workspace @wordpress/storybook-playwright storybook:dev\"",
"storybook:e2e:build": "npm run --workspace @wordpress/storybook-playwright storybook:build",
"storybook:manifest-snapshot": "npm run --workspace @wordpress/storybook manifest-snapshot",
"test": "npm-run-all lint test:unit",
"test:create-block": "npm run --workspace @wordpress/validation-tools test-create-block --",
"test:e2e": "npm exec --workspace @wordpress/e2e-tests-playwright -- wp-scripts test-e2e --config playwright.config.ts",
Expand Down
18 changes: 18 additions & 0 deletions storybook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,21 @@ The Gutenberg project uses Storybook to view and work with the UI components dev
View online at: https://wordpress.github.io/gutenberg/

Run locally in your development environment running: `npm run storybook:dev` from the top-level Gutenberg directory.

## Manifest snapshot regression testing

Storybook upgrades and inocuous code refactoring have been a frequent source of accidental documentation regressions, resulting in component or prop descriptions being accidentally removed.

To catch these, a consolidated snapshot of the components manifest is committed:

- `storybook/components-manifest.yml` is a list of each component and its props.
- `storybook/prop-description-allowlist.json` is a set of known components and props that are currently missing a description. The generator script fails on any new undocumented component or prop that isn't listed here, so this allowlist is expected to shrink over time.

Description text is not stored in the snapshot, since it is noisy to diff and increases the burden on developers. Instead, the snapshot reflects and enforces on presence rather than specific values.

When a snapshot changes due to code changes or Storybook upgrades, a pull request's checks will fail and expect the developer to commit the changes after acknowledging that they are expedcted:

```bash
npm run storybook:build
npm run storybook:manifest-snapshot
```
Loading
Loading