Skip to content

ci: the story-tree step uses its job's scope and skips a head that predates it - #9121

Merged
cixzhang merged 1 commit into
mainfrom
fix/ci-story-tree-step-own-scope
Oct 31, 2026
Merged

cixzhang merged 1 commit into
mainfrom
fix/ci-story-tree-step-own-scope

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Maintainer impact

Main is red, and every open pull request branched before #8509 fails build. #8509 added a "Check the story tree" step to build-storybook, and it merged right after #8918 and #8919 moved scope decisions from the removed check-scope job to each job's own steps.scope outputs. Two things follow:

  • The new step gates on 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-storybook builds 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 the A11y/ 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:

  • its if: reads steps.scope.outputs.*, like every other step in the job;
  • if the checked-out head's story-tree test doesn't know the A11y/ fixture root (no FIXTURE_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

  • Failure before the change: main push run at d29fe0f, test-node shards 1 and 4 fail the CI routing test as quoted above; a pull request run at a pre-test(storybook): run the story-tree check where Storybook is built, and bring the tree back to its shape #8509 head fails build-storybook at "Check the story tree" with the old test's messages.
  • Success after the change: pnpm exec vitest run --project node .github/scripts passes (1537 tests, including the CI routing tests); actionlint no longer reports the undefined check-scope property.
  • Product/runtime behavior verified unchanged: no source change.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node .github/scripts
  • actionlint .github/workflows/ci.yml

Credit: 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.

…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.
@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Error Error Oct 31, 2026 8:45am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 31, 2026
@astracat-bot

astracat-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 31, 2026, 8:58 AM UTC

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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]

Comment thread .github/workflows/ci.yml
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@cixzhang
cixzhang merged commit eae5d92 into main Oct 31, 2026
53 of 54 checks passed
@cixzhang
cixzhang deleted the fix/ci-story-tree-step-own-scope branch October 31, 2026 09:09

This branch had an error being deployed

1 failed deployment
Preview — c5ba33a5 Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant