The repo had Playwright e2e specs and a store app already instrumented with PostHog (@rimo/ui provider, session replay). CI against Vercel previews/production was not wired end-to-end: no automated runs on deployment URLs, no durable link between a failing test and analytics/replay, and no Linear triage—so repeated failures on every commit would either be ignored or create noisy duplicate tickets.
CI / Vercel + GitHub Actions
PLAYWRIGHT_BASE_URL is a non-local origin (Vercel URL), while keeping optional PLAYWRIGHT_WEB_SERVER=0.deployment_status: preview (non-Production) vs Production, checkout at deployment.sha, optional vercel inspect on the deployment URL, then bun run e2e with secrets; artifacts include HTML report and e2e/output/.PostHog correlation
runId + distinctId and writes e2e/.e2e-run-context.json.window.__PLAYWRIGHT_E2E__ via browser.addInitScript so every browser context bootstraps the same run identity before React.bootstrap.distinctID + posthog.register for e2e_run_id / e2e_source so events and replays are filterable in PostHog.posthog.get_session_id() (when available) and append JSON lines to e2e/output/failure-sessions.jsonl keyed by Playwright testId.