Skip to content

ci: the Lab lane counts Lab samples and a Lab component's spec folder as Lab, runs lab:sync --check, and checks the route lock when a Lab doc changes - #13023

Draft
cixzhang wants to merge 4 commits into
ci/lab-syncfrom
ci/lab-lane-sync
Draft

cixzhang wants to merge 4 commits into
ci/lab-syncfrom
ci/lab-lane-sync

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Who this helps

Lab component authors, and everyone downstream of main. A Lab-only pull request for a component named for its own folder now stays in the fast Lab lane when it carries what a new component needs: its swizzle samples and its own spec folder, alongside its route entries. The lane also catches what #9832 slipped past: a missing sample or route entry fails on the pull request, naming the fix (pnpm lab:sync), instead of turning main red.

Record: AST-030 FR26 at #12985 12f9b7a.

Stacked on #13019 (pnpm lab:sync and packages/lab/swizzle-samples.mjs); the base is that branch, so this diff shows only the lane change. It retargets to main when #13019 merges.

What changes

.github/scripts/change-scope.cjs (the trusted classifier) adds two Lab entries:

  • packages/lab/swizzle-samples.mjs is a Lab entry. Before, it matched the package-root-script pattern, so a Lab-only change that added a sample ran the full suite.
  • docs/specs/components/<Name>/ is a Lab entry when <Name> is a Lab component folder the change carries; another component's spec folder is not.

Route-lock ownership is unchanged: a component named for its own folder owns its routes, and a family folder keeps the full suite (FR26). #9832's MediaPlayer folder, with AudioPlayer and VideoPlayer routes, stays mixed; a test pins that.

.github/workflows/ci.yml changes two steps:

  • "Lab-only: check the ShadCN route lock" (build-storybook) now runs checkShadcnRouteLock through generate-data.mjs whenever the change touches the lock, a Lab .doc.mjs (component or block), or a Lab index.ts. Before, it ran only when the lock changed, so a new Lab doc with no route entry passed the lane.
  • New "Lab-only: Lab sync check" (test-node, leg 1) runs node scripts/lab-sync.mjs --check. The swizzle samples test already runs on every Lab-only change as a source-reading guard; a test now pins that.

There is no generate-shadcn-registry.test.mjs step: it never reads the lock (lane 0's finding).

Tests (red first)

Before the change, the new classifier and workflow cases failed; with it, all pass.

  • change-scope.test.mjs, "a new Lab component with its samples and spec folder":
    • A component named for its folder is Lab-only and not full suite: Rating source and doc, Lab index.ts, a block, swizzle-samples.mjs, docs/specs/components/Rating/, a new story, its route and example entries, and a Changeset. This failed before the change.
    • Refused: another component's spec folder (also failed before).
    • feat(lab): add VideoPlayer and AudioPlayer media players #9832's family shape keeps the full suite.
  • ci-lab-only-routing.test.mjs, "a Lab-only doc change with an unchanged lock still runs the route-lock check": it runs the step's own script in a temporary git repository with a stand-in node. A source-only change skips the check; a Lab doc, block doc, Lab index.ts or lock change runs generate-data.mjs. It fails on today's step. Another case pins the Lab sync check step, and the fs-guard lister always lists samples.test.mjs.
  • ci-node-leg-bounds.test.mjs adds the new leg-1 step to its list.
  • All of .github/scripts/*.test.mjs plus the lab-sync and preflight tests: 2965 passed, 25 skipped.

CI impact

CI impact: on a Lab-only change, test-node leg 1 adds lab:sync --check (a few seconds), and the route-lock step now runs generate-data.mjs (about 1 to 2 minutes) whenever a Lab doc or index.ts changes, not only the lock. Other lanes are unchanged.

Overlap checked: #13019 (stacked: those 8 files are #13019's own diff, which this branch sits on; this PR edits only the 5 lane files)

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the drain's serial merge loop, after #13019, on green, CodeBunny approval and Specs' exact-head /approve-spec.

…d its docs' routes as Lab, runs lab:sync --check, and checks the route lock when a Lab doc changes
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 20, 2026 2:45pm UTC

Request Review

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

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 20, 2026, 2:48 PM UTC

@cixzhang cixzhang changed the title ci: the Lab lane counts Lab samples, a Lab component's spec folder and its docs' routes as Lab, runs lab:sync --check, and checks the route lock when a Lab doc changes ci: the Lab lane counts Lab samples and a Lab component's spec folder as Lab, runs lab:sync --check, and checks the route lock when a Lab doc changes Nov 19, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Outcome: this needs an engineering owner's decision, plus two blocking fixes.

Counting a Lab component's record folder as Lab, the new lab:sync --check step and the wider route-lock trigger follow the draft AST-030 FR26 amendment in #12985, not FR26 as it stands on main, which keeps a spec record beside Lab code mixed. Approval waits on an engineering owner deciding that amendment, by landing #12985 or by commenting /approve-spec <full head SHA> here (the author may do so as an engineering owner); the two fixes below are needed either way:

  • The new Lab entries never apply in CI, because .github/actions/test-scope/action.yml hands the classifier patches only for the route lock, official-packages.json and stories while isLabEntryChange refuses a file without a patch, so a new Lab component's pull request still runs the full suite and the title overstates the change; deciding these two entries by path before the patch guard, with an end-to-end case in test-scope-action.test.mjs, would fix it.
  • LAB_SPEC_DIR matches record folders by name alone, so a change to Lab's InfoTip or Chat folder plus Core's current InfoTip or Chat records would take the Lab-only lane instead of broad CI; match a record to its Lab component by content and add a refused InfoTip case.
Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • Title, the Lab lane counts Lab samples and a Lab component's spec folder as Lab: false in CI (action.yml:327, change-scope.cjs:164-172); true only when the classifier is called directly with every patch.
  • Title, runs lab:sync --check: verified (ci.yml:1835-1837; the check passes on this head).
  • Title, checks the route lock when a Lab doc changes: verified (ci.yml:2918; ci-lab-only-routing.test.mjs:148 runs the step's own script).
  • A Lab-only pull request for a component named for its own folder stays in the Lab lane with its samples and spec folder: false in CI, for the same reason.
  • A missing sample or route entry now fails a Lab-only pull request and names pnpm lab:sync: verified for Lab-only changes (ci.yml:1835-1837).
  • The samples file is a Lab entry, where before it matched the package-root-script rule and ran the full suite: the classifier change is verified (change-scope.cjs:172, :247), but in CI the full suite still runs.
  • A record folder counts only for a Lab component folder the change carries, and another component's does not: false for Lab folders named like Core components (InfoTip, Chat).
  • Route-lock ownership is unchanged and a family folder keeps the full suite: verified (change-scope.test.mjs:1022).
  • The route-lock step runs on a lock, Lab doc, block doc or Lab index.ts change: verified (ci.yml:2918, ci-lab-only-routing.test.mjs:148).
  • The swizzle samples test already runs on every Lab-only change as a source-reading guard, now pinned by a test: verified (ci-lab-only-routing.test.mjs:142; only the swizzle proof slices leave the Node legs).
  • No registry-generator test step is needed because that test never reads the lock: verified (the test names no lock path).
  • The Node leg bounds test lists the new step: verified (ci-node-leg-bounds.test.mjs:87).
  • The new tests were red first: verified (the head's three test files fail 5 cases on the base and pass all 135 on the head).
  • The full tally over the CI script tests: not reproduced; only the three changed test files were run.
  • CI impact (a few seconds for the sync check, one to two minutes for the route-lock step on doc changes, other lanes unchanged): step placement verified; timings not measured, as CI has not run on this head.
  • The pull request is stacked on the one that adds lab:sync, and this diff holds only the five lane files: verified.
  • The governing record is the FR26 amendment in a separate pull request: accurate, but that amendment is still an unapproved draft.

Files:

  • .github/scripts/change-scope.cjs: two blocking findings (the entries never reach CI; name-only record-folder match).
  • .github/scripts/change-scope.test.mjs: the new cases call the classifier with patches CI never supplies; add a refused InfoTip case.
  • .github/scripts/ci-lab-only-routing.test.mjs: clear (non-blocking: the route-lock test leaves its temporary directory behind).
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear.
  • .github/workflows/ci.yml: clear as code; its two Lab-only step changes wait on the FR26 decision.

Automated review (maintainer link)

)
return false;
const slugs = new Set([...names].map(labRouteSlug));
if (change.filename === LAB_SAMPLES) return true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI never reaches this line for the samples file or a record folder. The guard above refuses a file with no patch, and .github/actions/test-scope/action.yml passes patches only for the route lock, official-packages.json and stories (LAB_ENTRY), so in CI the new Rating fixture still classifies as mixed with the full suite. Decide these two entries by path before the patch guard (keeping the rename refusal), and add an end-to-end case to test-scope-action.test.mjs.

const slugs = new Set([...names].map(labRouteSlug));
if (change.filename === LAB_SAMPLES) return true;
const spec = LAB_SPEC_DIR.exec(change.filename);
if (spec) return names.has(spec[1]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This matches by folder name only. Lab's InfoTip (a deprecated re-export of Core InfoTip) and Chat folders share names with Core record folders, so packages/lab/src/InfoTip/index.ts plus Core's current docs/specs/components/InfoTip/InfoTip.spec.md classifies as Lab-only with no full suite. Match the record to the Lab component by content (for example, accept only an added record whose patch names packages/lab/src/<Name>/ and no packages/core/ path), and add a refused InfoTip case.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Outcome: this needs an engineering owner's decision, plus two blocking fixes.

Counting a Lab component's record folder as Lab, the new lab:sync --check step and the wider route-lock trigger follow the draft AST-030 FR26 amendment in #12985, not FR26 as it stands on main, which keeps a spec record beside Lab code mixed. Approval waits on an engineering owner deciding that amendment, by landing #12985 or by commenting /approve-spec <full head SHA> here (the author may do so as an engineering owner); the two fixes below are needed either way:

  • The new Lab entries never apply in CI, because .github/actions/test-scope/action.yml hands the classifier patches only for the route lock, official-packages.json and stories while isLabEntryChange refuses a file without a patch, so a new Lab component's pull request still runs the full suite and the title overstates the change; deciding these two entries by path before the patch guard, with an end-to-end case in test-scope-action.test.mjs, would fix it.
  • LAB_SPEC_DIR matches record folders by name alone, so a change to Lab's InfoTip or Chat folder plus Core's current InfoTip or Chat records would take the Lab-only lane instead of broad CI; match a record to its Lab component by content and add a refused InfoTip case.
Claims and files checked

Review mode: carry-forward; reason: none

Claims:

  • Title, the Lab lane counts Lab samples and a Lab component's spec folder as Lab: false in CI (action.yml:327, change-scope.cjs:164-172); true only when the classifier is called directly with every patch.
  • Title, runs lab:sync --check: verified (ci.yml:1835-1837; the check passes on this head).
  • Title, checks the route lock when a Lab doc changes: verified (ci.yml:2918; ci-lab-only-routing.test.mjs:148 runs the step's own script).
  • A Lab-only pull request for a component named for its own folder stays in the Lab lane with its samples and spec folder: false in CI, for the same reason.
  • A missing sample or route entry now fails a Lab-only pull request and names pnpm lab:sync: verified for Lab-only changes (ci.yml:1835-1837).
  • The samples file is a Lab entry, where before it matched the package-root-script rule and ran the full suite: the classifier change is verified (change-scope.cjs:172, :247), but in CI the full suite still runs.
  • A record folder counts only for a Lab component folder the change carries, and another component's does not: false for Lab folders named like Core components (InfoTip, Chat).
  • Route-lock ownership is unchanged and a family folder keeps the full suite: verified (change-scope.test.mjs:1022).
  • The route-lock step runs on a lock, Lab doc, block doc or Lab index.ts change: verified (ci.yml:2918, ci-lab-only-routing.test.mjs:148).
  • The swizzle samples test already runs on every Lab-only change as a source-reading guard, now pinned by a test: verified (ci-lab-only-routing.test.mjs:142; only the swizzle proof slices leave the Node legs).
  • No registry-generator test step is needed because that test never reads the lock: verified (the test names no lock path).
  • The Node leg bounds test lists the new step: verified (ci-node-leg-bounds.test.mjs:87).
  • The new tests were red first: verified (the head's three test files fail 5 cases on the base and pass all 135 on the head).
  • The full tally over the CI script tests: not reproduced; only the three changed test files were run.
  • CI impact (a few seconds for the sync check, one to two minutes for the route-lock step on doc changes, other lanes unchanged): step placement verified; timings not measured, as CI has not run on this head.
  • The pull request is stacked on the one that adds lab:sync, and this diff holds only the five lane files: verified.
  • The governing record is the FR26 amendment in a separate pull request: accurate, but that amendment is still an unapproved draft.

Files:

  • .github/scripts/change-scope.cjs: two blocking findings (the entries never reach CI; name-only record-folder match).
  • .github/scripts/change-scope.test.mjs: the new cases call the classifier with patches CI never supplies; add a refused InfoTip case.
  • .github/scripts/ci-lab-only-routing.test.mjs: clear (non-blocking: the route-lock test leaves its temporary directory behind).
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear.
  • .github/workflows/ci.yml: clear as code; its two Lab-only step changes wait on the FR26 decision.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Outcome: this needs an engineering owner's decision, plus two blocking fixes.

Counting a Lab component's record folder as Lab, the new lab:sync --check step and the wider route-lock trigger follow the draft AST-030 FR26 amendment in #12985, not FR26 as it stands on main, which keeps a spec record beside Lab code mixed and runs the route-lock check only when the lock changes. Approval waits on an engineering owner deciding that amendment, by landing #12985 or by commenting /approve-spec <full head SHA> here (the author may do so as an engineering owner). The two fixes below are needed either way:

  • The new Lab entries never apply in CI, because .github/actions/test-scope/action.yml hands the classifier patches only for the route lock, official-packages.json and stories while isLabEntryChange refuses a file without a patch, so a new Lab component's pull request still runs the full suite and the title overstates the change; deciding these two entries by path before the patch guard, with an end-to-end case in test-scope-action.test.mjs, would fix it.
  • LAB_SPEC_DIR matches record folders by name alone, so once patches reach it a change to Lab's InfoTip or Chat folder plus Core's current InfoTip or Chat records would take the Lab-only lane instead of broad CI; tie a record to its Lab component by content and add a refused InfoTip case.
Claims and files checked

Review mode: full; reason: merge-touches-pr-files

Claims:

  • Title, the Lab lane counts Lab samples and a Lab component's spec folder as Lab: false in CI (action.yml:327, change-scope.cjs:164-174); true only when the classifier is given every patch.
  • Title, runs lab:sync --check: verified (ci.yml:1835-1837; the check passes on this head).
  • Title, checks the route lock when a Lab doc changes: verified (ci.yml:2918; ci-lab-only-routing.test.mjs:148 runs the step's own script).
  • A Lab-only pull request for a component named for its own folder stays in the Lab lane with its samples and spec folder: false in CI, for the same reason.
  • A missing sample or route entry fails the pull request and names pnpm lab:sync: verified for Lab-only changes (ci.yml:1835-1837, scripts/lab-sync.mjs:341).
  • The samples file is a Lab entry, where before it matched the package-root-script rule and ran the full suite: the classifier change is verified (change-scope.cjs:172), but in CI the full suite still runs.
  • A record folder counts only for a Lab component folder the change carries, and another component's does not: false for Lab folders named like Core records (InfoTip, Chat).
  • Route-lock ownership is unchanged and a family folder keeps the full suite: verified (change-scope.test.mjs:1022).
  • The route-lock step runs on a lock, Lab doc, block doc or Lab index.ts change: verified (ci.yml:2918, ci-lab-only-routing.test.mjs:148).
  • The new sync step runs on the first Node leg of a Lab-only change: verified (ci.yml:1835-1837, ci-node-leg-bounds.test.mjs:87).
  • The swizzle samples test already runs on every Lab-only change as a source-reading guard, now pinned by a test: verified (ci-lab-only-routing.test.mjs:142).
  • No registry-generator test step is needed because that test never reads the lock: verified (the test names no lock path).
  • The new tests were red first: verified (the head's three test files fail 5 cases on the base and pass all 135 on the head).
  • The full tally over the CI script tests: not reproduced; only the three changed test files were run.
  • CI impact (a few seconds for the sync check, one to two minutes for the route-lock step on doc changes, other lanes unchanged): step placement verified; timings not measured, as CI has not run on this head.
  • The pull request is stacked on the one that adds lab:sync, and this diff holds only the five lane files: verified.
  • The governing record is the FR26 amendment in a separate pull request: accurate, but that amendment is still an unapproved draft.

Files:

  • .github/scripts/change-scope.cjs: two blocking findings (the entries never reach CI; name-only record-folder match).
  • .github/scripts/change-scope.test.mjs: the new cases call the classifier with patches CI never supplies; add a refused InfoTip case.
  • .github/scripts/ci-lab-only-routing.test.mjs: clear (non-blocking: the route-lock test leaves its temporary directory behind).
  • .github/scripts/ci-node-leg-bounds.test.mjs: clear.
  • .github/workflows/ci.yml: clear as code; its two Lab-only step changes wait on the FR26 decision.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 29ea6217 Deployed Nov 20, 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