Skip to content

ci: a push that only merges main carries the last passing result forward (AST-030 FR18) - #9170

Closed
cixzhang wants to merge 2 commits into
mainfrom
ci/carry-forward-merge-only-push
Closed

cixzhang wants to merge 2 commits into
mainfrom
ci/carry-forward-merge-only-push

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Parked. Measured over a day of pull-request runs, pushes that only merge main are about 3% of PR CI, and none would have carried under this rule. Closed in favour of cheaper CI changes; reopen if merge-only pushes grow.

User impact

  • Before: every push that only merges main into a pull request reruns all of its CI, though the pull request's own change is the same one that already passed. Long-lived pull requests merge main many times a day, and each merge pays the full suite again.
  • After: when a push only merges main and the pull request's own diff is byte-identical to the previous head, whose run passed, the required checks (build, test, docsite-test, lint) pass at once and name the run they carry forward: "Carried forward from run N at ". Nothing is skipped silently.
  • Unchanged: the pre-merge re-run (any later attempt) runs everything, so the run that gates the merge covers main's changes. A push that changes the pull request's diff, a file main also changed, an opened, reopened or ready pull request, a failed or cancelled previous run, and anything the step cannot read or compare all run normally. Merge-group entries, main, release checks and ci:heavy-lanes owners are unaffected.

Authority

Asked for by the CI owner, 2026-10-31: pull requests that receive hundreds of updates that only merge main. spec:AST-030 gains FR18 (and DEC-10, a Verification row and a CONTRIBUTING line). That needs an owner's /approve-spec at this head.

Changes

  • .github/actions/test-scope/action.yml (loaded from the merge commit, as ci: the interaction job loads the heavy-suite caps from the merge commit, not the pull request head #9005 loads heavy-caps): a new carry-forward input. On the first attempt of a synchronize push it compares the pull request's own diff (each file's status, names, blob and patch against the merge base) at the push's previous head with this head's file list; when they are identical and the same workflow's last completed run on the previous head passed, it reports carried: true, carried_from: run N at <sha>, applies: false, and leaves a notice. A push that changes the diff makes one extra call; any error runs the job.
  • ci.yml: docsite-test, test-ui, test-node, build-storybook, size-base, typecheck, test-build, pr-interaction, pr-interaction-webkit, native-swift-runner and the test join opt in and gain actions: read; every work step also requires carried != 'true' (the interaction and Swift jobs already gate on applies). build names the carried run from build-storybook.
  • lint.yml: the scope step runs first with carry-forward, and every later step skips when it carries.
  • Tests:
    • test-scope-action.test.mjs: carry cases (merge-only push after a pass; a failed, cancelled or unfinished previous run; a changed patch, blob, name or file set; truncated list; re-run; opened, reopened or ready; no previous head; another branch's run; a fork; unreadable runs or comparison).
    • ci-carry-forward.test.mjs (new): evaluates every step condition of every opted-in job with a carried result and fails if any work step would still run; checks actions: read, the build notice, and that the label opt-in owners do not carry. Mutation-checked: an unconditional step, or one condition without the carried check, fails it.
    • Six workflow contract tests updated for the added condition.

Evidence

  • test-scope-action.test.mjs and ci-carry-forward.test.mjs: 79 pass. Dropping the carried check from one step, or adding an unconditional step, fails the contract test.
  • The six updated workflow contract tests pass.
  • Replay over the last day of pull-request runs: 22 of 699 CI runs followed a push that left the pull request's own diff unchanged. None of them was a merge-commit push after a passing run, so this rule would have carried none of them. Most merges of main changed the diff (main touched the same files), followed a failed run, or happened while the pull request was a draft.

Scope

  • One change: a merge-only push carries the last passing result forward.
  • Public text contains no internal Meta context.

Writing rubric results

  • R1 narration: none. FR18 and DEC-10 are present tense.
  • R2 research: none.
  • R3 evidence: the FR18 Verification row names the new states (merge-only push after a pass, failure, cancelled run; changed diff; re-run; unreadable comparison) and failures (a carried job that runs work, a hidden carried run, a re-run or changed diff that carries).
  • R4 rejected alternatives: DEC-10 records rerunning only what main's change reaches, and carrying across line-offset-only differences.

@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 Ready Ready Preview Oct 31, 2026 6:03pm 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, 5:53 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

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@cixzhang cixzhang closed this Oct 31, 2026
@cixzhang
cixzhang deleted the ci/carry-forward-merge-only-push branch October 31, 2026 18:06

This branch was successfully deployed

1 active deployment
Preview — 2aef7d0c 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