|
| 1 | +# PR_26167_197-ddl-apply-supports-local-postgres |
| 2 | + |
| 3 | +Status: PASS |
| 4 | + |
| 5 | +## Branch Validation |
| 6 | +- PASS: Current branch is `main`. |
| 7 | +- Expected branch: `main`. |
| 8 | + |
| 9 | +## Summary |
| 10 | +- Updated `scripts/apply-supabase-dev-ddl.mjs` to load `.env`, use `GAMEFOUNDRY_DATABASE_URL`, and reuse the shared Postgres connection client. |
| 11 | +- Removed the script-local TLS-only PostgreSQL client and Supabase REST grant behavior from DDL apply. |
| 12 | +- Updated `scripts/validate-local-postgres-runtime.mjs` so local runtime validation accepts the configured local/private Postgres endpoint from `.env` instead of a hardcoded port. |
| 13 | + |
| 14 | +## Requirement Checklist |
| 15 | +- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before execution. |
| 16 | +- PASS: Hard-stopped check passed on `main`. |
| 17 | +- PASS: DDL apply loads `.env`; output: `.env loaded for DDL apply (5 key(s) applied)`. |
| 18 | +- PASS: DDL apply uses `GAMEFOUNDRY_DATABASE_URL` as the only DDL database connection source. |
| 19 | +- PASS: DDL apply supports local plain TCP; output: `plain TCP (sslmode=disable)`. |
| 20 | +- PASS: DDL apply supports TLS-capable targets through URL `sslmode` and target capability handling in the shared Postgres client. |
| 21 | +- PASS: Did not reintroduce `GAMEFOUNDRY_SUPABASE_DATABASE_URL`. |
| 22 | +- PASS: Did not reintroduce provider variables. |
| 23 | +- PASS: Did not add environment-name branching. |
| 24 | +- PASS: Applied grouped GFS DDL to local Postgres: 15 DDL files applied. |
| 25 | +- PASS: Required identity tables validated: `users`, `roles`, `user_roles`. |
| 26 | +- PASS: `platform_settings` banner save/read validated through API against local Postgres. |
| 27 | +- PASS: Game Workspace create/getActiveGame validated with no 500 and no `undefined.some` error. |
| 28 | +- PASS: No SQLite/local-db/mock-db fallback added. |
| 29 | + |
| 30 | +## Env Load Evidence |
| 31 | +- `node .\scripts\apply-supabase-dev-ddl.mjs` |
| 32 | +- PASS: `.env loaded for DDL apply (5 key(s) applied)`. |
| 33 | +- PASS: Database diagnostic printed only safe context: `host=192.168.2.5; port=55431; database=gamefoundry_dev`. |
| 34 | + |
| 35 | +## Local Postgres Non-TLS DDL Evidence |
| 36 | +- PASS: DDL apply selected `plain TCP (sslmode=disable)` from `GAMEFOUNDRY_DATABASE_URL`. |
| 37 | +- PASS: Applied 15 grouped GFS DDL files through `GAMEFOUNDRY_DATABASE_URL`. |
| 38 | + |
| 39 | +## Table Validation Evidence |
| 40 | +- PASS: `node .\scripts\validate-supabase-dev.mjs` |
| 41 | +- PASS: Database connection: `host=192.168.2.5; port=55431; database=gamefoundry_dev`. |
| 42 | +- PASS: `users table`. |
| 43 | +- PASS: `roles table`. |
| 44 | +- PASS: `user_roles table`. |
| 45 | + |
| 46 | +## Validation Lane Report |
| 47 | +- PASS: `node --check scripts\apply-supabase-dev-ddl.mjs`. |
| 48 | +- PASS: `node --check scripts\validate-local-postgres-runtime.mjs`. |
| 49 | +- PASS: `node .\scripts\apply-supabase-dev-ddl.mjs`. |
| 50 | +- PASS: `node .\scripts\validate-supabase-dev.mjs`. |
| 51 | +- PASS: `npm run dev:local-api`; runtime printed `.env loaded for API runtime (5 key(s) applied)` and configured auth/database connections. |
| 52 | +- PASS: `npm run validate:local-postgres-runtime`. |
| 53 | +- PASS: Forbidden-marker scan for old env/provider/TLS-only/local-db/mock-db markers in changed scripts. |
| 54 | +- PASS: `git diff --check -- scripts\apply-supabase-dev-ddl.mjs scripts\validate-local-postgres-runtime.mjs`. |
| 55 | +- SKIP: Full samples smoke; PR scope is DDL apply/local product-data validation only. |
| 56 | + |
| 57 | +## Manual Validation Notes |
| 58 | +- Platform banner was saved and read through the API; local `platform_settings` banner rows observed: 3. |
| 59 | +- Supabase product-data REST calls observed during validation: 0. |
| 60 | +- Game Workspace create/getActiveGame used repository `game-workspace-1`; local game rows observed: 1. |
| 61 | +- Validation cleanup restored banner rows and removed PR197 Game Workspace rows. |
| 62 | +- Initial local runtime validator run failed on stale hardcoded port `55432`; the validation harness was corrected to accept configured local/private `GAMEFOUNDRY_DATABASE_URL` targets, then rerun PASS. |
| 63 | + |
| 64 | +## Artifact Output |
| 65 | +- PASS: Repo-structured ZIP created at `tmp/PR_26167_197-ddl-apply-supports-local-postgres_delta.zip`. |
| 66 | + |
| 67 | +## Changed Files |
| 68 | +- `scripts/apply-supabase-dev-ddl.mjs` |
| 69 | +- `scripts/validate-local-postgres-runtime.mjs` |
| 70 | +- `docs_build/dev/reports/PR_26167_197-ddl-apply-supports-local-postgres.md` |
| 71 | +- `docs_build/dev/reports/codex_review.diff` |
| 72 | +- `docs_build/dev/reports/codex_changed_files.txt` |
0 commit comments