Lighthouse: single config + nightly cron¶
Problem¶
Two Lighthouse config files lived in frontend/, but only one was consumed:
| File | URLs | Consumers |
|---|---|---|
frontend/.lighthouserc.json | 24 | none — orphan |
frontend/.lighthouserc.ci.json | 4 | lighthouse.yml, frontend/Makefile |
Commit 768f5b98 split local vs CI configs but never wired any consumer to the 24-URL file. Every Lighthouse run (CI and make lighthouse) audited the same 4-route smoke set, so the 24-URL list silently drifted — new backoffice and simulation routes got no coverage.
On top of that, the smoke audit ran on every frontend PR, adding latency to the PR critical path for a signal that rarely gates a merge.
Solution¶
Single source of truth + move the full sweep off the PR path.
- One config. Keep
frontend/.lighthouserc.json(24 routes), deletefrontend/.lighthouserc.ci.json. Both CI andmake lighthousepoint at the kept file. A_commentkey insidecinames the two consumers (JSON has no comment syntax; lhci ignores unknown keys). - Lenient assertions. The merged file keeps the smoke config's thresholds —
performance ≥ 0.6,accessibility ≥ 0.7,best-practices ≥ 0.9,seo ≥ 0.9,color-contrast: warn— so the heavier backoffice/simulation routes don't turn the nightly red on borderline scores. - Nightly cron.
lighthouse.ymlnow mirrorsintegration-tests.yml:schedulecron at 04:00 UTC (offset from integration-tests' 03:30 to avoid pileup),workflow_dispatch, and push toci-test/**. Thepull_requesttrigger and the now-dead "Comment PR with Lighthouse results" step are removed.
What changed¶
frontend/.lighthouserc.json—_commentconsumer note; thresholds relaxed to the lenient set;color-contrast: warnadded.frontend/.lighthouserc.ci.json— deleted.frontend/Makefile—lighthousetarget uses.lighthouserc.json; help text updated to "24 routes"..github/workflows/lighthouse.yml— cron/dispatch/ci-test trigger;configPath→.lighthouserc.json; PR-comment step removed.docs/src/architecture/cicd-workflows.md— workflow + troubleshooting entries updated to the nightly/single-config reality.
Verification¶
cd frontend && make lighthouseaudits the 24-route list.- Nightly workflow (or
workflow_dispatch) audits the same 24 routes against.lighthouserc.json; no longer runs on PRs. - No dangling references to
.lighthouserc.ci.jsonoutside historical plan264-lighthouse-route-in-frontend.md(left as a record of its era).