promote: uat → main — pnpm-offline Docker hardening + accumulated UAT fixes (GRO-1985) #136
Reference in New Issue
Block a user
Delete Branch "uat"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Production Promotion — uat → main
Promotes the accumulated UAT-validated work to production. Primary driver is the pnpm-offline Docker hardening (GRO-1985) which has passed UAT regression and security review.
Key changes promoted
Dockerfilehardening: pnpm installed via npm (no Corepack shim),COREPACK_ENABLE_DOWNLOAD_FALLBACK=0,ENV HOME=/tmpfor init-stage containers underreadOnlyRootFilesystem: trueUAT_PLAYBOOK.mdcanonical source-of-truth for UAT seed passwords documentedpet_size_categoryextra_largeenum registered via migration 0038; enum coverage extendedSign-off checklist
UAT_PLAYBOOK.mdpresent & updatedUAT branch SHA
6a81a52a50ea098a0989fb42a75aeb0c5060703fcc @cpfarhood
b61d899f) to include in dev image d9ba6045adWith noUncheckedIndexedAccess:true, split("@")[0] returns string|undefined, making `name` typed as string|undefined and failing the notNull staff.name insert constraint. Fix by using ?? fallback on the array access. Also add newStaff null guard after .returning() destructure — array destructuring yields T|undefined with noUncheckedIndexedAccess enabled.- Replace .select({ count: appointments.id }).limit(1) + .length with sql<number>`count(*)::int` pattern per project standard (references invoices.ts:86) - Add gte(appointments.startTime, new Date()) to upcomingAppointment query so past appointments in scheduled/confirmed status are excluded - Add visitCount regression tests: 2+ completed appointments → visitCount >= 2, no completed → visitCount = 0 Updated UAT_PLAYBOOK.md §profile-summary (visitCount regression + date filter) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Adds POST /api/portal/session-from-auth which bridges a valid Better Auth customer session (from SSO login) to a portal impersonation session, so real SSO customers can access the client portal. The endpoint is registered before the validatePortalSession catch-all so it is not subject to that middleware. It validates the Better Auth session from request cookies, looks up the client by email, creates an active impersonation session, and returns { sessionId, clientId, clientName }. Also adds "role" to the genericOAuth scopes so Authentik propagates the role claim into Better Auth user objects (GRO-1862 root cause fix). Co-Authored-By: Paperclip <noreply@paperclip.ing>GRO-1898: Ensure UAT seed data includes clients and pets with extended profile fields (temperamentScore, temperamentFlags, medicalAlerts, preferredCuts, coatType). - Add data pools for extended profile fields in pet batch generation - Populate all 5 extended fields for randomly generated pets - Update UAT test client pets with fully populated extended profiles - Fix type mismatches: medicalAlerts uses MedicalAlert[] with {type, description, severity} shape per @groombook/types Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Updated UAT_PLAYBOOK.md §4.3 — new seed data verification tests. GRO-1898: After populating extended profile fields in the UAT seed, add test cases to verify the data is actually present and shaped correctly. Test cases cover: - /api/clients returns seed data - /api/pets/{id} returns all 5 extended fields for UAT test pets - medicalAlerts shape is correct ({type, description, severity}) - Deterministic UAT pets (Charlie = behavioral alert, Delta = skin alert) are verifiably populated Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>GRO-1979: The pet_size_category enum created in 0031_buffer_rules.sql contained ('small', 'medium', 'large', 'xlarge'), but the drizzle schema and seed.ts both use 'extra_large'. The mismatch caused the UAT seed job to fail with: invalid input value for enum pet_size_category: "extra_large" This migration adds the 'extra_large' value to pet_size_category and registers it at idx 37 in the drizzle journal (sequel to 0035/0036 which registered short/medium/silky in coat_type under GRO-1971). Non-transactional per Postgres restriction on ALTER TYPE ADD VALUE. Co-Authored-By: Paperclip <noreply@paperclip.ing>