Repository navigation
ci: run the interaction proofs in WebKit for gesture, motion and touch changes - #9138
Conversation
…h changes pr-interaction runs the touch interaction proofs in Chromium only, so a WebKit- or iOS-only correction had no CI guard. pr-interaction-webkit runs the same proofs in WebKit (Playwright on ubuntu-latest, 15-minute budget), scoped to the gesture host and recognizers, the motion runtime, the touch helpers, press feedback, the menu press model, and the harness and config that drive them (plus its own definition). Out of scope it skips visibly and reports success; the existing test join requires it, so it adds no required context. It uses the shared scope action and the merge-ref heavy-suite caps.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: The accessibility audit did not run on this pull request. It runs after merges to Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Requesting changes: the WebKit job is wired into test correctly and passed on this head, but its scope needs to match what it runs and what spec:AST-030 FR13 requires before it can guard what it claims.
- The run executes every interaction spec, DateInput, TabList and TreeList included, while the scope covers only gestures, motion and the harness, so a WebKit break in those specs lands green and fails
teston the next unrelated in-scope pull request; filter the run to the in-scope spec directories or widen the scope to match. package.json,pnpm-lock.yaml, Storybook config, theme sources andinternal/a11y-spec/skip the job, although FR13 runs shared infrastructure in full andpr-interactionalready keeps them in scope; a Playwright upgrade is the clearest case.- Smaller:
pressGesture.ts,menuPressGesture.ts,useLongPress.ts,usePressFeedback.tsandtouchPresentation.tsfall outside the regex, so the skip message is wrong for them.
[Automated review]
| id: scope | ||
| uses: ./.test-scope/.github/actions/test-scope | ||
| with: | ||
| paths: '^(packages/core/src/gestures/|packages/core/src/motion/|packages/core/src/internal/touch|packages/core/src/utils/pressFeedback|packages/core/src/hooks/useMenuPress|internal/interaction-harness/|playwright\.interaction\.config\.ts$|\.github/workflows/ci\.yml$|\.github/actions/test-scope/)' |
There was a problem hiding this comment.
This regex leaves out package.json, pnpm-lock.yaml, apps/storybook/, packages/themes/[^/]+/src/ and internal/a11y-spec/, which pr-interaction keeps (line 1785) and spec:AST-030 FR13 treats as shared infrastructure that runs the full suite. A Playwright upgrade swaps the WebKit build these proofs run on and would skip them. It also misses the press and menu-press state machines (utils/pressGesture.ts, hooks/menuPressGesture.ts, hooks/menuPressOnItems.ts, hooks/usePressFeedback.ts, hooks/useLongPress.ts) and the touch gate (utils/touchPresentation.ts, utils/touchQueries.ts), so the skip message on line 1911 is wrong for them.
| run: | | ||
| pnpm exec playwright test \ | ||
| --config playwright.interaction.config.ts \ | ||
| --project webkit \ | ||
| --output interaction-proof-output-webkit |
There was a problem hiding this comment.
With no spec filter this runs every interaction spec, including DateInput/MonthScrollerSteps, TabList/TabListOverflow and TreeList/TreeListGuideAlignment (nine tests that pass in WebKit today), but the scope above never gates on those components or specs. A pull request that breaks one in WebKit lands green, and the next in-scope pull request gets the red test. Either pass the in-scope spec directories here (internal/interaction-harness packages/core/src/gestures packages/core/src/motion) or widen the scope to every directory with an interaction spec.
| 'packages/themes/neutral/src/neutralTheme.ts', | ||
| 'apps/storybook/.storybook/preview.tsx', | ||
| 'docs/specs/AST-030/spec.md', | ||
| 'package.json', | ||
| 'pnpm-lock.yaml', |
There was a problem hiding this comment.
These assertions pin theme sources, Storybook config, package.json and pnpm-lock.yaml as skipping the WebKit proofs, the opposite of FR13's shared-infrastructure rule and of the Chromium contract in ci-interaction.test.mjs. They should flip with the scope fix.
Run only the gesture, motion and harness specs, so a WebKit break in a component spec never turns an unrelated pull request red. Bring the shared setup pr-interaction already keeps into scope (spec:AST-030 FR13: root manifests and lockfile, Storybook config, theme sources, the a11y spec helpers), and widen the press and touch helpers the regex missed.
There was a problem hiding this comment.
Requesting changes: the shared-setup scope and the run filter now match spec:AST-030 FR13's shared-infrastructure clause, and the WebKit job passed on this head, but the scope still misses code the run loads. animatedLayoutAdopters renders Collapsible, TreeList, ScrollableArea and useAnimatedLayout, and the gesture fixture bundles utils/primaryClick.ts and utils/isApplePlatform.ts; none matches the regex at ci.yml:1902, so a WebKit break there lands green and fails test on the next in-scope pull request. Add those paths to the scope with test cases (or leave the adopters spec to the Chromium job), then refresh the description's Scope list.
[Automated review]
| id: scope | ||
| uses: ./.test-scope/.github/actions/test-scope | ||
| with: | ||
| paths: '^(packages/core/src/gestures/|packages/core/src/motion/|packages/core/src/internal/touch|packages/core/src/utils/(press|touch)|packages/core/src/hooks/(useMenuPress|menuPress|useLongPress|usePressFeedback)|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/actions/test-scope/)' |
There was a problem hiding this comment.
This regex misses code the WebKit run loads: animatedLayoutAdopters renders Collapsible, TreeList, ScrollableArea and hooks/useAnimatedLayout.ts (apps/storybook/stories/AnimatedLayout.stories.tsx:5-9), and the gesture fixture bundles utils/primaryClick.ts and utils/isApplePlatform.ts. A WebKit break through any of them skips this job and fails test on the next in-scope pull request. Add packages/core/src/(Collapsible|TreeList|ScrollableArea)/, packages/core/src/hooks/useAnimatedLayout and packages/core/src/utils/(primaryClick|isApplePlatform), or drop the adopters spec from the run.
| ]; | ||
| for (const target of targets) { | ||
| expect(run).toContain(target); | ||
| // Each spec directory it runs is one its scope covers. |
There was a problem hiding this comment.
This checks that each run directory is in scope, not that the code those specs load is; the adopters story and the gesture fixture both reach paths the regex skips. An in-scope case per reached path (for example packages/core/src/TreeList/TreeListItem.tsx) would pin it.
The gesture fixture bundles utils/primaryClick and utils/isApplePlatform, so both join the scope. The motion adopters spec renders Storybook components (Collapsible, TreeList, ScrollableArea), so it stays with the Chromium proofs. A contract test builds each WebKit bundle and requires every source it reaches to be in scope.
There was a problem hiding this comment.
Approving: the WebKit lane now matches what it runs. The scope covers every source the four specs load — an esbuild pass over fixture.ts, animatedLayoutBundle.ts and motionBundle.ts puts all 41 inputs in scope, and the run resolves to 177 tests in the four intended files — and test picks the job up through ci-test-join.mjs without a new required context, so spec:AST-030 FR7, FR11, FR13, FR16 and FR17 all hold.
One thing worth a follow-up, not a blocker: the reach test lists its bundle entries by hand (ci-interaction-webkit.test.mjs:143-147), while the run's gestures/ and internal/interaction-harness/ filters pick up any new spec or fixture. #8360 adds bareFixture.ts, which imports utils/selectionLock.ts — outside the scope regex — so the guard would stay green there; building every non-spec file under the run's directories would keep it true by construction.
[Automated review]
| it.each([ | ||
| 'packages/core/src/gestures/__tests__/browser/fixture.ts', | ||
| 'packages/core/src/motion/__tests__/animatedLayoutBundle.ts', | ||
| 'packages/core/src/motion/__tests__/motionBundle.ts', | ||
| ])('keeps everything %s bundles in scope', async entry => { |
There was a problem hiding this comment.
Non-blocking: this list is hand-kept, while the run's gestures/ and internal/interaction-harness/ filters pick up any new spec or fixture on their own. #8360 adds bareFixture.ts beside fixture.ts, and it imports utils/selectionLock.ts, which the scope regex does not cover — the guard would stay green there. Discovering the entries (every non-spec file under the run's test directories) would keep this true by construction.
Maintainer impact
The touch interaction proofs run in Chromium only (
pr-interaction --project chromium), so a correction that exists only for WebKit, the engine of every iOS browser, has no CI guard. #8360's tap-on-moving-content correction (presentedHitTesting.interaction.browser.spec.ts) is one example: the WebKit project inplaywright.interaction.config.tsexists but never runs on a pull request, so a regression in WebKit-specific gesture or motion code can land green.Intended invariant
testjoin stays the one required context for test owners, and every owner it waits on reports success whether it ran or skipped (spec:AST-030 FR7, FR11).Change
pr-interaction-webkitjob inci.yml. It mirrorspr-interactionstep for step but runs--project webkit, afternpx playwright install --with-deps webkitonubuntu-latest, with a 15-minute timeout..github/actions/test-scopepaths): the code where WebKit and Chromium differ on touch —packages/core/src/gestures/,packages/core/src/motion/,packages/core/src/internal/touch*,packages/core/src/utils/{press*,touch*,primaryClick*,isApplePlatform*},packages/core/src/hooks/{useMenuPress*,menuPress*,useLongPress*,usePressFeedback*},internal/interaction-harness/— plus the shared setuppr-interactionkeeps (spec:AST-030 FR13):playwright.interaction.config.ts,package.json,pnpm-lock.yaml,apps/storybook/,packages/themes/*/src/,internal/a11y-spec/, and its own definition (.github/workflows/ci.yml, the scope action).packages/core/src/gestures/__tests__/browser/, so the gestures path covers them.animatedLayoutandanimator(motion), and the harness spec (177 tests). The motion adopters spec renders Storybook components (Collapsible, TreeList, ScrollableArea), and the component specs (DateInput, TabList, TreeList, SideNav) stay with the Chromium proofs, so a WebKit break there never turns an unrelated pull request red. A contract test builds each WebKit bundle and requires every source file it reaches to be in scope.pr-interaction.testnow needspr-interaction-webkit, andci-test-join.mjsrequires its success. No new required context.Evidence
ci-interaction-webkit.test.mjs(scope in and out, visible skip, every later step gated, joined bytest, same pull-request gate, standard runner, 15-minute timeout, exact-head checkout, WebKit project), plus updates toci-test-join.test.mjs,ci-tooling-routing.test.mjsandheavy-caps-action.test.mjs..github/scriptspasses: 84 files, 1,517 tests. The one failure is a test that needs a git checkout, which this local copy lacks; it is unrelated.ci.yml.actionlint: no new findings onci.yml(the same 20 pre-existing lines as main).Scope
Testing
pnpm vitest run --project node .github/scripts/;actionlint .github/workflows/ci.yml; replay of PR file lists through the scope pattern.