Files
Alexis AguilarandClaude Opus 5.5 a5638ed9e2 fix(docs): check every changed page for broken links in Docs E2E (#53899)
## Problem

The Docs E2E suite tests the guide pages a PR changes, but only the
first 20 in sorted order. It drops the rest without a warning, so the
check passes green with pages untested.

That let a broken link through in #53561. The PR changed 62 guides,
`delete-project` ranked 23rd, and the suite never loaded it. The link
was missing its leading slash and resolved to a nested URL that returns
404 (fixed in #53871).

A check that skips pages arbitrarily can't be relied on to catch the
mistake it exists to catch.

## Solution

The link check now runs on every changed page, with no cap. The
accessibility scan no longer runs on pull requests, because it's slow
and only checks the pages a diff names. A scheduled whole-site run fits
it better, and that's tracked in
[DOCS-1816](https://linear.app/supabase/issue/DOCS-1816/run-the-docs-e2e-accessibility-scan-on-a-schedule-across-the-whole).
The `@a11y` tests stay in the suite, and `pnpm e2e:docs:a11y` still runs
them.

- The resolver returns every in-scope page. The 20-page cap is gone.
- The workflow runs the suite with `--grep-invert @a11y`, so CI runs
skip the accessibility scans. That includes manual `workflow_dispatch`
runs, which ran them before. DOCS-1816 covers when CI runs them again.
- Past 20 pages the suite runs on 3 workers instead of 1, the same as
the Studio suite.
- The suite no longer stops after 3 failed tests, so a run reports every
page with a broken link. A broken link in a shared partial can fail many
pages, and stopping at 3 left the rest unchecked.
- The Docs E2E job now runs the harness unit tests (`pnpm -C e2e/docs
test`) when `e2e/docs` or `e2e/shared` changes. No workflow ran them
before, and harness-only changes skip Playwright.

## Run time

Most PRs change few pages, so the added time is small. I looked at 51
recent merged PRs that touched guides: 67% changed 1 page, 20% changed
2-5, 8% changed 7-11, and 6% (3 PRs) changed 62-82. On the Vercel
preview the link test takes about 6.5s per page.

Estimated run time on the preview, excluding setup and retries. Skipping
the accessibility scan (about 6.4s per page) offsets the extra link
checks:

| Pages changed | Before (capped at 20, link check and accessibility
scan, 1 worker) | This PR (every page, link check only, 3 workers past
20) |
| ------------- |
------------------------------------------------------------------ |
-------------------------------------------------------- |
| 1 | ~13s | ~7s |
| 5 | ~1.1 min | ~0.5 min |
| 11 | ~2.4 min | ~1.2 min |
| 82 | ~4.3 min (62 pages unchecked) | ~3 min |

On production, 40 link tests took 50s on one worker and 13s on four, so
workers scale close to linearly. I haven't run a large page list in the
CI workflow, and the Vercel preview might throttle 3 workers at once. If
it does, lower the worker count in `playwright.config.ts`. CI retries a
failing test up to 2 times, so a failing page can cost 3 runs. Since the
suite no longer stops after 3 failures, a change that breaks many pages
pays that cost for each of them. The job times out at 30 minutes, which
the link check alone would reach at roughly 800 pages on 3 workers.

## Review instructions

1. Run `pnpm -C e2e/docs test` and confirm the scope tests pass,
including the 82-page case.
2. Pipe 82 changed guide paths into the scope CLI and confirm `paths`
lists all 82:
   ```bash
printf 'apps/docs/content/guides/ai/%s.mdx\n' {1..82} | pnpm -C e2e/docs
resolve-docs-scope
   ```
3. List the tests the workflow runs for 3 pages and confirm there are 4
(1 guard, 3 link) and none for accessibility:
   ```bash
cd e2e/docs && PLAYWRIGHT_BASE_URL=https://supabase.com
DOCS_E2E_PAGE_PATHS=/docs/guides/auth,/docs/guides/database/overview,/docs/guides/storage
pnpm exec playwright test --grep-invert @a11y --list
   ```
4. Run the link test on 4 pages that don't exist and confirm all 4 fail,
rather than the run stopping after 3:
   ```bash
cd e2e/docs && PLAYWRIGHT_BASE_URL=https://supabase.com
DOCS_E2E_PAGE_PATHS=/docs/guides/zz-nope-1,/docs/guides/zz-nope-2,/docs/guides/zz-nope-3,/docs/guides/zz-nope-4
pnpm exec playwright test --grep "loads and"
   ```
5. Check that this PR's Docs E2E job runs the "Run docs E2E harness unit
tests" step and that it passes.

Verified locally: unit tests, the scope CLI with 82 paths, the test list
above through the same `pnpm run e2e:docs --grep-invert @a11y` command
the workflow uses, and the 4-failure run.

Resolves
[DOCS-1749](https://linear.app/supabase/issue/DOCS-1749/warn-instead-of-silently-skipping-pages-in-docs-e2e-when-a-pr-exceeds)

## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:28:12 -07:00
..
2026-11-24 10:43:35 +00:00
2026-11-24 10:43:35 +00:00
2026-11-24 10:43:35 +00:00
2026-11-24 10:43:35 +00:00