Repository navigation
test(docs): scan changed pages for WCAG 2.1 A/AA in warn mode - #48727
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds shared axe-core utilities and full article accessibility scans to the Docs E2E suite. It also adds command wiring, preview-run guidance, scan documentation, and a guide heading correction. ChangesDocs accessibility workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DocsE2E
participant ArticlePage
participant AxeHelpers
DocsE2E->>ArticlePage: navigate and wait for rendering
DocsE2E->>AxeHelpers: scanArticle(page, surface, include)
AxeHelpers->>ArticlePage: run WCAG axe scans
AxeHelpers-->>DocsE2E: return A11yScanResult
DocsE2E->>DocsE2E: attach report and enforce blocking violations
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 7 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
🎭 Playwright Test Results (next)Details
Flaky testsFeatures › database.spec.ts › Database › Schema Visualizer › table actions work as expected Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
🎭 Playwright Test Results (tanstack)Details
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
b4a6410 to
14814a1
Compare
31f4148 to
e3bdcbe
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/docs-e2e-a11y-comment.yml:
- Around line 68-76: Update the comment retrieval in the existing workflow step
to use await github.paginate with github.rest.issues.listComments and the
current owner, repo, issue_number, and per_page: 100 parameters, then run the
existing marked-bot selection against the complete result set.
In `@apps/docs/content/guides/api/quickstart.mdx`:
- Line 202: Change the Browser heading in the Bonus section from H4 to H3 so it
matches the heading level of Curl and Client libraries and preserves the
document’s heading hierarchy.
In `@apps/docs/DEVELOPERS.md`:
- Around line 44-48: Update the changed-page scan documentation to use a local
docs server or pull request preview URL instead of production, ensuring both
apps/docs/DEVELOPERS.md lines 44-48 and e2e/docs/README.md lines 177-179 receive
the same correction; alternatively, clearly label each command as a
production-only route scan.
In `@e2e/docs/features/docs-pages.spec.ts`:
- Around line 81-92: Update the page.goto flow to catch navigation, network, and
TLS errors in addition to handling unsuccessful responses. In the catch path,
call attachScanReport with unloadedResult(pagePath, page.url(), null, include),
then fail the test using the navigation error; preserve the existing
response-status handling for returned responses.
In `@e2e/docs/reporters/a11y-summary.ts`:
- Around line 92-104: Update the summary sentence in the lines construction to
use shouldEnforceAll(), stating that all violations fail when full enforcement
is enabled and retaining the existing ENFORCED_RULES wording otherwise. Ensure
the message accurately reflects the blocking behavior controlled by
blockingViolations.
- Around line 48-61: Update onEnd() to retain loaded:false scan results and
distinguish them from conclusive clean scans, including low-element or otherwise
inconclusive scans. Render load failures and inconclusive scans in separate
summary sections, and only publish “None” when all scanned pages are
conclusively clean; preserve the existing no-scans behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 85f0aaf9-3c43-46cc-b220-76ba5c06a83f
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (14)
.github/workflows/docs-e2e-a11y-comment.yml.github/workflows/docs-e2e.ymlapps/docs/DEVELOPERS.mdapps/docs/content/guides/api/quickstart.mdxe2e/docs/.gitignoree2e/docs/README.mde2e/docs/features/docs-pages.spec.tse2e/docs/package.jsone2e/docs/playwright.config.tse2e/docs/reporters/a11y-summary.tse2e/docs/scripts/run-e2e-docs.tse2e/docs/utils/axe-helpers.tspackage.jsonzizmor.yml
This comment has been minimized.
This comment has been minimized.
fed05b8 to
2e91741
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/docs-e2e-a11y-comment.yml:
- Around line 31-37: Update the listWorkflowRunArtifacts call to include the
name parameter set to docs-a11y-results, allowing the API to filter across
matching artifacts; then use the returned filtered artifact directly and remove
the local find-based search and redundant optional chaining.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d748822d-2631-4c1b-a5e2-462c47d6d085
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (14)
.github/workflows/docs-e2e-a11y-comment.yml.github/workflows/docs-e2e.ymlapps/docs/DEVELOPERS.mdapps/docs/content/guides/api/quickstart.mdxe2e/docs/.gitignoree2e/docs/README.mde2e/docs/features/docs-pages.spec.tse2e/docs/package.jsone2e/docs/playwright.config.tse2e/docs/reporters/a11y-summary.tse2e/docs/scripts/run-e2e-docs.tse2e/docs/utils/axe-helpers.tspackage.jsonzizmor.yml
🚧 Files skipped from review as they are similar to previous changes (13)
- zizmor.yml
- apps/docs/content/guides/api/quickstart.mdx
- .github/workflows/docs-e2e.yml
- e2e/docs/README.md
- apps/docs/DEVELOPERS.md
- package.json
- e2e/docs/.gitignore
- e2e/docs/features/docs-pages.spec.ts
- e2e/docs/reporters/a11y-summary.ts
- e2e/docs/playwright.config.ts
- e2e/docs/package.json
- e2e/docs/scripts/run-e2e-docs.ts
- e2e/docs/utils/axe-helpers.ts
2e91741 to
7ddebf8
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/docs-e2e-a11y-comment.yml:
- Around line 18-20: Update the workflow’s top-level permissions block to grant
actions read access alongside pull-requests write, so the
github.rest.actions.downloadArtifact call can read artifacts while preserving
the existing pull-request comment permission.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 580ca2e8-2700-43e5-b8f3-e221b7562faa
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (14)
.github/workflows/docs-e2e-a11y-comment.yml.github/workflows/docs-e2e.ymlapps/docs/DEVELOPERS.mdapps/docs/content/guides/api/quickstart.mdxe2e/docs/.gitignoree2e/docs/README.mde2e/docs/features/docs-pages.spec.tse2e/docs/package.jsone2e/docs/playwright.config.tse2e/docs/reporters/a11y-summary.tse2e/docs/scripts/run-e2e-docs.tse2e/docs/utils/axe-helpers.tspackage.jsonzizmor.yml
🚧 Files skipped from review as they are similar to previous changes (13)
- .github/workflows/docs-e2e.yml
- e2e/docs/playwright.config.ts
- package.json
- zizmor.yml
- e2e/docs/scripts/run-e2e-docs.ts
- apps/docs/content/guides/api/quickstart.mdx
- e2e/docs/reporters/a11y-summary.ts
- e2e/docs/features/docs-pages.spec.ts
- e2e/docs/package.json
- e2e/docs/.gitignore
- apps/docs/DEVELOPERS.md
- e2e/docs/README.md
- e2e/docs/utils/axe-helpers.ts
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
The `@a11y` test checked two heading rules against the main article. Extend the same test to the full WCAG 2.1 A/AA rule set. Only `heading-order` and `page-has-heading-one` fail, guarding the zero they already reached. Everything else reports: docs carries a backlog that would otherwise block every PR on a required check. As a class of issue reaches zero, its rule moves into `ENFORCED_RULES` so it can't come back. Those two rules are tagged `best-practice` rather than WCAG, so they get their own axe pass; selecting by rule and by tag are mutually exclusive in one call. Non-blocking findings surface as `::warning` annotations, the same way the lint ratchet reports, so a passing job still shows them. Blocking failures already surface through the runner's own failure report. Scanning stays limited to the article, and `EXCLUDED_RULES` drops `color-contrast` plus eight document-level rules, roughly halving scan time on a large page. Contrast is most of that time and finds nothing inside an article, since it comes from shared tokens and chrome. The document-level rules target `<html>`, `<head>`, and `<body>` and can't fire within an article at all. Cross-origin frames are skipped via legacy mode. Without it Playwright hands axe every frame, so embedded YouTube players get scanned and YouTube's markup is reported as ours, 11 of 15 violations on a page with one embed. Axe's `iframes: false` run option does not do this. A page that didn't load is recorded as a failed load rather than an a11y failure, including when `goto` throws outright. A scan that sees implausibly few elements warns rather than fails, because the cause is hydration timing and not the author. Co-Authored-By: Claude Opus 5 <[email protected]>
7ddebf8 to
cc264c2
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
cc264c2 to
a06217c
Compare
awaseem
left a comment
There was a problem hiding this comment.
Can we clean up some of the comments in the code files. Just seems like some slop from claude
@awaseem I've removed all comments and am tightening my local memory to be a lot stricter on keeping these comments out. Edit: Here is the direction I gave for the future: Keep all comments out of code I write — inline //, docblocks, JSDoc, section banners, "why" notes. The default is zero. This holds in any repo, not just this one. If I think a comment is genuinely important, do not write it into the file. Present it to Miranda in chat: paste the exact line I want to add, say where it goes, and wait for her call. How to apply: Make the code self-explanatory — clear names, small functions, explicit control flow — instead of narrating it. |
Braintrust eval report
|
…for-pitr-archiving-stale * origin/master: (342 commits) feat(studio): role-aware access feedback in scoped token creation (#48858) Initialize notebook editor page (#48842) test(docs): scan changed pages for WCAG 2.1 A/AA in warn mode (#48727) docs(auth): clarify audit logs storage options and configuration (#48852) feat(studio): warn that scoped tokens don't support the MCP server (#48849) feat(studio): lifecycle and role-aware scoped token view sheet (#48848) feat(www): add Open Authorization Integration Addendum (#48804) feat(studio): add legacy token mode to scoped pat creation flow (#48844) Add blog post: Supabase is now a connector on Perplexity Computer (#48776) feat(studio): enforce expiry scoped pat (#48811) fix(studio): model scoped pat permissions as OR-of-AND alternatives - smaller version (#48809) fix(ui): opaque default button hover fills (#48837) fix(ui): restore normal alert text wrapping (#48840) feat: notebook content schema (#48813) fix(ui): remove extra spacing before custom reports section (#48796) feat(marketing): add hint text below Go page form labels (#48824) Initialize notebooks store (#48801) Use white wordmark for QA.tech primary logo (#48827) fix titleless Admonition alignment (#48784) fix inconsistent product menu dividers (#48787) ...
Closes DOCS-1233
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Test coverage. The docs accessibility check now covers the full WCAG 2.1 A/AA rule set instead of two rules.
Note: This PR tests only the main article of changed pages (meaning, the content itself). A follow-up Linear issue is to address scanning the pieces outside of that: header, navigation, and interactive elements.
What is the current behavior?
The
@a11ytest ine2e/docsruns two axe rules against each in-scope page,heading-orderandpage-has-heading-one. Both already pass everywhere, so the check only guards a result we have. Nothing else in WCAG A/AA is checked.What is the new behavior?
The same test runs the full WCAG 2.1 A/AA rule set.
How the findings appear
The test is named
has no blocking accessibility violations, so a failure listed by CI is always something to fix. It is not named for the full rule set, because a green check would then claim more than the check verifies.heading-order,page-has-heading-one::warningannotation on the runAn annotation looks like this, on a run that still passes:
The full axe result for each page is attached to the report as
axe-results.json.Matching the Studio ratchet
This follows the ESLint ratchet in
apps/studio. That pattern warns on pre-existing debt rather than blocking on it, surfaces findings as annotations rather than PR comments, and promotes a rule to an error once its violations reach zero.The mechanism here is
ENFORCED_RULESinutils/axe-helpers.ts. The two heading rules are on it because the heading-hierarchy work drove them to zero site-wide.The intent is to migrate rules into that list one at a time. Pick a rule, fix its violations, then move it into
ENFORCED_RULESso it cannot come back. An exhaustive scan of the site groups the current backlog by root cause to sequence that work, and two fixes cover 99.1% of it.Studio keeps per-file baseline counts, which this does not. A whole-rule list is coarser, and it works here because docs violations reach zero across the site rather than per file.
Manual testing
Install the browser once, then run each step from the repo root. Every command scans production, so you do not need a local docs server.
pnpm -C e2e/docs exec playwright install chromiumConfirm a reported finding does not fail the check.
Expect
1 passed, and the::warningannotation above in the output.Confirm the scan finds that violation. Same page, now failing on every rule.
Expect
1 failed, reportingframe-title (serious, 4 node(s)). Steps 1 and 2 together are the point of this PR.Confirm the skipped rules stay skipped.
Expect
button-name (critical, 2 node(s))andlabel (critical, 2 node(s)), and nocolor-contrast.Confirm a page that does not load reports a load failure.
Expect
Expected a successful response for /docs/guides/does-not-exist-xyz, got 404, and no axe assertion.Confirm the link checker still passes alongside the a11y test.
Expect
3 passed.Known gaps
/docs/reference/*is not scanned. Those routes render client-side into tens of thousands of elements, where axe exceeds its timeout and results depend on whether the scan caught the page mid-render.