Repository navigation
perf(ci): scope pr-rtl to the components a PR touches - #4796
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
nynexman4464
force-pushed
the
nynexman4464/perf/rtl-audit-scope
branch
from
August 7, 2026 16:08
176d3c2 to
310537d
Compare
nynexman4464
marked this pull request as ready for review
August 7, 2026 16:27
pr-rtl ran the RTL audit unfiltered on every PR, sweeping all ~1400 core-* stories in ~26 minutes — the long pole of PR CI by 2.5x, and paid even by PRs that touch no component. On #4758 (eslint-plugin + docs only) the sibling pr-a11y correctly skipped in 0s while pr-rtl audited the whole library. Scope the job like pr-a11y: gate on check-components.has_components, download pr-analysis, and pass the changed components to the audit's --filter. Every piece already existed — check-components publishes has_components, analyze-pr.js writes newComponents/modifiedComponents, rtl-audit.mjs parses --filter — pr-a11y used all three, pr-rtl used none. New components stay covered via newComponents. Also short-circuit D5 before the RTL page load. autoPositionalMirror loaded LTR, always loaded RTL, then checked whether either produced candidates. With no LTR candidate there is nothing to measure against, and 1378 of 1394 stories have none, so this drops ~half of D5's page loads. It also closes a silent false-pass: the old `ltr === 0 && rtl === 0` guard let one-sided stories reach a compare loop that runs min(ltr, rtl) = 0 times and reported "pass" having compared nothing. Adds a root rtl:audit script for parity with a11y:audit, which also avoids a footgun — pnpm -F IS --filter, so `pnpm -F @astryxdesign/storybook rtl-audit --filter Avatar` has pnpm eat the flag and audit everything. Coverage for untouched components comes from the weekly full sweep in the stacked follow-up, mirroring the pr-a11y / a11y-weekly.yml split. Test plan: verified against the Storybook artifact from run 31122588220 (same 1394 stories). `pnpm rtl:audit -- --filter Avatar,TableTree` finishes in 19.7s and reproduces that run's Avatar verdicts exactly (cand=3/14/4/6/14). Full unfiltered sweep of the unmodified script on the same input: 1724s, matching CI's counts (AUTO 11/0/114, PM 16/0/1378). ci.yml parses; pnpm check:repo clean; prettier-clean.
nynexman4464
force-pushed
the
nynexman4464/perf/rtl-audit-scope
branch
from
August 7, 2026 18:38
310537d to
bc6316a
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pr-rtlran the RTL audit unfiltered on every PR — all ~1400core-*stories, ~26 min, the long pole of PR CI by 2.5× (next slowest:test, 10 min). It ran even on PRs touching no component: on #4758 (eslint-plugin + docs only)pr-a11ycorrectly skipped in 0s whilepr-rtlaudited the whole library. Yield for those 26 minutes: 27 verdicts and 1492 N-A.Changes
1. Scope the job like
pr-a11y— gate oncheck-components.has_components, downloadpr-analysis, pass the changed components to the audit's--filter. All three mechanisms already existed;pr-a11yused them andpr-rtlused none. New components stay covered vianewComponents. The empty-string guard matters: an absent or empty--filtermeans "audit everything".2. Short-circuit D5 before the RTL page load —
autoPositionalMirrorloaded LTR, always loaded RTL, then checked whether either produced candidates. With no LTR candidate there's nothing to measure against, and 1378 of 1394 stories have none. Also closes a silent false-pass: the oldltr === 0 && rtl === 0guard let one-sided stories reach a compare loop runningmin(ltr, rtl) = 0times, reporting pass having compared nothing.3. Root
rtl:auditscript — parity witha11y:audit, and avoids a footgun:pnpm -Fis--filter, sopnpm -F @astryxdesign/storybook rtl-audit --filter Avatarhas pnpm eat the flag and audit everything. Plus a short pointer in CONTRIBUTING.md.Also fixes
pr-rtlred on docsite-only PRsReported separately: docsite-only PRs build no Storybook artifact, so
short_hashis empty and the job tries to downloadstorybook-. Confirmed on #4770 (run). The proposed fix was "mirrorpr-a11y's guard" — which is what this PR does, so no separate guard PR is needed.Coverage tradeoff
Scoped CI can't see a component no PR touched. #4797 restores that with a weekly full sweep, mirroring
pr-a11y/a11y-weekly.yml.Test plan
Verified against the Storybook artifact from run 31122588220 (same 1394 stories), not a rebuild.
Scoped:
pnpm rtl:audit -- --filter Avatar,TableTree→ 19.7s (from ~26 min), reproducing that run's Avatar verdicts exactly (cand=3/14/4/6/14).Full sweep A/B, same machine, same input:
main45.7% faster from the short-circuit alone, with verdicts diffed element-by-element:
auto,pm, andcurall identical (n=125 / 1394 / 3).Also:
ci.ymlparses with the expected 8 steps;pnpm check:repoclean.ci.ymlandrtl-audit.mjsalready fail prettier onmain(it only covers*.{ts,tsx,md}), so they're deliberately not reformatted. No changeset — no publishable package, matching #4718 / #4708 / #4674.Follow-ups
settle()— ~9 min of a full sweep spent idle.