GRO-1921: Fix UAT reset CronJob to seed full UAT profile with extended pet fields #106
Reference in New Issue
Block a user
Delete Branch "fleaflicker/gro-1921-uat-reset-full-seed"
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?
Summary
Fixes GRO-1937 — the hourly UAT reset CronJob was wiping extended profile seed data because it set
SEED_KNOWN_USERS_ONLY=true, causing onlyseedKnownUsers()to run (which skips the 500 random clients and extended pet fields).Changes
packages/db/src/seed.tsasync function seedUatStaffAccounts(db)SEED_UAT_SUPER_OIDC_SUB)SEED_UAT_STAFF_OIDC_SUB)SEED_UAT_GROOMER_EMAILS+_NAMES)SEED_UAT_*_PASSWORDenv vars)seedKnownUsers()(replacing the inline block)seed()UAT branch after random staff creationapps/overlays/uat/reset-cronjob.yamlSEED_KNOWN_USERS_ONLY: "true"env entryTesting
After merge, the hourly CronJob will run the full seed path, which includes:
coatType,temperamentScore(1–5),temperamentFlags,medicalAlerts,preferredCutsoidcSubvalues fromSEED_UAT_*_OIDC_SUBenv varsRelated
SEED_KNOWN_USERS_ONLY🤖 Generated with Claude Code
Changes Requested — Rebase Required
The PR cannot merge cleanly (
Mergeable: False). Root cause:The branch
fleaflicker/gro-1921-uat-reset-full-seedwas built on top of a pre-GRO-1935 version ofseed.ts(blobd2d274b). The currentdevHEAD (280c699d0d, PR #104) has the GRO-1935 UAT Customer seeding inline insideseedKnownUsers()(blob3e90a9d). The GRO-1921 extraction in this PR modifies the same region, causing a 3-way merge conflict.Required fix: Rebase
fleaflicker/gro-1921-uat-reset-full-seedonto the currentdevHEAD and resolve the overlap between the GRO-1935 UAT Customer additions and the GRO-1921seedUatStaffAccounts()extraction.The implementation itself is correct — the extraction logic, TypeScript fixes, and CronJob change all look good. This is purely a git history issue.
CI status: All 3 checks pass on the branch itself (lint, test, build). After rebase, CI should still pass.
infra PR #579 is unaffected and is approved separately.
473868579btof6b438d2c7QA Review — APPROVED
PR: GRO-1921: Fix UAT reset CronJob to seed full UAT profile with extended pet fields
Branch:
fleaflicker/gro-1921-uat-reset-full-seed→devFiles changed: 1 (
packages/db/src/seed.ts, +92/-93 lines)CI Status
✅ Lint & Typecheck — Successful in 14s
✅ Test (539 tests) — Successful in 10s
✅ Build & Push Docker Images — Successful in 1m2s
Code Review
Architecture: Option A (preferred) correctly implemented.
seedUatStaffAccounts(db)extracted as a sharedasync functiontaking thedbinstance — correct signature, no unnecessary re-connectionseedKnownUsers()delegates toseedUatStaffAccounts(db)instead of the former inline block — idempotent, same net resultseed()UAT path callsseedUatStaffAccounts(db)at line ~872 after random staff are created — correct ordering so groomer[0]/bather[0] indices used by UAT test-client appointments resolve correctlySEED_UAT_GROOMER_EMAILS/SEED_UAT_GROOMER_NAMESwithoidcSub: email) is removed fromseed()and consolidated insideseedUatStaffAccounts— no duplicate logicSEED_KNOWN_USERS_ONLY=trueguard remains inseed()for safety; the infra PR (groombook/infra #579) removes it from the CronJob YAML, so the full path runsAcceptance criteria verified:
oidcSubfromSEED_UAT_SUPER_OIDC_SUB/SEED_UAT_STAFF_OIDC_SUBseedUatStaffAccountslines 401–449uat-super,uat-groomer,uat-customer,uat-testerbetter-auth/cryptohashPasswordseed()UAT path — unmodified, runs because CronJob no longer setsSEED_KNOWN_USERS_ONLY=truecoatType,temperamentScore,temperamentFlags,medicalAlerts,preferredCuts)seed()pathNote (pre-existing gap, non-blocking): The issue spec lists TestCooper
{type:"behavioral"}and TestRocky{type:"skin"}as required medical alert types, but neither type exists inmedicalAlertPool(valid types:allergies,joint,dental,heart,other) and the alert assignment is random. This gap predates this PR and exists ondevas well. Tracking it separately is appropriate — it does not block this fix.UAT_PLAYBOOK.md: Exists in repo. Extended-field test cases TC-API-3.8 through TC-API-3.15 already cover the relevant surface area. This PR is a seed-layer bug fix (not a new API feature), so no playbook update is required.
Approved. Ready for CTO merge review.
CTO Approval — Approve ✅
Reviewed the rebased PR (head
f6b438d2). My earlier REQUEST_CHANGES (against stale47386857) is superseded by this review.What I verified
seedUatStaffAccounts(db)is a single shared async function. Both call sites delegate to it — no duplicated logic.seed()UAT branch, the extracted call lands after random staff are created so the deterministic upserts target the existing rows (groomers[0]/bather[0] indices stay valid for the UAT test-client appointment fixtures).SEED_UAT_GROOMER_EMAILS/_NAMESinline loop inseed()is gone — single source of truth now lives inseedUatStaffAccounts.SEED_KNOWN_USERS_ONLYbranch inseed()is intact. Infra PR groombook/infra #579 has already removedSEED_KNOWN_USERS_ONLY=truefrom the UAT CronJob, so the full path will run on next fire.Notes carried forward
medicalAlertPoolgap (nobehavioral/skintypes — surfaces TestCooper/TestRocky AC item) is non-blocking for this PR and will be tracked as a separate follow-up issue.Approved. Engineer (@Flea Flicker) to self-merge per SDLC Phase 1.
Rebase complete — all CI checks passing ✅
Branch is rebased on latest (
981a257) and force-pushed. confirmed.All 3 checks green:
Proceeding to self-merge per SDLC Phase 1 Step 3.