feat(ci): daily scheduled Lighthouse CI audit for the frontend#196
Closed
Moonwalker-rgb wants to merge 3 commits into
Closed
feat(ci): daily scheduled Lighthouse CI audit for the frontend#196Moonwalker-rgb wants to merge 3 commits into
Moonwalker-rgb wants to merge 3 commits into
Conversation
ChainForgee#134) Adds three Prometheus instruments updated on every circuit breaker transition, so unhealthy providers surface in dashboards rather than from user-visible degradation: - Gauge circuit_breaker_state (0=CLOSED, 1=HALF_OPEN, 2=OPEN) - Counter circuit_breaker_failure_count_total (cumulative failures) - Histogram circuit_breaker_recovery_time_seconds (OPEN -> HALF_OPEN lag) Metrics are emitted inside the same lock that guards state, so the exported values can never diverge from the underlying state. Failure count tracks cumulative failures since the last reset, matching the Prometheus counter contract documented in the issue. The initial state is published in __init__ so every instantiated breaker appears in the gauge even before any traffic flows.
…hainForgee#132) Introduces jest-axe as a first-class test dependency and wires it into the unit-test runner via a shared @jest-environment jsdom suite, so any new a11y regression surfaces in CI rather than in production. Adds: - jest-axe + axe-core devDeps, jest-axe ambient types - jest.setup.a11y.ts registering toHaveNoViolations as a matcher - jest.config.ts setupFilesAfterEnv wiring - a11yTestUtils + a11y-mocks helper modules - a11y.test.tsx covering ErrorInline (banner + card), ActivityCenter, Navbar, ErrorBoundary, EvidenceArtifactViewer - frontend-ci.yml running type-check, lint, jest on app/frontend/** - lighthouserc.json + LIGHTHOUSE_CI.md (manual opt-in audit config, not gating CI per issue scope) Fixes uncovered violations: - icon-only close/remove buttons get aria-label + aria-hidden=true on the inner SVG (ErrorInline, ActivityCenter) - notification-count badge gains sr-only text in ActivityCenter - EvidenceArtifactViewer filename heading promoted from <h3> to <h2> to satisfy heading-order axe rule against pages that provide <h1>
Adds a scheduled GitHub Actions workflow that runs @lhci/cli against the
production build once a day at 00:30 UTC, surfaces accessibility and SEO
regressions early, and exposes the per-route HTML report via the
`lighthouse-reports` artifact.
Replaces the placeholder lighthouserc.json (one URL, no server-readiness
guardrails) with a production-ready config:
* startServerReadyPattern "Ready in" + 60s timeout (avoid the next start race)
* desktop preset, 2 runs/URL for noise, 4 [locale] routes
* categories:accessibility + categories:seo gated as errors >= 0.9
* categories:best-practices + categories:performance warn-only
* filesystem upload to ./lhci-reports
Other changes:
- .github/workflows/lighthouse.yml (cron 30 0 * * *, workflow_dispatch,
concurrency cancel-in-progress, permissions contents: read,
pnpm + actions/cache, build -> autorun -> upload-artifact v4 retention
14 days)
- app/frontend/LIGHTHOUSE_CI.md rewritten with the new operator playbook
(cron best-effort note, audited routes, artifact retrieval)
- @lhci/cli ^0.15.1 devDep + `pnpm lhci:autorun` script
- pnpm-lock.yaml updated accordingly
Follows up PR ChainForgee#195 which left the Lighthouse gate out-of-band pending this
integration. The new workflow is non-gating for PRs (jest-axe unit tests
on PR ChainForgee#195 remain the fast pre-merge gate).
Contributor
Author
|
cc @Lansa-18 @maramina — frontend reviewers. Specifically curious about: (1) whether the four |
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.
What
Follows up PR #195 by promoting Lighthouse CI from a local-only opt-in to a daily scheduled GitHub Actions workflow. The CI runs
@lhci/cliagainst the production build once a day at 00:30 UTC, gates accessibility and SEO, and publishes the per-route HTML report as a CI artifact so regressions surface within hours rather than at the recipient's keyboard.This is non-gating for PRs (PR #195 keeps
jest-axeas the fast pre-merge gate) but is the canonical source of truth for whole-page a11y + SEO going forward.Changes
.github/workflows/lighthouse.yml(new) — scheduled cron30 0 * * *(sidesteps the 00:00 queue spike),workflow_dispatchfor manual re-runs,concurrency: cancel-in-progressso a slipped schedule doesn't queue stale runs,permissions: contents: read,NEXT_TELEMETRY_DISABLED=1+NODE_ENV=production, pnpm +actions/cache@v4with a Node-version-aware key (no stale store restore on Node upgrades), explicitpnpm buildbefore autorun,actions/upload-artifact@v4for 14-day retention of./lhci-reports.app/frontend/lighthouserc.json(replaces the placeholder) —startServerCommandpnpm startstartServerReadyPattern"Ready in"✓ Ready in NmsstartServerReadyTimeout60000(ms)numberOfRuns2settings.presetdesktopurl/,/en/dashboard,/en/help,/en/verification-review[locale]/*routescategories:accessibility0.9categories:seo0.9categories:best-practices0.8categories:performance0.5categories:pwaupload.targetfilesystem→./lhci-reportsapp/frontend/LIGHTHOUSE_CI.md(rewritten) — operator playbook: assertion table, audited route list, how to fetch the artifact from a failed run, local-repro recipe with Chrome installed.app/frontend/package.json—@lhci/cli ^0.15.1devDep,pnpm lhci:autorunscript.pnpm-lock.yaml— updated for@lhci/cli.Why a separate workflow
jest-axe(a11y.test.tsx, ~6 tests) is fast and deterministic, runs in jsdom, and is the right gate for PR diffs. Lighthouse is slow, requires a real Chrome + a built bundle + a running server, and is best run against the production output daily. The two are complementary, not redundant.Caveats documented in
LIGHTHOUSE_CI.md./lhci-reportsand surface any pre-existing a11y/SEO failures; treat them as the new baseline.Notes for reviewers
[locale]/dashboard+ verification-review render their shell for unauthenticated visitors (nomiddleware.tsin this repo). The audit scores what an unauthenticated user actually sees, which is the correct surface for an aid-recipient app.steps.node-version.outputs.node-versionwhich is the documented output ofactions/setup-node@v4. The restore-keys fallback is scoped to the same node version so a Node upgrade doesn't poison the fallback with a stale store.Reviewers:
@Lansa-18 @maraminafor the workflow + config;@gbengaeben @CodeMayorfor any Python-adjacent concerns (this is pure TS/CI, so unlikely).