chore: delete stale apps/api/src/db/seed.ts duplicate (GRO-2129) #158

Merged
Flea Flicker merged 1 commits from flea-flicker/gro-2123-cleanup-stale-seed-duplicate into dev 2026-06-04 12:44:46 +00:00
Member

Summary

Cleanup of the stale apps/api/src/db/seed.ts duplicate of packages/db/src/seed.ts identified by GRO-2128 (security review, LOW-1 informational finding).

  • Delete apps/api/src/db/seed.ts (1349 lines) — stale duplicate without withSeedAdvisoryLock
  • Update apps/api/package.json db:seed and db:reset scripts to delegate to pnpm --filter @groombook/db {seed,reset} (matches the Dockerfile pattern; preserves local-dev UX)

Why this is safe

  1. No runtime path: Dockerfile reset stage → pnpm --filter @groombook/db reset runs tsx src/reset.ts && tsx src/seed.ts from packages/db/, never the duplicate.
  2. No imports: git grep -n "apps/api/src/db/seed" -- ':!apps/api/src/db/seed.ts' returns nothing post-deletion.
  3. Deployed tree unaffected: Dockerfile only COPY src/ and packages/, not apps/. The apps/api/ tree is a parallel/CI tree, not deployed.
  4. apps/api/src/index.ts does not import it.

Verification

  • pnpm install --frozen-lockfile
  • pnpm --filter @groombook/db typecheck
  • pnpm --filter @groombook/db build
  • pnpm typecheck (root @groombook/api) ✓
  • pnpm build (root @groombook/api) ✓
  • Delegation smoke: pnpm --filter @groombook/db seed from apps/api runs the canonical lock-protected script (✓ Acquired seed advisory lock confirmed)

Related

  • Security review: GRO-2128 — APPROVED WITH NOTES
  • Parent fix: GRO-2123 (advisory lock change)
  • Phase 4 promotion: #157 (intentionally did not include this cleanup)

cc @cpfarhood

## Summary Cleanup of the stale `apps/api/src/db/seed.ts` duplicate of `packages/db/src/seed.ts` identified by GRO-2128 (security review, LOW-1 informational finding). - **Delete** `apps/api/src/db/seed.ts` (1349 lines) — stale duplicate without `withSeedAdvisoryLock` - **Update** `apps/api/package.json` `db:seed` and `db:reset` scripts to delegate to `pnpm --filter @groombook/db {seed,reset}` (matches the Dockerfile pattern; preserves local-dev UX) ## Why this is safe 1. **No runtime path:** Dockerfile `reset` stage → `pnpm --filter @groombook/db reset` runs `tsx src/reset.ts && tsx src/seed.ts` from `packages/db/`, never the duplicate. 2. **No imports:** `git grep -n "apps/api/src/db/seed" -- ':!apps/api/src/db/seed.ts'` returns nothing post-deletion. 3. **Deployed tree unaffected:** Dockerfile only `COPY src/` and `packages/`, not `apps/`. The `apps/api/` tree is a parallel/CI tree, not deployed. 4. **`apps/api/src/index.ts` does not import it.** ## Verification - `pnpm install --frozen-lockfile` ✓ - `pnpm --filter @groombook/db typecheck` ✓ - `pnpm --filter @groombook/db build` ✓ - `pnpm typecheck` (root @groombook/api) ✓ - `pnpm build` (root @groombook/api) ✓ - Delegation smoke: `pnpm --filter @groombook/db seed` from apps/api runs the canonical lock-protected script (`✓ Acquired seed advisory lock` confirmed) ## Related - Security review: [GRO-2128](/GRO/issues/GRO-2128) — APPROVED WITH NOTES - Parent fix: [GRO-2123](/GRO/issues/GRO-2123) (advisory lock change) - Phase 4 promotion: [#157](https://git.farh.net/groombook/api/pulls/157) (intentionally did not include this cleanup) cc @cpfarhood
Flea Flicker added 1 commit 2026-06-04 12:42:40 +00:00
chore: delete stale apps/api/src/db/seed.ts duplicate (GRO-2129)
CI / Lint & Typecheck (pull_request) Successful in 15s
CI / Test (pull_request) Successful in 17s
CI / Build & Push Docker Images (pull_request) Successful in 29s
6d1b001fe5
The apps/api/src/db/seed.ts file was a stale duplicate of packages/db/src/seed.ts
and did not carry the withSeedAdvisoryLock helper from the GRO-2123 fix.

Cleanup details:
  * Delete apps/api/src/db/seed.ts (1349 lines). The reset CronJob's Dockerfile
    `reset` stage runs `pnpm --filter @groombook/db reset` from packages/db/,
    so this file was never on the runtime path. The deployed tree (./src) is
    also unaffected.
  * Update apps/api/package.json `db:seed` and `db:reset` scripts to delegate
    to `pnpm --filter @groombook/db {seed,reset}` to match the Dockerfile
    pattern and preserve the local-dev UX (these previously pointed at the
    deleted src/db/seed.ts via tsx).

Security review: GRO-2128 LOW-1 (informational).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Flea Flicker merged commit 93be4d8f72 into dev 2026-06-04 12:44:46 +00:00
Sign in to join this conversation.