veza/veza-backend-api/cmd
senke cee850a5aa feat(seed): add --ci flag for bare-minimum E2E seed (v1.0.8 C4)
Prep for the upcoming E2E Playwright CI workflow. The full seed (1200
users, 5000 tracks, 100k play events, 10k messages, etc.) takes ~60s
and produces a lot of fixture data the suite never reads. A CI run
just needs the 5 test accounts the auth fixture logs in as
(admin/artist/user/mod/new) plus a small content set so player /
playlist tests have something to render.

New flag:
  go run ./cmd/tools/seed --ci

CIConfig (cmd/tools/seed/config.go):
- TotalUsers = 5 (== len(testAccounts), so SeedUsers' "remaining"
  branch is a no-op — only the 5 hardcoded accounts get inserted).
- Tracks = 10, Playlists = 3 (covers player + playlist suites).
- Albums = 0, all social/chat/live/marketplace/analytics/etc. = 0.

main.go gates the heavy seeders (Social / Chat / Live / Marketplace /
Analytics / Content / Moderation / Notifications / Misc) behind
`if !cfg.CIMode`, prints a one-line "skipping ..." banner so the run
log makes the choice obvious. The Users / Tracks / Playlists path is
unchanged — same code, same validation pass at the end.

Time: ~5s in CI mode (bcrypt cost 12 × 5 + a handful of bulk inserts)
vs the ~60s minimal mode and ~5min full mode, measured locally
against a tmpfs Postgres.

Validate() and the SUMMARY printout work unchanged — empty tables
just show "0 rows", and the orphan-FK checks remain useful (and pass
trivially when the heavy seeders are skipped).

modeName() returns "CI" so the boot banner reflects the choice.
go build ./... clean. Help output:

  -ci          Bare-minimum seed for E2E CI (...)
  -minimal     Use reduced volumes (50 users, 200 tracks) for fast dev

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 23:48:35 +02:00
..
api feat(metrics): ledger-health gauges + alert rules — v1.0.7 item F 2026-04-18 03:40:14 +02:00
backup incus deployement fully implemented, Makefile updated and make fmt ran 2026-01-13 19:47:57 +01:00
generate-config-docs adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
migrate_storage feat(tools): add cmd/migrate_storage CLI for bulk local→s3 migration (v1.0.8 P3) 2026-04-23 23:38:06 +02:00
migrate_tool v0.9.4 2026-03-05 23:03:43 +01:00
tools feat(seed): add --ci flag for bare-minimum E2E seed (v1.0.8 C4) 2026-04-25 23:48:35 +02:00