Skip to content

Commit cdd329f

Browse files
committed
Route product data through configured database URL - PR_26167_195-product-data-uses-database-url & Sign In is not available in this preview.
1 parent 33dad3f commit cdd329f

7 files changed

Lines changed: 1653 additions & 251 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# PR_26167_195-product-data-uses-database-url
2+
3+
## Branch Validation
4+
- PASS - Current branch is `main`.
5+
- PASS - `docs_build/dev/PROJECT_INSTRUCTIONS.md` was read before changes.
6+
7+
## Requirement Checklist
8+
- PASS - Investigated the platform banner data path.
9+
- PASS - Root cause: `SupabasePostgresProviderAdapter.requestTable()` was using `GAMEFOUNDRY_SUPABASE_URL/rest/v1` with the service-role key for product-data table reads/writes.
10+
- PASS - Added a server-side direct PostgreSQL client that reads `GAMEFOUNDRY_DATABASE_URL`.
11+
- PASS - Updated the product-data adapter so table reads/writes use the configured database client, not Supabase REST.
12+
- PASS - `platform_settings` read/write now flows through `GAMEFOUNDRY_DATABASE_URL`.
13+
- PASS - Supabase URL/keys remain in the Auth adapter path only.
14+
- PASS - Runtime `.env` loading behavior was not changed.
15+
- PASS - No local-db/mock-db/SQLite fallback was added.
16+
- PASS - No DEV/UAT/PROD branching was added; environment-agnostic validation passed.
17+
- PASS - No secrets were printed in validation output or this report.
18+
- FAIL - Live local Postgres validation could not complete because nothing is listening on `127.0.0.1:5432`.
19+
- FAIL - Saving a platform banner and verifying local `platform_settings` update could not complete until local Postgres is running.
20+
- FAIL - Supabase-not-updated live evidence could not be completed through an actual banner save because the configured local database connection refused connections before any write.
21+
22+
## Files Changed
23+
- `src/dev-runtime/auth/provider-contract-stubs.mjs`
24+
- `src/dev-runtime/persistence/postgres-connection-client.mjs`
25+
- `tests/dev-runtime/ProductDataDatabaseUrl.test.mjs`
26+
- `docs_build/dev/reports/environment_agnostic_browser_gate_report.md`
27+
- `docs_build/dev/reports/PR_26167_195-product-data-uses-database-url.md`
28+
29+
## Local Postgres Evidence
30+
- PASS - `.env` contains `GAMEFOUNDRY_DATABASE_URL` pointing at host `127.0.0.1`, port `5432`, database `gamefoundry_dev`; username/password presence was verified without printing values.
31+
- FAIL - Direct configured database read of `platform_settings` returned `ECONNREFUSED 127.0.0.1:5432`.
32+
- FAIL - API-level `GET /api/platform-settings/banner` returned HTTP 500 with an `ECONNREFUSED` diagnostic from the configured database connection.
33+
- BLOCKED - `POST /api/admin/platform-settings/banner` was not run because the read path already proved the configured database is unavailable.
34+
35+
## Supabase-Not-Updated Evidence
36+
- PASS - Static code evidence: `src/dev-runtime/auth/provider-contract-stubs.mjs` and `src/dev-runtime/persistence/postgres-connection-client.mjs` contain no `/rest/v1/` product-data path after the fix.
37+
- PASS - Focused unit evidence: `tests/dev-runtime/ProductDataDatabaseUrl.test.mjs` verifies `platform_settings` calls `postgresClient.requestTable()` for POST and GET.
38+
- BLOCKED - Live UAT before/after row comparison was not performed because this PR must not write product data through Supabase and the configured local database connection is unavailable.
39+
40+
## Validation Notes
41+
- PASS - `node --check src/dev-runtime/persistence/postgres-connection-client.mjs`
42+
- PASS - `node --check src/dev-runtime/auth/provider-contract-stubs.mjs`
43+
- PASS - `node --check tests/dev-runtime/ProductDataDatabaseUrl.test.mjs`
44+
- PASS - `node --test tests/dev-runtime/ProductDataDatabaseUrl.test.mjs`
45+
- PASS - `npm run validate:browser-env-agnostic`
46+
- FAIL - Connection validation with `.env` local Postgres: `ECONNREFUSED 127.0.0.1:5432`.
47+
- FAIL - Platform banner save/read local Postgres validation: blocked by local Postgres connection refusal.
48+
- FAIL - Targeted platform banner live validation: blocked by local Postgres connection refusal.
49+
- FAIL - Targeted Game Workspace create live validation: blocked by local Postgres connection refusal.
50+
- SKIP - Full samples smoke was not run, per request.
51+
52+
## Completion Status
53+
- BLOCKED - PR is not complete because required live validation cannot pass until local Postgres is running on `127.0.0.1:5432` with the `gamefoundry_dev` schema available.
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# git status --short
2-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
3-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
4-
M tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs
5-
M toolbox/game-workspace/game-workspace.js
6-
?? docs_build/dev/reports/PR_26167_194-env-runtime-real-fix.md
2+
AM docs_build/dev/reports/PR_26167_195-product-data-uses-database-url.md
3+
M docs_build/dev/reports/codex_changed_files.txt
4+
M docs_build/dev/reports/codex_review.diff
5+
M docs_build/dev/reports/environment_agnostic_browser_gate_report.md
6+
M src/dev-runtime/auth/provider-contract-stubs.mjs
7+
A src/dev-runtime/persistence/postgres-connection-client.mjs
8+
A tests/dev-runtime/ProductDataDatabaseUrl.test.mjs
79

8-
# git ls-files --others --exclude-standard
9-
docs_build/dev/reports/PR_26167_194-env-runtime-real-fix.md
10-
11-
# git diff --stat
12-
.../dev/reports/coverage_changed_js_guardrail.txt | 4 +--
13-
.../dev/reports/playwright_v8_coverage_report.txt | 10 ++++---
14-
.../tools/GameWorkspaceMockRepository.spec.mjs | 33 ++++++++++++++++++++++
15-
toolbox/game-workspace/game-workspace.js | 8 +++---
16-
4 files changed, 45 insertions(+), 10 deletions(-)
10+
# git diff HEAD --stat -- PR195 files
11+
.../PR_26167_195-product-data-uses-database-url.md | 53 ++
12+
.../environment_agnostic_browser_gate_report.md | 4 +-
13+
src/dev-runtime/auth/provider-contract-stubs.mjs | 77 ++-
14+
.../persistence/postgres-connection-client.mjs | 581 +++++++++++++++++++++
15+
tests/dev-runtime/ProductDataDatabaseUrl.test.mjs | 62 +++
16+
5 files changed, 731 insertions(+), 46 deletions(-)

0 commit comments

Comments
 (0)