Add validation, generation persistence, observability, Supabase reconciliation, and CI/E2E harness - #16
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: c136eb350a
ℹ️ 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".
| export function validateEnvironment(env = process.env) { | ||
| const missing = REQUIRED_ENV_VARS.filter((name) => !env[name]) |
There was a problem hiding this comment.
Load .env.local before validating required env
When developers follow the documented setup and put the required values in .env.local, this script still validates only the parent process environment, so npm run env:check reports missing variables even though the app would load them through Next. I verified this by adding the required keys to .env.local in the target worktree and running the script; it still failed for keys not exported in the shell, which breaks the local/release quality gate described in the README.
Useful? React with 👍 / 👎.
| const hasAuthenticatedE2ECredentials = Boolean(process.env.E2E_AUTH_EMAIL && process.env.E2E_AUTH_PASSWORD) | ||
| const hasMockedAIE2E = process.env.E2E_MOCK_AI === '1' |
There was a problem hiding this comment.
Load E2E env before selecting Playwright projects
When E2E_AUTH_EMAIL, E2E_AUTH_PASSWORD, and E2E_MOCK_AI are placed only in .env.local as the README recommends for local runs, the Playwright config never sees them and silently skips the authenticated and mocked-AI projects. I checked with those values present only in .env.local, and npx playwright test --list still listed only the public-auth tests, so the intended protected-flow coverage is not exercised locally unless users separately export the variables.
Useful? React with 👍 / 👎.
Motivation
save_profile_with_tdefunction.Description
.env.example, an env-check scriptscripts/check-env.mjs, and wiredenv:checkintopackage.jsonand a new GitHub Actions workflow (.github/workflows/quality.yml) to run lint, typecheck, build and Playwright E2E.app/lib/date.ts,app/lib/auth.ts,app/lib/profile.ts,app/lib/generated-plans.ts,app/lib/profile-options.ts, andapp/lib/database.types.tsto enforce schemas for profiles, TDE, generated workouts and meal plans.app/lib/workout-generator.tsandapp/protected/profile/meal-plan/action.tsnow validate inputs, optionally use deterministic E2E fixtures, parse OpenAI JSON responses via strict schemas, and persist generated plans with non-destructiveupsert.app/lib/logger.ts, and replaced scatteredconsole.*usages withlogError/logInfo; improved middleware and server client cookie handling inutils/supabase/*.NavBarusesnext/image, sign-out now logs errors, profile/meal-plan/workout components use local date keys fromapp/lib/date.ts, and auth callbacks usegetSafeRedirectPath.supabase/config.toml, reconciliation migrationsupabase/migrations/20260611170000_reconcile_fitness_schema.sqlplus a preflight check and an empty remote baseline marker; addedapp/lib/database.types.tscontract.tests/*.test.ts, Playwright tests undere2e/, Playwright configplaywright.config.ts, auth setup and mocked-AI fixtures, and updatedtsconfig.test.jsonfor the test runner..gitignoreto ignore test artifacts, addedREADME.mddocumentation updates, and small stylistic/CSS and dependency tweaks (package.json,package-lock.json, ESLint config updates).Testing
npm run checkandnpm test(unit/type/lint); these validation tests (includingtests/date.test.ts,tests/tde.test.ts,tests/generated-plans.test.ts, and migration contract tests) were included and exercised as part of the quality gate.npm run test:e2eandplaywright.config.ts, with deterministic mocked-AI flows gated byE2E_AUTH_EMAIL,E2E_AUTH_PASSWORD, andE2E_MOCK_AIenvironment variables; the GitHub Actions jobQualityis configured to run the full quality gate and upload Playwright artifacts on failure.scripts/check-env.mjsandnpm run env:checkto validate required environment variables; this is used in CI and included in theciscript.Codex Task