Skip to content

Wire Pa11y accessibility sweep into CI (report-only) (#1278 item 6)#1340

Merged
jonfroehlich merged 1 commit into
masterfrom
1278-pa11y-ci
Jun 18, 2026
Merged

Wire Pa11y accessibility sweep into CI (report-only) (#1278 item 6)#1340
jonfroehlich merged 1 commit into
masterfrom
1278-pa11y-ci

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

What & why

Implements item 6 of the testing roadmap (#1278): CONTRIBUTING requires a Pa11y a11y check on UI changes, but nothing enforced it. This adds a Pa11y + Axe (WCAG 2.0 AA) job to CI.

Report-only — like the existing test and e2e jobs ("signal, not gate"). It surfaces violations in the run Summary but never fails the build, so a pre-existing violation doesn't sit red next to every master deploy. Easy to tighten to blocking later once the current findings are triaged.

How it works

The local .pa11yci.json targets the docker-compose host (website:8000) with the maintainer's real DB snapshot (jonfroehlich, sidewalk, …). CI has no snapshot, so the new job:

  1. Builds a fresh schema from models (migrate --run-syncdb under settings_test, since migrations are gitignored).
  2. Seeds deterministic demo content — the existing seed_demo_projects + a new tiny seed_demo_news.
  3. Serves it with a native runserver (mirrors the e2e job's native-Python approach).
  4. Runs pa11y-ci against .pa11yci.ci.json (localhost URLs backed by the seeded slugs) and posts results to the run Summary.

Files

  • .github/workflows/test.yml — new a11y job (Postgres service + ImageMagick/Ghostscript, same as the others).
  • .pa11yci.ci.json — CI variant pointing at localhost:8000; the local-dev config is untouched.
  • website/management/commands/seed_demo_news.py — small, idempotent, deterministic-slug news seed so /news/ and a news detail render. Dev/CI tool; not wired into docker-entrypoint.sh.

Validation

Ran both seed commands and confirmed all 9 scanned URLs return 200 with the predicted slugs (/project/demo-active-tall/, /member/demolovelace/, /news/demo-news-one/, plus the listing pages), then cleaned the demo data back out of the dev DB. Workflow YAML validated.

Scope

No app behavior or schema change, so no version bump. Item 5 (the test backfill) is the separate PR #1339.

🤖 Generated with Claude Code

CONTRIBUTING requires Pa11y on UI changes but nothing enforced it. Add a
report-only a11y job to test.yml (matches the test/e2e 'signal, not gate'
philosophy): builds a fresh schema from models, seeds deterministic demo
content, serves it with a native runserver, and runs pa11y-ci, posting
results to the run Summary.

- .pa11yci.ci.json: CI variant of .pa11yci.json. The local config targets
  the compose host with the maintainer's real DB snapshot; CI has no
  snapshot, so this scans localhost URLs backed by seeded demo content.
- seed_demo_news: small idempotent command so /news/ and a news detail
  render with content (pairs with the existing seed_demo_projects).

Report-only for now (|| true) so pre-existing violations don't sit red next
to every master deploy; can tighten to blocking once findings are triaged.
Validated locally: all 9 scanned URLs return 200 with the seeded slugs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant