Skip to content

ci: the interaction and native Swift scope jobs measure the pull request's own diff - #8812

Merged
cixzhang merged 1 commit into
mainfrom
ci/scope-measures-pr-diff
Oct 28, 2026
Merged

cixzhang merged 1 commit into
mainfrom
ci/scope-measures-pr-diff

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Maintainer impact

A pull request cut before the interaction proofs existed can fail the required test join even when it touches nothing the proofs cover. The interaction-scope job ran with HEAD at the PR merge commit, and pr-scope-touches.sh diffs HEAD against its merge base with the PR's base.sha. For a long-lived PR that base is old, so the diff carried main's own changes since then, including the commit that created playwright.interaction.config.ts. The job read "this PR changes the config", ran the proofs, and they failed on a head that has no config. Two approved pull requests hit this this morning: a CLI-only one, and a DropdownMenu fix whose head predates the proofs. The native Swift scope job has the same pattern.

Intended invariant

The interaction proofs run when the pull request's own change is in their scope, and a head cut before them passes with the existing notice. Anything undecided still runs them, unchanged. The native Swift job keeps deciding on the PR's own change, or on the queued merge in the merge queue.

Change

  • interaction-scope checks out pull_request.head.sha. native-swift-scope checks out pull_request.head.sha || github.sha, which keeps the merge-queue path.
  • The decide scripts and the helper are unchanged.
  • New .github/scripts/ci-scope-pr-diff.test.mjs builds real repositories in which main moves on after the PR branches. It checks out the way the workflow does and runs the actual decide step and helper against a local origin:
    • CLI-only PR on an old base: no proofs.
    • Component PR on an old base: skipped with the "predate this branch" notice.
    • PR that deletes the config: proofs run.
    • Unfetchable head: proofs run (fail safe).
    • Both checkouts name the PR head.

Evidence

  • Failure before the change: against main's workflow, 3 of the 5 cases fail: the checkout shape, the CLI-only case and the component case. The fail-safe and config-change cases pass on both.
  • Success after the change: 5/5 pass, and the ci-* and change-scope suites pass (194).
  • Product/runtime behavior verified unchanged: workflow and test files only.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

pnpm vitest run --project node .github/scripts/ci-scope-pr-diff.test.mjs .github/scripts/ci-*.test.mjs .github/scripts/change-scope.test.mjs

…est's own diff

Both scope jobs ran the base's pr-scope-touches.sh with HEAD at the PR merge
commit, so the diff from the merge base with the PR's (often old) base
included main's own changes since then. A CLI-only pull request cut before
the interaction proofs existed read as changing their config, ran proofs its
head cannot run, and failed the required test join. Both jobs now check out
the PR head; the fail-safe paths are unchanged. A contract test runs the real
step and helper with real git over four cases.
@vercel

vercel Bot commented Oct 28, 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 Oct 28, 2026 3:41pm UTC

Request Review

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

astracat-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 28, 2026, 4:05 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@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.

Recommending approval: checking out the pull request head makes both scope jobs measure the pull request’s own merge-base diff, while the base-loaded helper and every fail-closed exit stay as they were. The new real-git test fails against the current workflow and passes with this change, which is the regression evidence the routing spec asks for. Nothing further is needed; note only that a component pull request whose head predates the interaction proofs will now pass with the existing notice and can land without them unless main is merged.

[Automated review]

@cixzhang
cixzhang merged commit 387c699 into main Oct 28, 2026
74 checks passed
@cixzhang
cixzhang deleted the ci/scope-measures-pr-diff branch October 28, 2026 16:12

This branch was successfully deployed

1 active deployment
Preview — 3832683a Deployed Oct 28, 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