Skip to content

ci(lighthouse): rewire LHCI gate for SSR Astro app [T-P7-Q-PERF-01] - #21

Merged
acamarata merged 4 commits into
mainfrom
ci/T-P7-Q-PERF-01-lighthouse-ssr-gate
Jun 25, 2026
Merged

acamarata merged 4 commits into
mainfrom
ci/T-P7-Q-PERF-01-lighthouse-ssr-gate

Conversation

@acamarata

Copy link
Copy Markdown
Contributor

Summary

Rewire the Lighthouse CI gate to work with the SSR Astro app (it was misconfigured for the Next→Astro migration: staticDistDir: './dist' against an output: 'server' app that produces no dist).

  • The four audited landing pages (/, /dawah, /donate, /legal/sharia-disclaimer) are now prerender = true, so pnpm build emits their static HTML into .vercel/output/static, which LHCI serves via staticDistDir. Deterministic, no running server needed — and a production win (CDN-cached HTML vs SSR per request).
  • Fixed the two real SEO/a11y defects the gate surfaced: legible font size (0.720.75rem) and descriptive link text on the shared DisclaimerBanner.
  • Removed continue-on-error: true from the Lighthouse step — the perf/a11y/SEO score gate (minScore 0.95) is blocking again.
  • Also fixes a11y-axe.yml, which had the same astro preview-unsupported-by-vercel-adapter bug (used pnpm start → server never bound → 30s timeout); now uses pnpm dev.
  • Bundles the in-flight client-side locale-swap / RTL i18n work from the same tree (makes ar/ur render RTL; e2e suite un-gated in ci.yml).

Verification (exact CI toolchain, @lhci/cli@0.13.x)

URL perf a11y best-practices seo
/ 1.0 0.95 0.96 1.0
/dawah/ 1.0 0.95 0.96 1.0
/donate/ 1.0 1.0 0.96 1.0
/legal/sharia-disclaimer/ 1.0 1.0 0.96 1.0

Lighthouse Quality Gates passed via workflow_dispatch (run 28182126316) and on the prior PR check — both green with the gate blocking. Build, typecheck, lint, unit, and Playwright e2e (chromium, 17 passed / 1 skipped) all green.

Pre-existing Rampart security scans (sast/secrets/deps-osv) are repo-wide debt unrelated to this diff (no deps added); tracked separately in the inbox.

Apply the NEXT_LOCALE cookie on the client (lang/dir + translated hero
copy) on prerendered pages, and add src/lib/i18n.ts message catalogs plus
middleware. This makes ar/ur render RTL correctly, so the Playwright e2e
suite is reliable again — drop continue-on-error from the E2E Tests job.
…ocking

The app is SSR (output: 'server', @astrojs/vercel) so there is no ./dist
for LHCI's staticDistDir. Mark the four audited landing pages
prerender=true so `pnpm build` emits their static HTML into
.vercel/output/static, which LHCI serves directly — deterministic, no
running server needed. Fix the two SEO/a11y defects the gate surfaced
(legible font size, descriptive link text), then drop continue-on-error
so the perf/a11y/SEO score gate (minScore 0.95) is blocking again.

- web/lighthouserc.cjs: staticDistDir -> .vercel/output/static, runs 1->3
- web/src/components/DisclaimerBanner.astro: font 0.72->0.75rem; link text
  "Learn more" -> "Read our Sharia content guidelines"
- web/src/pages/{dawah,donate,legal/sharia-disclaimer}: prerender=true
  (index.astro prerender landed in the preceding i18n commit)
- .github/workflows/_reusable-lighthouse.yml: remove continue-on-error
- web/.gitignore: ignore .lighthouseci/
…review

`pnpm start` is `astro preview`, which @astrojs/vercel/serverless does not
support, so the server never bound and wait-on timed out (the axe gate gave
no signal). Use `pnpm dev` (serves SSR routes with any adapter, same as the
Playwright config) and raise the wait-on timeout to 120s.
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ummat-chatislam Ready Ready Preview, Comment Jun 25, 2026 3:54pm

Request Review

@github-actions

Copy link
Copy Markdown

🟢 Rampart Security Gate — CLEAN

Tool CRITICAL HIGH MEDIUM LOW
(no findings)

Totals: 0 critical · 0 high · 0 medium · 0 low

Mode: RAMPART_ENFORCE=warn

@axe-core/cli has no --reporter option (errors "unknown option
'--reporter'"); it prints to stdout by default. With this and the dev-server
fix, the advisory axe gate executes for the first time and reports real
WCAG findings instead of erroring on setup.
@acamarata
acamarata merged commit ca48f40 into main Jun 25, 2026
16 of 20 checks passed
@acamarata
acamarata deleted the ci/T-P7-Q-PERF-01-lighthouse-ssr-gate branch June 25, 2026 16:01
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