Skip to content

test(ci): touched-components timing replay (do not merge) - #9179

Closed
cixzhang wants to merge 4 commits into
mainfrom
ci/touched-replay
Closed

cixzhang wants to merge 4 commits into
mainfrom
ci/touched-replay

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Do not merge. Times the touched-components check proposed in #9178 on component sets from recent pull requests: A one component (Toast, like #9016), B three (Selector, MultiSelector, BottomSheet, like #9018/#9020), C five including a Lab component, D six (a wide change, which skips). Each push is one scenario; the minutes go to #9178. Closed when the replay finishes.

@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 10:45pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 31, 2026, 10:39 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 31, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Preview: the links below open this branch's latest Vercel deployment, which can trail a new push until that push's deployment is ready.

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

Toast (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 304B 304B 0B
Lines of Code 1499 1499 -
Complexity Very High Very High (178) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/LayerProvider 66.5KB 66.5KB 0B 10.4KB 10.4KB 0B
core/Toast 62.4KB 62.4KB 0B 10.0KB 10.0KB 0B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 36.0KB 36.0KB 0B

Published Package Size

Package Download before Download after Delta Unpacked before Unpacked after Delta Files
@astryxdesign/core 6.52MB 6.52MB +59B (+0.0%) 27.71MB 27.71MB +150B (+0.0%) 3699

10 other published packages are unchanged.

Download is the gzip tarball npm fetches; unpacked is what lands in node_modules.

Accessibility Audit

Status: Accessibility did not run on this pull request; add ci:run-a11y to run it. It runs after merges to main and before each release.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@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 replay can't be approved yet: its AST-030 FR12/DEC-7 rewrite adds an every-PR touched-components check that the current FR12 and DEC-7 keep behind the ci:run-* labels. An engineering owner records whether that requirement stands by commenting /approve-spec <full head SHA>, and the author can do so as an engineering owner. Whatever that decision, the job needs these fixes before it carries #9178's minutes:

  • The repository's FR12 guard (scripts/check-visual-workflow-owner.mjs) rejects pr-touched-components, so the required test fails; FR11, FR12's single-owner sentence, DEC-4 and the RTL audit architecture's INV7 need amending alongside it.
  • Spec-, docsite- and tooling-only pull requests would fail at the ungated pr-analysis download, and a new Core component would crash the visual step.
  • Failed visual captures, curated RTL failures and all-N/A RTL results show as pass in touched-components.json, and a change inside a multi-component folder such as Chat reports no components.
  • The branch predates main's package-size step, so build-storybook failed and the touched-components job was skipped; rebase before the next scenario.

[Automated review]

Comment thread .github/workflows/ci.yml
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Download analysis artifact

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

build-storybook succeeds without uploading pr-analysis on spec-only, docsite-only and tooling-only lanes (ci.yml:1089-1090), so this ungated download fails the job on every such pull request. The other downloads of this artifact are gated (ci.yml:1493, 1622, 2595).

Comment thread .github/workflows/ci.yml Outdated
COMPONENTS: ${{ steps.touched.outputs.visual_components }}
run: |
set +e
node .github/scripts/visual-gate/gate.mjs check \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

scripts/check-visual-workflow-owner.mjs:94-96 admits gate.mjs check only in ci.yml → pr-visual, so this line fails test-node (2/4) and the required test: "ci.yml → pr-touched-components: visual regression belongs in ci.yml → pr-visual (AST-030 FR12)".

Comment thread .github/workflows/ci.yml Outdated
if: steps.touched.outputs.has_components == 'true'
run: pnpm install --frozen-lockfile && npx playwright install chromium

# Exit 0 is clean, 2 is a change for review and 3 means nothing touched

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gate.mjs exits 3 only inside dependents.length > 0 (gate.mjs:243-253), and this step passes no --dependents. A touched Core component with no accepted baseline produces an empty plan, which throws and exits 1 (gate.mjs:380-381), so the step fails instead of reporting not-run.

typeof entry === 'string' ? shots[entry]?.component : entry?.component,
identity,
);
if ((verdict.failures ?? []).some(mine)) return {result: 'fail'};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The gate writes failures as {key, error} (capture.mjs:623), and failed shots are absent from the manifest, so this never matches: a failed capture reports pass. The test fixture {component: 'Button'} is a shape the gate never writes.

);
const mine = results.filter(result => namesOwner(result.component, identity));
if (mine.length === 0) return {result: 'not-run'};
const failed = mine.filter(

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 treats an all-N-A component as pass, and RTL_SECTIONS leaves out curated.results, so a curated not-RTL rollup also reports pass. That contradicts the rtl-audit-evidence architecture's INV3 and INV4.

* the rest.
*/
export function resolveTouchedScope(analysis) {
const touched = [

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 re-derives the changed-component set that resolvePrA11yComponents (a11y-pr-scope.mjs:68-158) owns. It drops unresolvedComponentSources, so a change only inside core/Chat reports "No component changed", and it skips the fail-closed analysis checks that DEC-5 requires.

…the components a pull request changes

Every pull request without a ci:run-<suite> label runs one default check for
only the components it touches, in every package, against its Storybook
build. The visual part is pr-visual's new default mode, a focused check of
the touched Core components that never escalates to the release plan, so
pr-visual stays the one visual owner (AST-030 FR12). The accessibility and
RTL parts run in pr-touched-components on one standard arm runner, which
folds in pr-visual's verdict and writes touched-components.json: one row per
component with each suite's pass/fail/changed/not-run result, or the wide
flag and count. A wide change (more than five components, or shared styles:
themes, tokens, shared .stylex.ts) skips it, and nothing starts a full suite
on its own. AST-030 FR12 and DEC-7 record the check.

@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 replay can't be approved yet. Its AST-030 FR12/DEC-7 rewrite adds a default touched-components check on every unlabelled pull request, which the current FR12 and DEC-7 keep behind the ci:run-* labels. An engineering owner records whether that requirement stands by commenting /approve-spec <full head SHA>; the author can do that as an engineering owner. Whatever the decision, these need fixing before #9178 lands:

  • The required test fails: .github/scripts/run-labels.test.mjs still expects pr-visual to run only with ci:run-visual.
  • FR12's retained label sentence, DEC-7's opening, DEC-6, FR13 and the RTL audit architecture's INV7 still say these owners run on a pull request only with a label.
  • pr-touched-components downloads pr-analysis with no condition, so every spec-, docsite- and tooling-only pull request fails it.
  • A new Core component fails pr-visual's default step, because the gate never exits 3 without --dependents.
  • rtlResult reports curated RTL failures and all-N/A components as pass, and the touched set drops multi-component folders such as Chat that the shared resolvers expand.

[Automated review]

Comment thread .github/workflows/ci.yml
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Download analysis artifact

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

build-storybook succeeds on spec-only, docsite-only and tooling-only lanes but uploads pr-analysis only outside them (ci.yml:1161), so this ungated download fails the job on every such pull request. The other downloads of this artifact are gated (ci.yml:1556, :1685, :2347, :2699).

Comment thread .github/workflows/ci.yml
set -e
case "$code" in
0|2) ;;
3) rm -f .visual-run/verdict.json ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gate.mjs exits 3 only inside dependents.length > 0 (gate.mjs:243-253), and this step passes no --dependents, so this arm never runs. A touched component with no stable story or no accepted baseline throws instead (plan.mjs:485-493, gate.mjs:377-382) and exits 1, failing pr-visual.

const mine = results.filter(result => namesOwner(result.component, identity));
if (mine.length === 0) return {result: 'not-run'};
const failed = mine.filter(
result => result.verdict !== 'pass' && result.verdict !== 'N-A',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

An all-N-A component reports pass here, and RTL_SECTIONS leaves out curated.results, so a curated not-RTL card also reports pass; that contradicts the RTL audit architecture's INV3 and INV4. In this head's own run Toast's automatic results were all N/A and only the unread curated D4 card held its evidence.

* scope audits its touched owners, and the comment points to the labels for
* the rest.
*/
export function resolveTouchedScope(analysis) {

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 re-derives the changed-component set that resolvePrA11yComponents (a11y-pr-scope.mjs:68-158) and resolveRtlShardScope own. It ignores unresolvedComponentSources, so a change only inside core/Chat reports "No component changed", and it skips their fail-closed analysis checks.

confirm that runs nothing. A label runs only its own suite; a pull request
update without one runs none of them, and no required context depends on
them. An opted-in PR's a11y MUST remain scoped to changed components
confirm that runs nothing. A label runs only its own suite. Without a label, a pull request update

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lines 192-198 still say pr-visual "MUST ... run only when the pull request carries that suite's label", while the new text from here runs its default mode on every pull request; DEC-7's opening (494), DEC-6 (523-525) and FR13 (253) say the same and need amending with it.

@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 replay can't be approved yet. Its AST-030 FR12/DEC-7 rewrite adds a default touched-components check on every unlabelled pull request, which the current FR12 and DEC-7 keep behind the ci:run-* labels. An engineering owner records whether that requirement stands by commenting /approve-spec <full head SHA>, and the author can do that as an engineering owner. Whatever the decision, scenario C's own run shows these need fixing before #9178 lands:

  • The required test fails because .github/scripts/run-labels.test.mjs still expects pr-visual to run only with ci:run-visual.
  • touched-components.json records Lab MobileTokenizer's RTL coverage gap as pass and the three components pr-visual passed as visual not-run, because the verdict download is skipped after any earlier failure.
  • Selector has no row: the touched set ignores unresolvedComponentSources, which the shared accessibility resolver expands, so scenario C measured four components, not five.
  • FR12's retained label sentence, DEC-7's opening, DEC-6, FR13 and the RTL audit architecture's INV7 still say these owners run only with a label.
  • Spec-, docsite- and tooling-only pull requests fail the new job at its ungated pr-analysis download.

[Automated review]

Comment thread .github/workflows/ci.yml
# The visual result comes from pr-visual, the one visual owner: its
# default touched check, or its full check under ci:run-visual.
- name: Download pr-visual's verdict
if: steps.touched.outputs.has_components == 'true' && needs.pr-visual.result == 'success'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

With no status function GitHub adds success() here, so this download is skipped whenever an earlier step failed. In this head's run the RTL step failed on the Lab coverage gap. Toast, TextArea and MultiSelector were then recorded as visual not-run, although pr-visual passed their 6 shots. !cancelled() && (or always() &&, as on the report step below) keeps the verdict.

*/
export function resolveTouchedScope(analysis) {
const touched = [
...new Set([

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In this head's run the analysis listed core/Selector under unresolvedComponentSources. The accessibility step's shared resolver audited Selector, but this set, pr-visual's list and the RTL owners left it out, and the record has no Selector row.

@cixzhang

Copy link
Copy Markdown
Contributor Author

Replay finished; minutes are in #9178.

@cixzhang cixzhang closed this Oct 31, 2026
@cixzhang
cixzhang deleted the ci/touched-replay branch October 31, 2026 22:49

This branch had an error being deployed

1 failed deployment
Preview — 6c0713bc 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. needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant