ci: run migrations against Postgres service container in CI #64

Merged
varutasu merged 3 commits from chore/wire-migrate-into-ci into main 2026-06-02 12:01:19 -04:00
varutasu commented 2026-06-02 09:47:56 -04:00 (Migrated from github.com)

Summary

  • Adds a migrate CI job that runs npm run migrate up against an ephemeral Postgres 16 service container on every PR/push to main.
  • Writes POSTGRES_URL into .env.local at job time so node-pg-migrate's --envPath .env.local works without Neon secrets or a committed env file.
  • Job uses standard postgres health checks (pg_isready) and targets deckhearth_test on localhost:5432.

Test plan

  • Confirm CI migrate job passes on this PR (Postgres 16 service + npm run migrate up).
  • Verify pg_trgm migration (1779853647565_add-pg-trgm-card-name-index.js) applies on the service container.
  • Spot-check that existing lint / unit-test jobs are unchanged.

Notes

  • Local Docker verification: POSTGRES_URL=postgres://postgres:postgres@localhost:5433/deckhearth_test npx node-pg-migrate ... up against postgres:16 reaches migrations; 1748365200000_add-scan-tables runs before 1779853647564_initial-schema and fails on a fresh DB (relation "users" does not exist). Existing envs that ran setup-neon-db.js first are unaffected. If the migrate job fails in CI, a follow-up to re-timestamp or merge scan tables into initial-schema is likely needed.
  • npm run test:run locally: 52/53 pass; one pre-existing failure in ScannedCardItem.test.js (ownership role=status assertion) unrelated to this change.

Made with Cursor

## Summary - Adds a `migrate` CI job that runs `npm run migrate up` against an ephemeral Postgres 16 service container on every PR/push to `main`. - Writes `POSTGRES_URL` into `.env.local` at job time so `node-pg-migrate`'s `--envPath .env.local` works without Neon secrets or a committed env file. - Job uses standard postgres health checks (`pg_isready`) and targets `deckhearth_test` on localhost:5432. ## Test plan - [ ] Confirm CI `migrate` job passes on this PR (Postgres 16 service + `npm run migrate up`). - [ ] Verify `pg_trgm` migration (`1779853647565_add-pg-trgm-card-name-index.js`) applies on the service container. - [ ] Spot-check that existing lint / unit-test jobs are unchanged. ## Notes - Local Docker verification: `POSTGRES_URL=postgres://postgres:postgres@localhost:5433/deckhearth_test npx node-pg-migrate ... up` against `postgres:16` reaches migrations; **`1748365200000_add-scan-tables` runs before `1779853647564_initial-schema` and fails on a fresh DB** (`relation "users" does not exist`). Existing envs that ran `setup-neon-db.js` first are unaffected. If the migrate job fails in CI, a follow-up to re-timestamp or merge scan tables into initial-schema is likely needed. - `npm run test:run` locally: 52/53 pass; one pre-existing failure in `ScannedCardItem.test.js` (ownership `role=status` assertion) unrelated to this change. Made with [Cursor](https://cursor.com)
vercel[bot] commented 2026-06-02 09:47:58 -04:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tcg-vault Ready Ready Preview, Comment Jun 2, 2026 3:59pm

Request Review

[vc]: #5UMOCYdCm7K22/ppK+g4tkLhyrUhTBqg+jx4WkCzvko=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ0Y2ctdmF1bHQiLCJwcm9qZWN0SWQiOiJwcmpfRjZXOEVvRkd3Y0g3aWVGcnRvRlNlOXdVVkFhNSIsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9yYW5kYWxsLXN0aWxsd2VsbHMtcHJvamVjdHMvdGNnLXZhdWx0Lzl0Tm5EZDE3ZEFlRmlHOEQycjl0OHBDYU1pVjQiLCJwcmV2aWV3VXJsIjoidGNnLXZhdWx0LWdpdC1jaG9yZS13aXJlLW1pZy02MjYwZDAtcmFuZGFsbC1zdGlsbHdlbGxzLXByb2plY3RzLnZlcmNlbC5hcHAiLCJuZXh0Q29tbWl0U3RhdHVzIjoiREVQTE9ZRUQiLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoidGNnLXZhdWx0LWdpdC1jaG9yZS13aXJlLW1pZy02MjYwZDAtcmFuZGFsbC1zdGlsbHdlbGxzLXByb2plY3RzLnZlcmNlbC5hcHAifSwicm9vdERpcmVjdG9yeSI6bnVsbH1dLCJyZXF1ZXN0UmV2aWV3VXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3ZlcmNlbC1hZ2VudC9yZXF1ZXN0LXJldmlldz9vd25lcj12YXJ1dGFzdSZyZXBvPXRjZy12YXVsdCZwcj02NCJ9 The latest updates on your projects. Learn more about [Vercel for GitHub](https://vercel.link/github-learn-more). | Project | Deployment | Actions | Updated (UTC) | | :--- | :----- | :------ | :------ | | [tcg-vault](https://vercel.com/randall-stillwells-projects/tcg-vault) | ![Ready](https://vercel.com/static/status/ready.svg) [Ready](https://vercel.com/randall-stillwells-projects/tcg-vault/9tNnDd17dAeFiG8D2r9t8pCaMiV4) | [Preview](https://tcg-vault-git-chore-wire-mig-6260d0-randall-stillwells-projects.vercel.app), [Comment](https://vercel.live/open-feedback/tcg-vault-git-chore-wire-mig-6260d0-randall-stillwells-projects.vercel.app?via=pr-comment-feedback-link) | Jun 2, 2026 3:59pm | <a href="https://vercel.com/vercel-agent/request-review?owner=varutasu&repo=tcg-vault&pr=64" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>
github-actions[bot] commented 2026-06-02 09:48:12 -04:00 (Migrated from github.com)

Pipeline Health

Build + CI gates

Gate Status
Vercel build (Preview) pass
CI: Lint pass
CI: Schema map fresh skipped
Preview smoke pass
Visual diff ⏭ skipped or pending

Build runs on Vercel; this CI runs lint and schema-map drift only (no duplicate build).

Role reports

Role Status
Reviewer report pending
A11y audit pending
Design system audit pending

See individual comments above for details. This rollup updates automatically.

<!-- pipeline-rollup --> ## Pipeline Health ### Build + CI gates | Gate | Status | | --- | --- | | Vercel build (Preview) | ✅ pass | | CI: Lint | ✅ pass | | CI: Schema map fresh | ❌ skipped | | Preview smoke | ✅ pass | | Visual diff | ⏭ skipped or pending | _Build runs on Vercel; this CI runs lint and schema-map drift only (no duplicate build)._ ### Role reports | Role | Status | | --- | --- | | Reviewer report | ⏳ pending | | A11y audit | ⏳ pending | | Design system audit | ⏳ pending | See individual comments above for details. This rollup updates automatically.
Sign in to join this conversation.
No description provided.