Add typed database contract, local date domain, generation validation, profile/meal/workout flows, and CI/E2E tests - #12
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
💡 Codex Reviewfitness-app/supabase/migrations/20260611170000_reconcile_fitness_schema.sql Lines 327 to 330 in a2df1f5 For accepted profile inputs at the current bounds, this calculation can be zero or negative before the next insert hits ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Motivation
DatabaseTypeScript contract and defensive validation for user/profile/generated content.Description
app/lib/database.types.tsand update client/server/middleware helpers to cast toSupabaseClient<Database>for safer DB typing.app/lib/date.tswithgetLocalDateKey,parseDateKey,formatLocalDate, and agetLocalWeekRangealias used across UI and actions to replace UTCtoISOString().split('T')[0]usages.app/lib/generated-plans.ts, wire parsing/validation intoworkout-generator.tsandmeal-plan/action.ts, and persist generated plans via non-destructiveupsertcalls.app/lib/profile.ts,app/lib/profile-options.ts,app/lib/auth.ts, and updatedapp/lib/tde.ts) and implement an atomic server-sidesave_profile_with_tdeRPC via the reconciliation migration./forgot-passwordand/reset-passwordpages and actions), secure callback handling inapp/auth/confirm/route.ts, and sign-out/nav updates; update middleware to fail-closed for protected routes while keeping public routes available during outages.supabase/migrations/*andsupabase/preflight/*) to reconcile remote-managed schema, plus Supabase local config and seed marker files.e2e/public-auth.spec.ts,playwright.config.ts), tests using Node's built-in runner undertests/, and configure CI via.github/workflows/quality.ymlto runnpm run check,npm run build, andnpm run test:e2ewith failure artifact upload.next/imagefor the logo, remove Google font dependency in layout, update globals, add.env.example, update.gitignore, updatepackage.jsonscripts, and extend ESLint/TS configuration for the new artifacts.Testing
tests/covering profiles, date domain, generated plan validation, TDEE calculation, Supabase migration contract, and client contract; these are executed vianpm testas part ofnpm run checkand passed in the quality gate.e2e/public-auth.spec.tsandplaywright.config.ts, and wirednpm run test:e2einto the GitHub ActionsQualityworkflow to run Chromium E2E checks and upload failure artifacts; CI E2E runs complete successfully in the quality workflow.npm run lintandnpm run typecheckand are included innpm run check, which also passed in the configured checks.Codex Task