Skip to content

ci: required lint takes its spec and docsite fast paths - #8880

Merged
cixzhang merged 2 commits into
mainfrom
ci/spec-only-fast-path
Oct 30, 2026
Merged

cixzhang merged 2 commits into
mainfrom
ci/spec-only-fast-path

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

A spec-only or docsite-only pull request should skip full ESLint in required lint (a tooling-only one still runs it, per AST-030 FR8); lint.yml already has those fast paths. They never fired. Its checkout was depth 1, and on a depth-1 PR merge commit git merge-base HEAD origin/main finds nothing. So the step fell back to "run full lint" on every pull request. Specs-only PR #8632 spent 197 s in ESLint, plus a 97 s checkout, for one changed spec.md. Now those PRs get the lint they were meant to get, and the required lint context still reports from real work on every PR.

Intended invariant

lint.yml feeds the trusted base classifier the same diff ci.yml's check-scope does: the merge commit against its merge base with the base branch. A spec-only or docsite-only change takes its existing fast path; a tooling-only change keeps full lint (FR8). Anything else, or a classifier that can't run, still runs full lint (fail-safe unchanged).

Change

  • lint.yml's checkout takes fetch-depth: 50, the history ci.yml's check-scope checks out, so the merge commit reaches its merge base. Nothing else changes.
  • New ci-lint-scope.test.mjs builds a real repository in which main moves on after the PR branches, checks out the way lint.yml does, and runs the real step and classifier. A spec-only PR gives spec_only=true, and a PR that also changes a component gives full lint.

Evidence

  • Failure before the change: against main's lint.yml, the checkout and spec-only cases fail. Reproduced against the real repository too: a depth-1 checkout of refs/pull/8632/merge, after fetching main at depth 50, finds no merge base.
  • Success after the change: 3/3 pass, and the .github/scripts Node suite passes. Two Chromium-timing tests in rtl-audit-cli flaked under machine load and pass when run alone.
  • Product/runtime behavior verified unchanged: workflow and test files only.

Scope

  • No intended public API, product behavior, or policy change; it makes an existing record-backed fast path work.
  • Public text contains no internal context.

Testing

pnpm vitest run --project node .github/scripts/ci-lint-scope.test.mjs .github/scripts/ci-tooling-routing.test.mjs

Lines of code

CI files (.github/**): +170 / −0, net +170. Justification: a one-line checkout fix; the added lines are a real-git contract test proving the classifier now runs.

lint.yml classifies a pull request's files with the trusted base classifier and
skips full ESLint for a spec-only, docsite-only or tooling-only change. Its
depth-1 checkout never let the merge commit reach its merge base, so the
classifier was never fed and every pull request ran full lint (about four
minutes of ESLint on a spec-only change). The checkout now takes the same
50-commit history ci.yml's check-scope does. A contract test runs the real
step and classifier with real git.
@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 11:56pm 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

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 29, 2026, 12:26 AM 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 50-commit checkout makes required lint's spec-only and docsite-only fast paths fire as spec:AST-030 FR3 intends, and the new contract test proves it with the real step and classifier; one wording fix is needed before this lands. The new test's header (.github/scripts/ci-lint-scope.test.mjs, lines 4-9) and the PR title say required lint skips full ESLint for tooling-only changes, but no lint step reads tooling_only and FR8 requires tooling-only changes to run the full lint workflow, so please describe only the spec and docsite fast paths there. Also worth knowing before merge: docsite-only pull requests will now skip ESLint in pull-request CI entirely, including the docsite iframe-sandbox and target-blank rules, as FR2's docsite owner list allows.

[Automated review]

Comment thread .github/scripts/ci-lint-scope.test.mjs Outdated
Comment on lines +4 to +9
* @file Contract: required lint takes its documentation, spec and tooling fast
* paths.
*
* lint.yml classifies a pull request's files with the trusted classifier from
* the base branch and skips full ESLint for a spec-only, docsite-only or
* tooling-only change. Its checkout was depth 1, where the merge commit never

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required lint has no tooling fast path: no lint.yml step reads tooling_only, so a tooling-only change runs setup, guardrails, the CLI README check and ESLint, as spec:AST-030 FR8 requires and ci-tooling-routing.test.mjs pins. Suggest naming only the spec and docsite fast paths here (and in the PR title):

 * @file Contract: required lint takes its documentation and spec fast paths.
 *
 * lint.yml classifies a pull request's files with the trusted classifier from
 * the base branch and skips full ESLint for a spec-only or docsite-only change;
 * a tooling-only change still runs it (spec:AST-030 FR8). Its checkout was
 * depth 1, where the merge commit never

Comment on lines +157 to +161
).toMatchObject({
spec_only: 'false',
docsite_only: 'false',
tooling_only: 'false',
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this case also passes against the base workflow, because the no-merge-base fallback writes the same three falses. Adding full_suite: 'false', which only the classifier writes, would show the classifier answered at the workflow's depth:

    ).toMatchObject({
      spec_only: 'false',
      docsite_only: 'false',
      tooling_only: 'false',
      full_suite: 'false',
    });

@cixzhang cixzhang changed the title ci: required lint takes its spec, docsite and tooling fast paths ci: required lint takes its spec and docsite fast paths Oct 28, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 50-commit checkout makes required lint's spec-only and docsite-only fast paths fire as spec:AST-030 FR3 intends, and the updated contract test now fails against the old workflow and passes with the change; the header and title wording raised last time is fixed, so this looks good to merge once the required checks report. No GitHub Actions run has appeared for the latest commit yet, so lint, test and the other required checks still need to run. Worth knowing before merging: docsite-only pull requests will now skip ESLint (including the docsite iframe-sandbox and target-blank rules) and the repository guardrails in pull-request CI, as FR2's docsite owners allow.

[Automated review]

@cixzhang cixzhang closed this Oct 30, 2026
@cixzhang cixzhang reopened this Oct 30, 2026
@cixzhang cixzhang closed this Oct 30, 2026
@cixzhang cixzhang reopened this Oct 30, 2026
@cixzhang
cixzhang merged commit 45b112c into main Oct 30, 2026
53 checks passed

This branch was successfully deployed

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