Repository navigation
ci: per-suite ci:run-visual, ci:run-a11y and ci:run-rtl labels replace ci:heavy-lanes - #9165
Conversation
…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.
|
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 |
|
/approve-spec 4c9cfea |
There was a problem hiding this comment.
Changes requested: the spec amendments are approved for this head, but four fixes remain before this can merge.
- Decide write access with the shared
hasWritePermissionin.github/scripts/review-signal-decision.cjsinstead of the newWRITE_ROLEScheck onrole_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.mdsentence 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-perfentry until the perf workflow that honours it lands.
[Automated review]
| rtl: 'ci:run-rtl', | ||
| }); | ||
|
|
||
| const WRITE_ROLES = new Set(['admin', 'maintain', 'write']); |
There was a problem hiding this comment.
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.
| roles.set(login, data.role_name); | ||
| } | ||
| } | ||
| } catch (error) { |
There was a problem hiding this comment.
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.
| visual: 'Visual', | ||
| a11y: 'Accessibility', | ||
| rtl: 'RTL', | ||
| perf: 'Perf', |
There was a problem hiding this comment.
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.
| that suite from the next run. The pull-request comment names the label for | ||
| each suite that did not run. |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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]
| # 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: |
There was a problem hiding this comment.
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.
Maintainer impact
ci:heavy-lanesturns 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
ci:run-visual,ci:run-a11yorci:run-rtl, last applied by someone with write access (the review gate's rule). A label runs only its own suite.ci:runstays the fork gate. The release check's full set on the exact SHA is unchanged. No required context depends on these suites.Change
run-labelsjob (ubuntu-slim, 5 min, read-only permissions)..github/scripts/run-labels.cjs, comes from the merge commit's sparse checkout.LABELED_EVENTactor's access, decided by the review gate's ownhasWritePermission(fromreview-signal-decision.cjs, so labels and reviews answer the same way). A failed lookup denies only that labeler's suites. It outputsvisual,a11yandrtlastrueorfalse; outside a pull request every output isfalse.visual-scoutandpr-visualreadneeds.run-labels.outputs.visual;pr-a11y-guards,pr-a11y-specsandpr-a11yreada11y;pr-rtl-shard,pr-rtl-mergeandpr-rtlreadrtl. No owner reads a label directly anymore.ci:run-a11yto run it."notRunSentence(suite)words that sentence for visual, a11y and RTL.spec:AST-030FR12, FR13, FR16 and DEC-6/DEC-7 name the per-suite labels and the write-access rule.architecture:rtl-audit-evidenceINV7 namesci:run-rtl.ci:run-perfbelongs to the perf workflow, which isn't onmainyet.ci:heavy-lanes.Evidence
run-labels.test.mjs:write); read and no access don't, and the job says why.if:inci.yml. Only that label's owners run.ci-heavy-lanes.test.mjs: every owner reads only its own suite's decision and needsrun-labels. The gate's shape is pinned (trusted script, outputs, permissions). No workflow namesci:heavy-lanes.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..github/scriptspasses 85 files and 1,563 tests. Onefs-guard-testscase 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
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.