Skip to content

ci: per-suite ci:run-visual, ci:run-a11y and ci:run-rtl labels replace ci:heavy-lanes - #9165

Merged
cixzhang merged 2 commits into
mainfrom
ci/per-suite-run-labels
Oct 31, 2026
Merged

cixzhang merged 2 commits into
mainfrom
ci/per-suite-run-labels

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

ci:heavy-lanes turns on the visual, accessibility and RTL suites together. A pull request that needs only one of them still pays for all three. And anyone who can apply labels can start them. Per-suite labels run only the suite a change needs, and only when someone with write access asked for it.

Intended invariant

  • A pull request runs a heavy suite only while it carries that suite's label, ci:run-visual, ci:run-a11y or ci:run-rtl, last applied by someone with write access (the review gate's rule). A label runs only its own suite.
  • A lookup that cannot confirm the labeler runs nothing (fail closed).
  • Labels take effect on the next push or reopen, never on the label event (spec:AST-030 FR17), and removing one stops its suite from the next run.
  • ci:run stays the fork gate. The release check's full set on the exact SHA is unchanged. No required context depends on these suites.
  • Each suite keeps its existing path scoping. The per-author heavy caps keep exempting maintainer opt-ins (FR16).

Change

  • New run-labels job (ubuntu-slim, 5 min, read-only permissions).
    • Its script, .github/scripts/run-labels.cjs, comes from the merge commit's sparse checkout.
    • It reads the event's labels and, for each suite label, the newest LABELED_EVENT actor's access, decided by the review gate's own hasWritePermission (from review-signal-decision.cjs, so labels and reviews answer the same way). A failed lookup denies only that labeler's suites. It outputs visual, a11y and rtl as true or false; outside a pull request every output is false.
    • It runs for the release check too, so the owners that need it still run there.
    • The labeler check follows the perf workflow's design, factored into one shared module that the perf workflow can adopt.
  • Owners: visual-scout and pr-visual read needs.run-labels.outputs.visual; pr-a11y-guards, pr-a11y-specs and pr-a11y read a11y; pr-rtl-shard, pr-rtl-merge and pr-rtl read rtl. No owner reads a label directly anymore.
  • PR comment: when the accessibility audit didn't run, the comment says "Accessibility did not run on this pull request; add ci:run-a11y to run it." notRunSentence(suite) words that sentence for visual, a11y and RTL.
  • Records and docs:
    • spec:AST-030 FR12, FR13, FR16 and DEC-6/DEC-7 name the per-suite labels and the write-access rule.
    • architecture:rtl-audit-evidence INV7 names ci:run-rtl.
    • CONTRIBUTING, the visual-gate README and the RTL-audit README are updated.
  • Not changed:
    • The release-only lanes (the full a11y audit, a11y-contracts, test-registry-e2e) get no label.
    • ci:run-perf belongs to the perf workflow, which isn't on main yet.
  • After merge: create the three labels in the repository and delete ci:heavy-lanes.

Evidence

  • run-labels.test.mjs:
    • Each label opts in only its own suite.
    • Write and admin access run it (GitHub reports maintain and custom write-based roles as write); read and no access don't, and the job says why.
    • A failed access lookup denies only that labeler's suites.
    • Each label's newest application decides, not an earlier one.
    • A removed label runs nothing.
    • A failed lookup or a missing event runs nothing.
    • Each labeler is looked up once, and no call is made without a suite label.
    • Outside a pull request nothing is opted in.
    • The not-run sentence for each suite (visual, a11y, RTL).
  • Replay: each label set (none, visual, a11y, RTL, visual plus RTL) goes through the real decision into every heavy owner's if: in ci.yml. Only that label's owners run.
  • ci-heavy-lanes.test.mjs: every owner reads only its own suite's decision and needs run-labels. The gate's shape is pinned (trusted script, outputs, permissions). No workflow names ci:heavy-lanes.
  • Updated tests: release-check routing (it runs run-labels), visual maintenance (an opted-in PR runs visual; another suite's label doesn't), the PR gate (a fork with only a suite label runs nothing), and visual-gate concurrency.
  • Suites: .github/scripts passes 85 files and 1,563 tests. One fs-guard-tests case timed out under heavy local load and passes on a re-run here and on main.
  • actionlint: no new findings. pnpm check:knowledge: aligned.

Scope

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

Writing rubric results

R1 narration: none. The FR12, FR13, FR16, DEC-6 and DEC-7 edits state which label runs which suite, in the present tense.
R2 research: none.
R3 evidence: none changed. No cell names a pull request.
R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: none.

Testing

pnpm vitest run --project node .github/scripts/; actionlint .github/workflows/ci.yml; pnpm check:knowledge.

…e ci:heavy-lanes

Each label opts a pull request into one heavy suite. A run-labels gate job
reads the event's labels and, for each suite label, the newest labeler's
role (write, maintain or admin; fail closed), from a decision script in the
merge commit's sparse checkout; each suite's owners need it and run only on
their own suite's output. A label still takes effect on the next push or
reopen, ci:run stays the fork gate, and the release check is unchanged.
The pull-request comment names the label for a suite that did not run.
AST-030, CONTRIBUTING and the visual and RTL docs name the new labels.
@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 5:55pm UTC

Request Review

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

astracat-bot Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 31, 2026, 6:03 PM UTC

@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

Preview: the links below open this branch's latest Vercel deployment, which can trail a new push until that push's deployment is ready.

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: The accessibility audit did not run on this pull request. It runs after merges to main and before each release; pull requests that touch components run it with the ci:heavy-lanes label.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 4c9cfea

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 31, 2026
@cixzhang
cixzhang marked this pull request as ready for review October 31, 2026 17:12

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

Changes requested: the spec amendments are approved for this head, but four fixes remain before this can merge.

  • Decide write access with the shared hasWritePermission in .github/scripts/review-signal-decision.cjs instead of the new WRITE_ROLES check on role_name, which answers differently for custom write-based roles than the review gate does.
  • Catch permission-lookup failures per labeler in run-labels.cjs; today one failure denies every suite label and reports the maintainer's role as unknown.
  • Fix the CONTRIBUTING.md sentence saying the comment names the label for each suite that did not run (only accessibility gets that line), and the description's mention of a status table.
  • Drop the ci:run-perf entry until the perf workflow that honours it lands.

[Automated review]

Comment thread .github/scripts/run-labels.cjs Outdated
rtl: 'ci:run-rtl',
});

const WRITE_ROLES = new Set(['admin', 'maintain', 'write']);

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.

This re-implements the write-access decision that hasWritePermission in .github/scripts/review-signal-decision.cjs already owns. That helper reads the API's permission field, where maintain and custom write-based roles report write; role_name reports a custom role's own name, so a collaborator the review gate treats as write access runs nothing here. Calling hasWritePermission(data) (and adding that file to the job's sparse checkout) keeps one answer.

Comment thread .github/scripts/run-labels.cjs Outdated
roles.set(login, data.role_name);
}
}
} catch (error) {

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.

Because every lookup shares this one catch, a failure for one labeler skips the lookups still pending for the others: with ci:run-visual from an account whose lookup throws and ci:run-a11y from a maintainer, a11y comes out false and the notice says the maintainer has an "unknown role". Catching per labeler denies only that labeler's suites, and the notice can say the lookup failed.

Comment thread .github/scripts/run-labels.cjs Outdated
visual: 'Visual',
a11y: 'Accessibility',
rtl: 'RTL',
perf: 'Perf',

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.

No workflow on this branch honours ci:run-perf, and no record defines it, so notRunSentence('perf') would tell people to add a label that does nothing. Suggest adding this entry with the perf workflow.

Comment thread CONTRIBUTING.md Outdated
Comment on lines +933 to +934
that suite from the next run. The pull-request comment names the label for
each suite that did not run.

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.

Only the accessibility section of the comment uses notRunSentence; buildVisualSection returns nothing when visual did not run and the comment has no RTL section. Either reword to "When the accessibility audit did not run, the comment names ci:run-a11y" or add the visual and RTL lines.

Decide write access with review-signal-decision.cjs's hasWritePermission, so
a label and a review answer the same way; a failed access lookup denies only
that labeler's suites. Drop the perf sentence until the perf workflow lands,
and say only what the comment names (ci:run-a11y).

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

Looks good to merge: the spec amendments are approved for this head, and the follow-up commit fixes all four points from the last review. Three optional cleanups remain: move build-storybook's description comment in ci.yml back above that job, drop "trusted" for the merge-commit checkout of the decision script, and date the DEC-6 and DEC-7 amendments the way DEC-4 and DEC-5 do. After merging, create the three ci:run-* labels and delete ci:heavy-lanes.

[Automated review]

Comment thread .github/workflows/ci.yml
Comment on lines +879 to +887
# Which heavy suites this pull request opted into: one output per suite,
# `true` while the pull request carries that suite's `ci:run-<suite>` label
# and its newest application came from someone with write, maintain or
# admin access (spec:AST-030 FR12). It reads the event that started the run,
# so a label takes effect on the next push or reopen (FR17). Outside a pull
# request every output is `false`; the release check runs every suite on its
# own terms. The decision script comes from the merge commit's trusted
# sparse checkout, and a lookup that fails denies the suite.
run-labels:

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.

Optional cleanup: this job landed between build-storybook's description (the four comment lines just above) and build-storybook itself, so that description now reads as part of this block and build-storybook has none; moving the four lines down to sit above build-storybook: fixes it. Line 885 also calls the merge-commit checkout "trusted"; on a pull request it is the pull request's own copy, so "merge commit's sparse checkout" says what it is.

@cixzhang
cixzhang merged commit 4cb7f27 into main Oct 31, 2026
51 checks passed
@github-actions
github-actions Bot deleted the ci/per-suite-run-labels branch November 1, 2026 06:05

This branch was successfully deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant