From ca788b77c3e08faaa09a749610a6c558778ced94 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Fri, 13 Nov 2026 20:00:36 -0800 Subject: [PATCH 1/2] ci: the touched-components and PR status lines pair each run label with the suite it runs --- .github/scripts/lib/pr-preview.test.mjs | 2 +- .github/scripts/lib/pr-status.js | 18 +++++++++--------- .github/scripts/lib/pr-status.test.mjs | 16 ++++++++-------- .github/scripts/touched-components.mjs | 4 ++-- .github/scripts/touched-components.test.mjs | 17 +++++++++++++++++ 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/.github/scripts/lib/pr-preview.test.mjs b/.github/scripts/lib/pr-preview.test.mjs index 5748d54b0cf71..5e806a62ae5ae 100644 --- a/.github/scripts/lib/pr-preview.test.mjs +++ b/.github/scripts/lib/pr-preview.test.mjs @@ -981,7 +981,7 @@ describe('PR comment preview reconciliation', () => { }); expect(args).toContain('--jobs'); expect(result.body).toContain( - 'Not run on this PR: add `ci:run-rtl` to run it.', + 'Not run on this PR: add `ci:run-rtl` for RTL.', ); }); }); diff --git a/.github/scripts/lib/pr-status.js b/.github/scripts/lib/pr-status.js index fb87128e1b72c..3aedb0c7d9691 100644 --- a/.github/scripts/lib/pr-status.js +++ b/.github/scripts/lib/pr-status.js @@ -477,11 +477,11 @@ function notRunLine({jobs, a11yReport, visualVerdict, touched = null}) { return false; }); if (notRun.length === 0) return ''; - const labels = notRun.map(suite => `\`${SUITE_LABELS[suite.id]}\``); - const list = - labels.length === 1 - ? labels[0] - : `${labels.slice(0, -1).join(', ')} or ${labels.at(-1)}`; + // Each label runs only its own suite, so each names the suite it runs. + const labels = notRun.map( + suite => `\`${SUITE_LABELS[suite.id]}\` for ${suite.label}`, + ); + const list = labels.join(', '); // Too wide for the touched-components check: it says so, and names only // the suites that did not run. A narrower change's touched components were // checked, so the labels run the full suites. @@ -500,7 +500,7 @@ function notRunLine({jobs, a11yReport, visualVerdict, touched = null}) { ', ', )}${foundations.length > 3 ? `, and ${foundations.length - 3} more` : ''})` : `Wide change (${num(touched.componentCount)} components)`; - return `${why}: add ${list} to run ${labels.length === 1 ? 'it' : 'them'}.\n\n`; + return `${why}: add ${list}.\n\n`; } // Claim the touched check only when it produced a result. const checked = (touched?.components || []).some(component => @@ -509,10 +509,10 @@ function notRunLine({jobs, a11yReport, visualVerdict, touched = null}) { ), ); if (touched && checked) - return `Touched components checked; add ${list} to run the full suite${labels.length === 1 ? '' : 's'}.\n\n`; + return `Touched components checked; for the full suite${labels.length === 1 ? '' : 's'}, add ${list}.\n\n`; if (touched) - return `Touched components identified; checks did not run. Add ${list} to run ${labels.length === 1 ? 'it' : 'them'}.\n\n`; - return `Not run on this PR: add ${list} to run ${labels.length === 1 ? 'it' : 'them'}.\n\n`; + return `Touched components identified; checks did not run. Add ${list}.\n\n`; + return `Not run on this PR: add ${list}.\n\n`; } // The API report step's own renderer (scripts/api-report/changes.mjs), so diff --git a/.github/scripts/lib/pr-status.test.mjs b/.github/scripts/lib/pr-status.test.mjs index efb7e931434d8..9179f2c5f6daf 100644 --- a/.github/scripts/lib/pr-status.test.mjs +++ b/.github/scripts/lib/pr-status.test.mjs @@ -594,7 +594,7 @@ describe('notRunLine', () => { {name: 'pr-a11y', conclusion: 'success'}, ], }), - ).toBe('Not run on this PR: add `ci:run-rtl` to run it.\n\n'); + ).toBe('Not run on this PR: add `ci:run-rtl` for RTL.\n\n'); }); it('names several suites in one line', () => { @@ -609,7 +609,7 @@ describe('notRunLine', () => { ], }), ).toBe( - 'Not run on this PR: add `ci:run-visual`, `ci:run-a11y` or `ci:run-rtl` to run them.\n\n', + 'Not run on this PR: add `ci:run-visual` for Visual, `ci:run-a11y` for Accessibility, `ci:run-rtl` for RTL.\n\n', ); }); @@ -625,7 +625,7 @@ describe('notRunLine', () => { touched: wide, }), ).toBe( - 'Wide change (60 components): add `ci:run-visual` or `ci:run-rtl` to run them.\n\n', + 'Wide change (60 components): add `ci:run-visual` for Visual, `ci:run-rtl` for RTL.\n\n', ); expect(notRunLine({jobs: [], touched: wide})).toBe(''); }); @@ -640,7 +640,7 @@ describe('notRunLine', () => { {name: 'pr-rtl', conclusion: 'success'}, ], }), - ).toBe('Not run on this PR: add `ci:run-visual` to run it.\n\n'); + ).toBe('Not run on this PR: add `ci:run-visual` for Visual.\n\n'); }); it('says the touched components were checked on a narrow change', () => { @@ -663,7 +663,7 @@ describe('notRunLine', () => { }, }), ).toBe( - 'Touched components checked; add `ci:run-visual`, `ci:run-a11y` or `ci:run-rtl` to run the full suites.\n\n', + 'Touched components checked; for the full suites, add `ci:run-visual` for Visual, `ci:run-a11y` for Accessibility, `ci:run-rtl` for RTL.\n\n', ); // Every result not-run: never claim a check that did not happen. expect( @@ -685,7 +685,7 @@ describe('notRunLine', () => { }, }), ).toBe( - 'Touched components identified; checks did not run. Add `ci:run-rtl` to run it.\n\n', + 'Touched components identified; checks did not run. Add `ci:run-rtl` for RTL.\n\n', ); }); @@ -705,7 +705,7 @@ describe('notRunLine', () => { }, }), ).toBe( - 'Wide change (shared styles: packages/core/src/theme/tokens.stylex.ts): add `ci:run-visual`, `ci:run-a11y` or `ci:run-rtl` to run them.\n\n', + 'Wide change (shared styles: packages/core/src/theme/tokens.stylex.ts): add `ci:run-visual` for Visual, `ci:run-a11y` for Accessibility, `ci:run-rtl` for RTL.\n\n', ); }); @@ -724,7 +724,7 @@ describe('notRunLine', () => { it('says nothing when every suite ran, and falls back to the reports without a job list', () => { expect(notRunLine({jobs: []})).toBe(''); expect(notRunLine({jobs: null, a11yReport: {components: {}}})).toBe( - 'Not run on this PR: add `ci:run-visual` to run it.\n\n', + 'Not run on this PR: add `ci:run-visual` for Visual.\n\n', ); }); }); diff --git a/.github/scripts/touched-components.mjs b/.github/scripts/touched-components.mjs index b4d6be87581f9..9df9f35098264 100644 --- a/.github/scripts/touched-components.mjs +++ b/.github/scripts/touched-components.mjs @@ -521,7 +521,7 @@ export function summaryMarkdown(report) { report.foundations?.length > 0 ? `it changes shared styles (${report.foundations.join(', ')})` : `it touches ${report.componentCount} components (more than ${MAX_TOUCHED_COMPONENTS})`; - return `### Touched components\n\nWide change (${report.componentCount} components): the touched-components check did not run because ${reason}. Add \`ci:run-visual\`, \`ci:run-a11y\` or \`ci:run-rtl\` to run the full suite.\n`; + return `### Touched components\n\nWide change (${report.componentCount} components): the touched-components check did not run because ${reason}. Each label runs only its own full suite: \`ci:run-visual\` for Visual, \`ci:run-a11y\` for Accessibility, \`ci:run-rtl\` for RTL.\n`; } if (report.components.length === 0) { return '### Touched components\n\nNo component changed.\n'; @@ -539,7 +539,7 @@ export function summaryMarkdown(report) { if (report.broad) { lines.push( '', - 'This change reaches shared code the analysis could not scope; only the touched components were audited. Add `ci:run-visual`, `ci:run-a11y` or `ci:run-rtl` to audit everything it reaches.', + 'This change reaches shared code the analysis could not scope; only the touched components were audited. To audit everything it reaches, add `ci:run-visual` for Visual, `ci:run-a11y` for Accessibility, `ci:run-rtl` for RTL.', ); } return `${lines.join('\n')}\n`; diff --git a/.github/scripts/touched-components.test.mjs b/.github/scripts/touched-components.test.mjs index 8ee4964962f79..a8f1e840c128a 100644 --- a/.github/scripts/touched-components.test.mjs +++ b/.github/scripts/touched-components.test.mjs @@ -292,6 +292,23 @@ describe('wide changes', () => { expect(summaryMarkdown(report)).toContain('Wide change (6 components)'); expect(summaryMarkdown(report)).toContain('`ci:run-visual`'); }); + + it('pairs each label with the one suite it runs, so no label reads as running the visual suite', () => { + const scope = owners(9); + const text = summaryMarkdown( + wideReport({ + headSha: 'abc', + scope, + decision: decideWideChange(scope, []), + }), + ); + expect(text).toContain( + 'Each label runs only its own full suite: `ci:run-visual` for Visual, `ci:run-a11y` for Accessibility, `ci:run-rtl` for RTL.', + ); + expect(text).not.toMatch( + /`ci:run-a11y` or `ci:run-rtl` to run the full suite/, + ); + }); }); describe('per-component results', () => { From 5918bc13fb11b57ce96d8e5a459b0cc2c1eeae45 Mon Sep 17 00:00:00 2001 From: Cindy Zhang Date: Fri, 13 Nov 2026 21:52:52 -0800 Subject: [PATCH 2/2] ci: the touched-components skip step pairs each run label with its suite too --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84f824c87fe80..ba000f51de1c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4869,7 +4869,7 @@ jobs: STORIES: ${{ steps.touched.outputs.changed_stories }} run: | if [ "$WIDE" = true ]; then - echo "Wide change ($COUNT components): add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suite." + echo "Wide change ($COUNT components): each label runs only its own full suite: ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL." else echo "No component changed; no component audit." fi