Harden generation, validation, observability and add E2E harness with CI quality pipeline - #18
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d67ff55a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| NEXT_PUBLIC_SUPABASE_URL: https://example.supabase.co | ||
| NEXT_PUBLIC_SUPABASE_ANON_KEY: test-anon-key |
There was a problem hiding this comment.
Use real Supabase credentials for authenticated E2E
When E2E_AUTH_EMAIL and E2E_AUTH_PASSWORD secrets are configured, playwright.config.ts enables the authenticated projects, but this job still starts the app with the placeholder Supabase URL/key here. In that advertised CI configuration the auth setup tries to sign in against example.supabase.co with test-anon-key, so npm run test:e2e fails before protected/mocked tests can run; use real Supabase CI secrets for these vars, or only set the auth secrets when the matching Supabase env is present.
Useful? React with 👍 / 👎.
| # Use a dedicated non-production test user and never commit real values. | ||
| E2E_AUTH_EMAIL=e2e-user@example.com | ||
| E2E_AUTH_PASSWORD=replace-with-a-dedicated-test-password | ||
| E2E_MOCK_AI=1 |
There was a problem hiding this comment.
Keep E2E_MOCK_AI out of copied env files
README tells developers to cp .env.example .env.local, and the app's isE2EAIMockEnabled() switches generation to fixtures whenever E2E_MOCK_AI === '1'. With this value present in the template, any dev/deploy that follows setup will silently save deterministic E2E meal/workout plans instead of calling OpenAI; leave this unset/commented by default and set it only in the Playwright environment.
Useful? React with 👍 / 👎.
Motivation
Description
app/lib/date.ts,app/lib/profile.ts,app/lib/generated-plans.ts,app/lib/auth.ts,app/lib/profile-options.ts, and a generatedapp/lib/database.types.tscontract for Supabase typing.app/lib/rate-limit.ts,app/lib/generation-rate-limit.ts), parse/validate model outputs, and support deterministic E2E fixtures (app/lib/e2e-ai-fixtures.ts), and updatedapp/lib/workout-generator.tsandapp/protected/profile/meal-plan/action.tsto non-destructively upsert generated plans.app/lib/logger.ts, and replaced ad-hocconsolecalls withlogError/logWarning/logInfoacross server code and middleware (middleware.ts,utils/supabase/*, layout, auth flows).GET /api/healthandGET /api/readiness, plus environment validation and ascripts/check-env.mjshelper and.env.examplewith CI-friendly placeholders.e2e/*.ts,playwright.config.ts), CI workflow (.github/workflows/quality.yml) to runnpm run env:check,npm run check,npm run buildandnpm run test:e2e, and Playwright auth setup with an optional mocked-AI mode.tsconfig.test.json, new test suite using Node's test runner (tests/*.test.ts) andpackage.jsonscripts (test,check,test:e2e,env:check), plus Git ignore and ESLint updates.supabase/migrations/...) with preflight SQL,docs/release.md, and related seed/config files.next/imageinNavBar, added forgot/reset password pages and flows, improved profile form UX and validation, and fixed various date/key usages in client DB helpers and components.Testing
tests/and executed vianpm test; the new test suite (validation, date utilities, tde, generated plans, rate limiter, DB migration contract, observability, and env-check) ran successfully in the local test run.npm run checkand completed successfully during the quality run configuration.npm run test:e2eandplaywright.config.ts, with authenticated protected-flow and mocked-AI scenarios gated byE2E_AUTH_EMAIL,E2E_AUTH_PASSWORD, andE2E_MOCK_AIenvironment variables; the CI workflow will upload failure artifacts (playwright-report/,test-results/) when tests fail.Codex Task