An open source design system that's fully customizable and agent ready
TypeScript
ci: a Lab-only change still runs the interaction specs it edits (#10754)
Cindy Zhang79893c7a600f
diff --git a/.github/actions/test-scope/action.yml b/.github/actions/test-scope/action.ymlindex 0d29dad5e1..34186bc9a1 100644--- a/.github/actions/test-scope/action.yml+++ b/.github/actions/test-scope/action.yml@@ -53,6 +53,13 @@ inputs:and `head_file_present` says so whether or not `touches` holds.required: falsedefault: ''+ lab-only-specs:+ description: >-+ Optional pattern over changed paths. On a Lab-only change, a changed file+ that matches it is still this job's work: `applies` holds, and+ `lab_specs_path` lists those files, so the job runs only them.+ required: false+ default: ''outputs:spec_only:@@ -117,10 +124,16 @@ outputs:`false` when the PR head lacks `requires-head-file` and its diff does nottouch it (a head cut before the file existed); `true` otherwise.value: ${{ steps.scope.outputs.head_file_present }}+ lab_specs_path:+ description: >-+ With `lab-only-specs`: on a Lab-only change, a file listing the changed+ files that match it, one per line; empty otherwise.+ value: ${{ steps.scope.outputs.lab_specs_path }}applies:description: >-The job's work applies: not a specialized lane (spec, docsite, tooling or- Lab only), `touches` holds, and any `requires-head-file` is present.+ Lab only), `touches` holds, and any `requires-head-file` is present. On a+ Lab-only change it also holds when `lab_specs_path` lists a file.value: ${{ steps.scope.outputs.applies }}runs:@@ -133,6 +146,7 @@ runs:SCOPE_OUTSIDE_PR: ${{ inputs.outside-pull-request }}SCOPE_HEAD_FILE: ${{ inputs.requires-head-file }}SCOPE_COMPONENT_AUDIT: ${{ inputs.component-audit }}+ SCOPE_LAB_ONLY_SPECS: ${{ inputs.lab-only-specs }}with:retries: 3script: |@@ -154,6 +168,7 @@ runs:head_file_present: 'true',decided: 'true',truncated: 'false',+ lab_specs_path: '',};// Outside a pull request, or when undecidable, every component audit// applies in full; a specialized lane has none.@@ -291,12 +306,28 @@ runs:}// A base whose classifier predates lab_only reports none: false.const specialized = ['spec_only', 'docsite_only', 'tooling_only', 'lab_only'].some(key => classified[key] === 'true');- let applies = String(!specialized && touches === 'true');+ // A Lab-only change skips Lab source, but a changed file the job+ // names (an interaction spec) still runs, alone.+ const labOnly =+ classified.lab_only === 'true' &&+ !['spec_only', 'docsite_only', 'tooling_only'].some(key => classified[key] === 'true');+ const labSpecs =+ labOnly && process.env.SCOPE_LAB_ONLY_SPECS+ ? files+ .filter(f => f.status !== 'removed' && new RegExp(process.env.SCOPE_LAB_ONLY_SPECS).test(f.filename))+ .map(f => f.filename)+ : [];+ let labSpecsPath = '';+ if (labSpecs.length > 0) {+ labSpecsPath = path.join(process.env.RUNNER_TEMP || os.tmpdir(), 'test-scope-lab-specs.txt');+ fs.writeFileSync(labSpecsPath, `${labSpecs.join('\n')}\n`);+ }+ let applies = String((!specialized && touches === 'true') || labSpecs.length > 0);// Whether the head has the file the work needs, decided whether or// not `touches` holds; a diff that touches the file keeps it.let headFilePresent = 'true';const headFile = process.env.SCOPE_HEAD_FILE;- if (!specialized && headFile && !files.some(f => f.filename === headFile || f.previous_filename === headFile)) {+ if ((!specialized || labSpecs.length > 0) && headFile && !files.some(f => f.filename === headFile || f.previous_filename === headFile)) {try {await github.rest.repos.getContent({...context.repo, path: headFile, ref: pr.head.sha});} catch (error) {@@ -339,7 +370,7 @@ runs:fs.writeFileSync(changedFilesPath, `${changed.join('\n')}\n`);componentScope.changed_files_path = changedFilesPath;}- report({...everything, ...classified, ...componentScope, release_bump: 'false', touches, applies, head_file_present: headFilePresent});+ report({...everything, ...classified, ...componentScope, release_bump: 'false', touches, applies, head_file_present: headFilePresent, lab_specs_path: labSpecsPath});} finally {if (root) fs.rmSync(root, {recursive: true, force: true});}diff --git a/.github/scripts/ci-interaction-lab-specs.test.mjs b/.github/scripts/ci-interaction-lab-specs.test.mjsnew file mode 100644index 0000000000..54636f9e7b--- /dev/null+++ b/.github/scripts/ci-interaction-lab-specs.test.mjs@@ -0,0 +1,162 @@+// Copyright (c) Meta Platforms, Inc. and affiliates.++/**+ * @file Contract: a Lab-only pull request that edits an interaction spec still+ * runs each spec it edits, in both engines, and nothing else+ * (spec:AST-030 FR26).+ *+ * A Lab-only change once skipped the interaction proofs whole, so a pull+ * request that changed only a Lab interaction spec ran none of it.+ */++import {spawnSync} from 'node:child_process';+import fs from 'node:fs';+import os from 'node:os';+import path from 'node:path';++import {afterAll, describe, expect, it} from 'vitest';+import yaml from 'yaml';++const root = path.resolve(import.meta.dirname, '../..');+const ci = yaml.parse(+ fs.readFileSync(path.join(root, '.github/workflows/ci.yml'), 'utf8'),+);+const SPECS = '\\.interaction\\.browser\\.spec\\.ts$';+const SPEC =+ 'packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts';+const step = (job, predicate) => {+ const found = ci.jobs[job].steps.find(predicate);+ if (!found) throw new Error(`${job} has no such step`);+ return found;+};+const named = name => candidate => candidate.name === name;+const byId = id => candidate => candidate.id === id;++// The scope steps of the interaction lanes, and the steps that plan from them.+const SCOPES = [+ ['interaction-legs', 'scope-chromium'],+ ['interaction-legs', 'scope-webkit'],+ ['pr-interaction', 'scope'],+ ['pr-interaction-webkit', 'scope'],+];+const CHROMIUM = [+ ['interaction-legs', 'Count the Chromium legs', 'scope-chromium'],+ ['pr-interaction', "Count this run's legs", 'scope'],+ ['pr-interaction', "Plan this leg's interaction proofs", 'scope'],+];+const WEBKIT = [+ ['interaction-legs', 'Count the WebKit legs', 'scope-webkit'],+ ['pr-interaction-webkit', "Count this run's WebKit legs", 'scope'],+];++// Runs a step's script with `node` and `git` replaced by stubs that record+// their arguments, one call a line, each argument NUL-separated.+const dirs = [];+afterAll(() => {+ for (const dir of dirs) fs.rmSync(dir, {recursive: true, force: true});+});+function runScript(script, env) {+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'lab-specs-'));+ dirs.push(dir);+ const bin = path.join(dir, 'bin');+ fs.mkdirSync(bin);+ const calls = path.join(dir, 'calls');+ for (const tool of ['node', 'git']) {+ fs.writeFileSync(+ path.join(bin, tool),+ `#!/bin/bash\nprintf '%s\\0' ${tool} "$@" >> "${calls}"\necho >> "${calls}"\n`,+ {mode: 0o755},+ );+ }+ const temp = path.join(dir, 'temp');+ fs.mkdirSync(path.join(temp, 'interaction-legs'), {recursive: true});+ const result = spawnSync(+ 'bash',+ ['-e', '-c', script.replaceAll(/\$\{\{[^}]*\}\}/g, '1')],+ {+ cwd: dir,+ encoding: 'utf8',+ env: {+ PATH: `${bin}:${process.env.PATH}`,+ RUNNER_TEMP: temp,+ GITHUB_OUTPUT: path.join(dir, 'output'),+ WEBKIT_SPEC_PATHS: 'packages/core/src/gestures/',+ WEBKIT_SHARED_PATHS: '^packages/core/src/gestures/',+ ...env,+ },+ },+ );+ const recorded = fs.existsSync(calls)+ ? fs+ .readFileSync(calls, 'utf8')+ .split('\n')+ .filter(Boolean)+ .map(line => line.split('\0').filter(Boolean))+ : [];+ return {result, calls: recorded, temp};+}++function labSpecsFile() {+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'lab-specs-list-'));+ dirs.push(dir);+ const file = path.join(dir, 'specs.txt');+ fs.writeFileSync(file, `${SPEC}\n`);+ return file;+}++describe('a Lab-only change that edits an interaction spec', () => {+ it('names interaction specs as Lab-only work in every interaction scope step', () => {+ for (const [job, id] of SCOPES) {+ expect(step(job, byId(id)).with['lab-only-specs'], `${job} ${id}`).toBe(+ SPECS,+ );+ }+ });++ it('plans only the edited specs in Chromium, in the count and in the plan', () => {+ for (const [job, name, scope] of CHROMIUM) {+ const counted = step(job, named(name));+ expect(counted.env.LAB_SPECS, `${job} ${name}`).toBe(+ `\${{ steps.${scope}.outputs.lab_specs_path }}`,+ );+ const {result, calls} = runScript(counted.run, {+ LAB_SPECS: labSpecsFile(),+ });+ expect(result.status, result.stderr).toBe(0);+ const planner = calls.find(call => call[0] === 'node');+ expect(planner.slice(-2), `${job} ${name}`).toEqual(['--', SPEC]);+ // Without the list, the step plans as before: no filter.+ const plain = runScript(counted.run, {LAB_SPECS: ''});+ expect(plain.result.status, plain.result.stderr).toBe(0);+ expect(plain.calls.find(call => call[0] === 'node')).not.toContain('--');+ }+ });++ it('runs only the edited specs in WebKit, never the folder or shared paths', () => {+ for (const [job, name, scope] of WEBKIT) {+ const counted = step(job, named(name));+ expect(counted.env.LAB_SPECS, `${job} ${name}`).toBe(+ `\${{ steps.${scope}.outputs.lab_specs_path }}`,+ );+ const {result, calls, temp} = runScript(counted.run, {+ LAB_SPECS: labSpecsFile(),+ CHANGED_FILES: '',+ });+ expect(result.status, result.stderr).toBe(0);+ const nodes = calls.filter(call => call[0] === 'node');+ expect(nodes.map(call => call[2])).toEqual(['legs']);+ expect(nodes[0].slice(-2)).toEqual(['--', SPEC]);+ expect(+ fs.readFileSync(+ path.join(temp, 'interaction-legs', 'selected.txt'),+ 'utf8',+ ),+ ).toBe(`${SPEC}\n`);+ // Without the list, it selects as before.+ const plain = runScript(counted.run, {LAB_SPECS: '', CHANGED_FILES: ''});+ expect(+ plain.calls.filter(call => call[0] === 'node').map(call => call[2]),+ ).toEqual(['select']);+ }+ });+});diff --git a/.github/scripts/test-scope-action.test.mjs b/.github/scripts/test-scope-action.test.mjsindex 0b8fbc2361..afd4d8565e 100644--- a/.github/scripts/test-scope-action.test.mjs+++ b/.github/scripts/test-scope-action.test.mjs@@ -137,6 +137,7 @@ async function decide({SCOPE_OUTSIDE_PR: inputs['outside-pull-request'] ?? 'run',SCOPE_HEAD_FILE: inputs['requires-head-file'] ?? '',SCOPE_COMPONENT_AUDIT: inputs['component-audit'] ?? 'false',+ SCOPE_LAB_ONLY_SPECS: inputs['lab-only-specs'] ?? '',};const saved = {...process.env};Object.assign(process.env, env);@@ -177,6 +178,7 @@ describe('per-job scope step', () => {'has_rtl_components','has_rtl_harness','lab_only',+ 'lab_specs_path','release_bump','spec_only','tooling_only',@@ -323,6 +325,57 @@ describe('per-job scope step', () => {expect(mixed.outputs).toMatchObject({lab_only: 'false', applies: 'true'});});+ it('still runs a changed interaction spec on the Lab-only lane, alone (spec:AST-030 FR26)', async () => {+ const spec =+ 'packages/lab/src/NavigationStack/__tests__/NavigationStack.interaction.browser.spec.ts';+ const inputs = {+ paths: INTERACTION_PATHS,+ 'lab-only-specs': '\\.interaction\\.browser\\.spec\\.ts$',+ 'requires-head-file': 'playwright.interaction.config.ts',+ };+ const headFiles = ['playwright.interaction.config.ts'];+ const {outputs} = await decide({files: changed(spec), inputs, headFiles});+ expect(outputs).toMatchObject({lab_only: 'true', applies: 'true'});+ expect(fs.readFileSync(outputs.lab_specs_path, 'utf8')).toBe(`${spec}\n`);+ // Lab source beside the spec adds nothing: only the spec runs.+ const both = await decide({+ files: changed(+ 'packages/lab/src/NavigationStack/NavigationStack.tsx',+ spec,+ ),+ inputs,+ headFiles,+ });+ expect(both.outputs.applies).toBe('true');+ expect(fs.readFileSync(both.outputs.lab_specs_path, 'utf8')).toBe(+ `${spec}\n`,+ );+ // Lab source alone runs none.+ const source = await decide({+ files: changed('packages/lab/src/NavigationStack/NavigationStack.tsx'),+ inputs,+ headFiles,+ });+ expect(source.outputs).toMatchObject({+ lab_only: 'true',+ applies: 'false',+ lab_specs_path: '',+ });+ // A deleted spec has nothing to run.+ const removed = await decide({+ files: [{filename: spec, status: 'removed'}],+ inputs,+ headFiles,+ });+ expect(removed.outputs).toMatchObject({+ applies: 'false',+ lab_specs_path: '',+ });+ // A head cut before the interaction config still skips.+ const old = await decide({files: changed(spec), inputs});+ expect(old.outputs.applies).toBe('false');+ });+it('reports no Lab-only lane when the base classifier predates it', async () => {const old = fs.readFileSync(path.join(root, '.github/scripts/change-scope.cjs'), 'utf8')diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex b30881e3a6..189418cd14 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -2589,6 +2589,8 @@ jobs:paths: '^(internal/interaction-harness/|internal/a11y-spec/|playwright\.interaction\.config\.ts$|packages/[^/]+/src/|packages/themes/[^/]+/src/|apps/storybook/|\.github/workflows/ci\.yml$|package\.json$|pnpm-lock\.yaml$|\.github/scripts/(playwright-legs|a11y-pr-contracts|lane-environment)\.mjs$|\.github/scripts/(stale-head-hint|merge-base)\.sh$|scripts/lib/duration-split\.mjs$|\.github/(playwright-leg-durations|lane-environments)\.json$|\.github/actions/test-scope/|.*\.interaction\.browser\.spec\.ts$)'outside-pull-request: skiprequires-head-file: playwright.interaction.config.ts+ # A Lab-only change still runs each interaction spec it edits.+ lab-only-specs: '\.interaction\.browser\.spec\.ts$'- name: Decide the WebKit proofs' scopeid: scope-webkit@@ -2597,6 +2599,8 @@ jobs:paths: '^(packages/[^/]+/src/[^/]+/|internal/interaction-harness/|internal/a11y-spec/|playwright\.interaction\.config\.ts$|packages/themes/[^/]+/src/|apps/storybook/|\.github/workflows/ci\.yml$|package\.json$|pnpm-lock\.yaml$|\.github/scripts/(playwright-legs|a11y-pr-contracts|lane-environment)\.mjs$|scripts/lib/duration-split\.mjs$|\.github/(playwright-leg-durations|lane-environments)\.json$|\.github/actions/test-scope/|.*\.interaction\.browser\.spec\.ts$|\.github/scripts/(stale-head-hint|merge-base)\.sh$)'outside-pull-request: skiprequires-head-file: playwright.interaction.config.ts+ # A Lab-only change still runs each interaction spec it edits.+ lab-only-specs: '\.interaction\.browser\.spec\.ts$'# Lists the changed files, so the planner adds a changed spec.component-audit: 'true'@@ -2617,7 +2621,12 @@ jobs:id: count-chromiumif: steps.scope-chromium.outputs.applies == 'true'continue-on-error: true+ env:+ LAB_SPECS: ${{ steps.scope-chromium.outputs.lab_specs_path }}run: |+ # A Lab-only change runs only the interaction specs it edits.+ FILTERS=()+ if [ -n "${LAB_SPECS:-}" ]; then mapfile -t LAB < "$LAB_SPECS"; FILTERS=(-- "${LAB[@]}"); figit -C .test-scope ls-tree -r --name-only HEAD > "$RUNNER_TEMP/interaction-legs/listed.txt"node "$RUNNER_TEMP/interaction-legs/.github/scripts/playwright-legs.mjs" legs \--listed "$RUNNER_TEMP/interaction-legs/listed.txt" --source .test-scope \@@ -2625,7 +2634,8 @@ jobs:--key interaction-chromium --fallback-key interaction-webkit \--durations "$RUNNER_TEMP/interaction-legs/.github/playwright-leg-durations.json" \--setup-seconds 90 --max-seconds 600 \- --leg 1 --max-legs 10+ --leg 1 --max-legs 10 \+ "${FILTERS[@]}"- name: Count the WebKit legsid: count-webkit@@ -2633,6 +2643,7 @@ jobs:continue-on-error: trueenv:CHANGED_FILES: ${{ steps.scope-webkit.outputs.changed_files_path }}+ LAB_SPECS: ${{ steps.scope-webkit.outputs.lab_specs_path }}run: |if [ "${WEBKIT_ALL_SPECS:-}" = true ]; then SPEC_PATHS=(packages/ internal/); else read -ra SPEC_PATHS <<< "$WEBKIT_SPEC_PATHS"; fi# With every spec planned, the changed files add nothing. Leave them@@ -2641,11 +2652,16 @@ jobs:if [ "${WEBKIT_ALL_SPECS:-}" = true ]; then CHANGED=(); figit -C .test-scope ls-tree -r --name-only HEAD > "$RUNNER_TEMP/interaction-legs/listed.txt"selected="$RUNNER_TEMP/interaction-legs/selected.txt"- node "$RUNNER_TEMP/interaction-legs/.github/scripts/playwright-legs.mjs" select \- --listed "$RUNNER_TEMP/interaction-legs/listed.txt" \- "${CHANGED[@]}" \- --shared "$WEBKIT_SHARED_PATHS" \- -- "${SPEC_PATHS[@]}" > "$selected"+ # A Lab-only change runs only the interaction specs it edits.+ if [ -n "${LAB_SPECS:-}" ]; then+ cp "$LAB_SPECS" "$selected"+ else+ node "$RUNNER_TEMP/interaction-legs/.github/scripts/playwright-legs.mjs" select \+ --listed "$RUNNER_TEMP/interaction-legs/listed.txt" \+ "${CHANGED[@]}" \+ --shared "$WEBKIT_SHARED_PATHS" \+ -- "${SPEC_PATHS[@]}" > "$selected"+ fiif [ ! -s "$selected" ]; thenecho "No WebKit interaction proof covers this change: it touches no shared touch code, no interaction spec, and no component folder that holds one."printf 'count=0\nruns=false\nleg=%s\n' "1" >> "$GITHUB_OUTPUT"@@ -2742,6 +2758,8 @@ jobs:paths: '^(internal/interaction-harness/|internal/a11y-spec/|playwright\.interaction\.config\.ts$|packages/[^/]+/src/|packages/themes/[^/]+/src/|apps/storybook/|\.github/workflows/ci\.yml$|package\.json$|pnpm-lock\.yaml$|\.github/scripts/(playwright-legs|a11y-pr-contracts|lane-environment)\.mjs$|\.github/scripts/(stale-head-hint|merge-base)\.sh$|scripts/lib/duration-split\.mjs$|\.github/(playwright-leg-durations|lane-environments)\.json$|\.github/actions/test-scope/|.*\.interaction\.browser\.spec\.ts$)'outside-pull-request: skiprequires-head-file: playwright.interaction.config.ts+ # A Lab-only change still runs each interaction spec it edits.+ lab-only-specs: '\.interaction\.browser\.spec\.ts$'- name: Require this pull request's Storybook buildif: steps.scope.outputs.applies == 'true' && needs.build-storybook.result != 'success'@@ -2778,7 +2796,12 @@ jobs:- name: Count this run's legsid: legsif: steps.scope.outputs.applies == 'true'+ env:+ LAB_SPECS: ${{ steps.scope.outputs.lab_specs_path }}run: |+ # A Lab-only change runs only the interaction specs it edits.+ FILTERS=()+ if [ -n "${LAB_SPECS:-}" ]; then mapfile -t LAB < "$LAB_SPECS"; FILTERS=(-- "${LAB[@]}"); figit -C .test-scope ls-tree -r --name-only HEAD > "$RUNNER_TEMP/interaction-legs/listed.txt"node "$RUNNER_TEMP/interaction-legs/.github/scripts/playwright-legs.mjs" legs \--listed "$RUNNER_TEMP/interaction-legs/listed.txt" --source .test-scope \@@ -2786,7 +2809,8 @@ jobs:--key interaction-chromium --fallback-key interaction-webkit \--durations "$RUNNER_TEMP/interaction-legs/.github/playwright-leg-durations.json" \--setup-seconds 90 --max-seconds 600 \- --leg ${{ matrix.leg }} --max-legs 10+ --leg ${{ matrix.leg }} --max-legs 10 \+ "${FILTERS[@]}"- name: Require a leg for every shareif: steps.scope.outputs.applies == 'true' && fromJSON(steps.legs.outputs.count || '0') > strategy.job-total@@ -2864,13 +2888,19 @@ jobs:- name: Plan this leg's interaction proofsid: planif: steps.scope.outputs.applies == 'true' && steps.legs.outputs.runs == 'true'+ env:+ LAB_SPECS: ${{ steps.scope.outputs.lab_specs_path }}run: |+ # A Lab-only change runs only the interaction specs it edits.+ FILTERS=()+ if [ -n "${LAB_SPECS:-}" ]; then mapfile -t LAB < "$LAB_SPECS"; FILTERS=(-- "${LAB[@]}"); finode "$RUNNER_TEMP/interaction-legs/.github/scripts/playwright-legs.mjs" plan \--key interaction-chromium --fallback-key interaction-webkit --tests "$RUNNER_TEMP/interaction-legs/tests.json" \--config playwright.interaction.config.ts --project chromium \--leg ${{ steps.legs.outputs.leg }} --of ${{ steps.legs.outputs.count }} \--durations "$RUNNER_TEMP/interaction-legs/.github/playwright-leg-durations.json" \- --out "$RUNNER_TEMP/interaction-leg.txt"+ --out "$RUNNER_TEMP/interaction-leg.txt" \+ "${FILTERS[@]}"- name: Run interaction proofsif: steps.scope.outputs.applies == 'true' && steps.legs.outputs.runs == 'true' && steps.plan.outputs.files != '0'@@ -2992,6 +3022,8 @@ jobs:paths: '^(packages/[^/]+/src/[^/]+/|internal/interaction-harness/|internal/a11y-spec/|playwright\.interaction\.config\.ts$|packages/themes/[^/]+/src/|apps/storybook/|\.github/workflows/ci\.yml$|package\.json$|pnpm-lock\.yaml$|\.github/scripts/(playwright-legs|a11y-pr-contracts|lane-environment)\.mjs$|scripts/lib/duration-split\.mjs$|\.github/(playwright-leg-durations|lane-environments)\.json$|\.github/actions/test-scope/|.*\.interaction\.browser\.spec\.ts$|\.github/scripts/(stale-head-hint|merge-base)\.sh$)'outside-pull-request: skiprequires-head-file: playwright.interaction.config.ts+ # A Lab-only change still runs each interaction spec it edits.+ lab-only-specs: '\.interaction\.browser\.spec\.ts$'# Lists the changed files, so the planner adds a changed spec.component-audit: 'true'@@ -3034,6 +3066,7 @@ jobs:if: steps.scope.outputs.applies == 'true'env:CHANGED_FILES: ${{ steps.scope.outputs.changed_files_path }}+ LAB_SPECS: ${{ steps.scope.outputs.lab_specs_path }}run: |if [ "${WEBKIT_ALL_SPECS:-}" = true ]; then SPEC_PATHS=(packages/ internal/); else read -ra SPEC_PATHS <<< "$WEBKIT_SPEC_PATHS"; fi# With every spec planned, the changed files add nothing. Leave them@@ -3042,11 +3075,16 @@ jobs:if [ "${WEBKIT_ALL_SPECS:-}" = true ]; then CHANGED=(); figit -C .test-scope ls-tree -r --name-only HEAD > "$RUNNER_TEMP/interaction-legs/listed.txt"selected="$RUNNER_TEMP/interaction-legs/selected.txt"- node "$RUNNER_TEMP/interaction-legs/.github/scripts/playwright-legs.mjs" select \- --listed "$RUNNER_TEMP/interaction-legs/listed.txt" \- "${CHANGED[@]}" \- --shared "$WEBKIT_SHARED_PATHS" \- -- "${SPEC_PATHS[@]}" > "$selected"+ # A Lab-only change runs only the interaction specs it edits.+ if [ -n "${LAB_SPECS:-}" ]; then+ cp "$LAB_SPECS" "$selected"+ else+ node "$RUNNER_TEMP/interaction-legs/.github/scripts/playwright-legs.mjs" select \+ --listed "$RUNNER_TEMP/interaction-legs/listed.txt" \+ "${CHANGED[@]}" \+ --shared "$WEBKIT_SHARED_PATHS" \+ -- "${SPEC_PATHS[@]}" > "$selected"+ fiif [ ! -s "$selected" ]; thenecho "No WebKit interaction proof covers this change: it touches no shared touch code, no interaction spec, and no component folder that holds one."printf 'count=0\nruns=false\nleg=%s\n' "${{ matrix.leg }}" >> "$GITHUB_OUTPUT"diff --git a/docs/specs/AST-030/spec.md b/docs/specs/AST-030/spec.mdindex ab688baaf6..f6edd570e0 100644--- a/docs/specs/AST-030/spec.md+++ b/docs/specs/AST-030/spec.md@@ -585,7 +585,7 @@ they are separately named.story of a component the change does not carry. So does an incomplete filelist or a base whose classifier has no Lab-only lane. An outsidecontributor's pull request still needs `ci:run` (FR17), and `main` and the- release-check cover Lab as before (DEC-21).+ release-check cover Lab as before (DEC-21). A Lab-only pull request that changes an interaction spec file (`*.interaction.browser.spec.ts`) still runs each changed spec, in its own leg when the scoped legs would not run it; the skip of interaction proofs above covers only Lab source changes.- **FR27 — Lint fails a pull request whose public text carries an internalreference.** Public text is each of the pull request's own commit messages and each line it adds, and the pull request's title and description as they read when the check runs. Generated text that no person writes, thelockfile and the digest list, is not read.@@ -680,6 +680,7 @@ The nightly perf lane is the one scheduled measurement outside them (FR18).| FR23 | `release-check-shape.test.mjs`, `a11y-contract-shard.test.mjs` and the release-check workflow contract | release-check and pull-request legs; a contract file longer than a leg's share, one it cannot name exactly, and a serial one; the recorded suite; a re-check from an admin, a maintainer and a writer, from another branch, with a short SHA and with an older commit; failed-only beside a passed, a running and a missing run | a narrower release-check, a held or over-budget leg, a test selected by no leg or by two, a re-check that a writer can start, that waits for main's running check, or that re-runs jobs of another commit fails || FR24 | `ci-heavy-lanes.test.mjs` cadence cases | release-check 170 and 176 minutes old; the unit lane hourly beside it; weekday 06:37 Pacific inside the window in standard and daylight time; the pre-cut check already started; the tip already checked; a weekend morning; before 06:30 and after 07:30 | a release-check starts inside the 175-minute window, the pre-cut check is skipped or starts twice, or it runs on a weekend || FR26 | `ci-lab-only-routing.test.mjs`, `change-scope.test.mjs` and `test-scope-action.test.mjs` Lab-only cases | a Lab-only change, with and without a Changeset; a new Lab component with its routes, discovery entry and story; Lab beside core, charts, a core Storybook story, a route or discovery entry for another component, an entry-file diff GitHub leaves out, the docsite, the Sandbox, a workflow, the lockfile, root configuration, internal tooling or a spec record; a rename into or out of Lab; an incomplete list; a base classifier without the lane; each required context, its owners, the UI legs' Lab tests, the UI and Node guard tests, the repository guards, the Storybook build and Lab typecheck, the heavy suites with and without a label, lint and an agent push | a mixed change takes the Lab-only lane; a new Lab component's own entry files make it mixed, or another component's do not; a changed existing story, a story for a component the change does not carry, or a renamed entry file keeps the lane; the CLI official-packages check, the route-lock check when the lock changed, or the Storybook build does not run for one; a required context skips or fails, or passes without its notice; a Lab test, a guard test, a repository guard, the Lab typecheck or the Storybook build does not run; an unlabelled heavy suite, the docsite or the full typecheck runs, or a label's suite cannot audit Lab; lint is skipped |+| FR26 | `test-scope-action.test.mjs` Lab-only interaction spec case; `ci-interaction-lab-specs.test.mjs` | a Lab-only pull request that edits a Lab interaction spec; one that changes only Lab source | the first runs no interaction proof or runs specs it did not edit, or the second runs any || FR27 | `check-public-text.test.mjs` over the check and the Lint workflow step | each identifier shape; a hashed name and host made up in the test; ordinary text; a finding in a commit message, an added line and the description; a match before the merge base; an empty range, a bad sha, a missing commit and a missing digest file | a reference passes; the output holds the matched text; a match on the base branch fails a later pull request; an unreadable range passes; the step runs the pull request's own copy || FR27 | `check-public-text.test.mjs` commit-list cases | a pull request whose merge base resolves too far back in a shallow clone; its own commit with an internal reference | the check flags the base branch's commits, or passes the pull request's own reference || FR28 | `playwright-legs.test.mjs` creator, prefix and head-repository cases ("plans every WebKit spec only for the release tooling's interaction-check/ pull request") | release interaction-check PRs: the release tooling's pull request; the same prefix from another author or from a fork; the tooling account on another branch | A prefix-only, other-author or fork pull request gets the full WebKit scope, or the tooling's interaction-check pull request does not |