Repository navigation
ci: the story-tree step uses its job's scope and skips a head that predates it - #9121
Conversation
…edates it #8509 added the step after #8918/#8919 moved scope to each job's own steps.scope outputs, so it gated on the removed check-scope job (the CI routing test fails on main). build-storybook also builds the PR head, and a head that predates the check carries the earlier test, which rejects the A11y/ fixture root. The step now reads steps.scope and skips, visibly, a head whose story-tree test lacks FIXTURE_ROOT. Story-tree check by @vjeux in #8509.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
This looks good to merge. Moving the story-tree step onto steps.scope.outputs.* makes the three CI routing cases that fail on main pass, and a head from before #8509 now skips the step visibly instead of failing build. One optional hardening, here or in a follow-up: the skip is keyed on the identifier FIXTURE_ROOT in story-tree.test.ts and nothing pins that coupling, so a rename would quietly turn the check off everywhere; a small contract test like ci-rtl-d7.test.mjs would catch it.
[Automated review]
| if: steps.scope.outputs.docsite_only != 'true' && steps.scope.outputs.spec_only != 'true' && steps.scope.outputs.tooling_only != 'true' | ||
| run: | | ||
| STORY_TREE_TEST=apps/storybook/.storybook/story-tree.test.ts | ||
| if ! grep -q 'FIXTURE_ROOT' "$STORY_TREE_TEST"; then |
There was a problem hiding this comment.
Optional hardening: this skip is keyed on the identifier FIXTURE_ROOT, and neither story-tree.test.ts nor any test in .github/scripts records the coupling. If the constant is renamed or the test moves, the check stops running on every pull request, in the merge queue and on main, leaving only this notice. A contract test like ci-rtl-d7.test.mjs would pin it: the step names a real file, the file has the marker, the step skips without it and fails when the test fails.
Maintainer impact
Main is red, and every open pull request branched before #8509 fails
build. #8509 added a "Check the story tree" step tobuild-storybook, and it merged right after #8918 and #8919 moved scope decisions from the removedcheck-scopejob to each job's ownsteps.scopeoutputs. Two things follow:needs.check-scope.outputs.*, a job that no longer exists (actionlint:property "check-scope" is not defined). The CI routing test therefore fails on main's push run ("Check the story tree: expected 'needs.check-scope.outputs.docsite_only…' to contain 'steps.scope.outputs.tooling_only…'"), and the step can't skip for docsite-, spec- or tooling-only changes.build-storybookbuilds the pull request's head. A head that predates test(storybook): run the story-tree check where Storybook is built, and bring the tree back to its shape #8509 carries the earlier story-tree test, which also rejects theA11y/fixture root, so the step fails 37 + 8 titles on every such head ("not under one of Core, Lab, Charts, Vega, RichText").Intended invariant
The story-tree check runs where Storybook is built, on the same scope as its neighbours in
build-storybook(skipped for docsite-, spec- and tooling-only changes), and fails a pull request that adds a title outside the tree's shape. A pull request is never failed by a check its head predates; it skips visibly until it merges main, the same convention as the typecheck and RTL D7 steps.Change
One step in
.github/workflows/ci.yml:if:readssteps.scope.outputs.*, like every other step in the job;A11y/fixture root (noFIXTURE_ROOT), it prints a notice ("Head predates the story-tree check") and skips; otherwise it runs the test as before.No product code and no Changeset.
Evidence
build-storybookat "Check the story tree" with the old test's messages.pnpm exec vitest run --project node .github/scriptspasses (1537 tests, including the CI routing tests); actionlint no longer reports the undefinedcheck-scopeproperty.Scope
Testing
pnpm exec vitest run --project node .github/scriptsactionlint .github/workflows/ci.ymlCredit: the story-tree check is @vjeux's, from #8509; this only aligns its step with the current scope model and the predating-head convention.
Posted by Cindy's agent on her behalf.