Skip to content

Commit b66ffd1

Browse files
committed
Use single runtime env file and generic database URL - PR_26167_193-env-runtime-single-file-and-generic-db-url
1 parent 24d9ae1 commit b66ffd1

5 files changed

Lines changed: 533 additions & 699 deletions
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# PR_26167_193-env-runtime-single-file-and-generic-db-url
2+
3+
## Branch Validation
4+
- PASS - Current branch is `main`.
5+
- PASS - `docs_build/dev/PROJECT_INSTRUCTIONS.md` was read before validation/reporting.
6+
- PASS - Source implementation is present in `HEAD` commit `24d9ae19148d89244872cd1e51d999e57f1f6348` (`Use single runtime env file and generic database URL - PR_26167_193-env-runtime-single-file-and-generic-db-url`).
7+
8+
## Requirement Checklist
9+
- PASS - Runtime startup loads only `.env`; `scripts/start-local-api-server.mjs` uses `RUNTIME_ENV_FILE = ".env"`.
10+
- PASS - Runtime startup does not auto-load `.env.local` or `.env.uat`.
11+
- PASS - `.env.local` and `.env.uat` remain user-managed copy sources; `.env.local` was updated without printing values.
12+
- PASS - DEV validation explicitly loads `.env.local` only through `scripts/validate-supabase-dev.mjs`.
13+
- PASS - `GAMEFOUNDRY_AUTH_PROVIDER` and `GAMEFOUNDRY_DB_PROVIDER` are absent from active runtime startup/templates.
14+
- PASS - `GAMEFOUNDRY_SUPABASE_DATABASE_URL` was renamed to `GAMEFOUNDRY_DATABASE_URL` in active runtime, validation, template, and targeted test paths.
15+
- PASS - Auth-specific Supabase keys remain `GAMEFOUNDRY_SUPABASE_URL`, `GAMEFOUNDRY_SUPABASE_ANON_KEY`, and `GAMEFOUNDRY_SUPABASE_SERVICE_ROLE_KEY`.
16+
- PASS - `.env.local` has the required database key populated locally and provider-selection keys removed; values were not printed.
17+
- PASS - `.env.uat` contains the same four key names with placeholders and no provider-selection keys.
18+
- PASS - Validation wording reports Auth connection and Database connection readiness.
19+
- PASS - Browser/page validation found no deployment-label branching or provider/local-db fallback.
20+
21+
## Env-File Loading Evidence
22+
- PASS - Runtime validation copied `.env.local` to `.env` only for the short-lived runtime check, then restored tracked `.env`.
23+
- PASS - Runtime startup output included `.env loaded for API runtime (4 key(s) applied).`
24+
- PASS - Runtime startup output included `Configured auth connection: configured.`
25+
- PASS - Runtime startup output included `Configured database connection: configured.`
26+
- PASS - Runtime startup output did not mention `.env.local`, `.env.uat`, provider selection, or provider env vars.
27+
28+
## Rename Evidence
29+
- PASS - Active non-report scan found no `GAMEFOUNDRY_SUPABASE_DATABASE_URL`.
30+
- PASS - `.env`, `.env.example`, `.env.uat`, `scripts/start-local-api-server.mjs`, Supabase DEV validation, DDL apply script, provider contract stubs, and targeted tests use `GAMEFOUNDRY_DATABASE_URL`.
31+
32+
## Provider Var Removal Evidence
33+
- PASS - `.env`, `.env.example`, and `.env.uat` contain no `GAMEFOUNDRY_AUTH_PROVIDER` or `GAMEFOUNDRY_DB_PROVIDER`.
34+
- PASS - `scripts/start-local-api-server.mjs` contains no provider-selection env dependency.
35+
- PASS - Runtime startup reports configured connections, not provider selection.
36+
37+
## Validation Lane Report
38+
- PASS - `node --check scripts/apply-supabase-dev-ddl.mjs`
39+
- PASS - `node --check scripts/start-local-api-server.mjs`
40+
- PASS - `node --check scripts/validate-supabase-dev.mjs`
41+
- PASS - `node --check src/dev-runtime/auth/provider-contract-stubs.mjs`
42+
- PASS - `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
43+
- PASS - `node --check tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs`
44+
- PASS - `npm run validate:supabase-dev`
45+
- PASS - Explicit `.env.local` DEV validation load.
46+
- PASS - Auth connection URL, anon key, service role key, and database connection URL configured with masked diagnostics.
47+
- PASS - Supabase Auth/REST identity tables reachable.
48+
- WARN - Direct PostgreSQL TLS reported `SELF_SIGNED_CERT_IN_CHAIN`; validator marked this advisory because REST/API identity readiness passed.
49+
- PASS - Manual `.env.uat` structural validation: required keys present and forbidden keys absent.
50+
- PASS - `npm run dev:local-api` runtime check on alternate port after temporary `.env.local` to `.env` copy.
51+
- PASS - `npx playwright test tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs --grep "Game Workspace creates|active-game API" --workers=1 --reporter=list` (2 passed).
52+
- PASS - `npm run validate:browser-env-agnostic`
53+
- SKIP - `npm run test:workspace-v2`; no shared runtime/session UI behavior changed beyond the targeted Game Workspace create/API validation lane.
54+
- SKIP - Full samples smoke, per instruction.
55+
56+
## Manual Validation Notes
57+
- `.env.local` was updated locally without exposing values: old database key renamed to `GAMEFOUNDRY_DATABASE_URL`, provider-selection keys removed, and the four required connection keys retained.
58+
- `.env.uat` was validated structurally only; no UAT secrets were created or printed.
59+
- Runtime validation used `.env` as the only startup-loaded env file and restored the tracked placeholder `.env` immediately after the check.
60+
- Targeted Game Workspace validation confirmed create/open/delete behavior and active-game API diagnostics do not throw.
61+
- Browser environment validation confirmed active page code remains free of deployment-label branching, product-data fallback, and implementation wording leaks.
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1+
# PR_26167_193 source commit files (HEAD)
2+
.env
3+
.env.example
4+
.env.uat
5+
.gitignore
6+
scripts/apply-supabase-dev-ddl.mjs
7+
scripts/start-local-api-server.mjs
8+
scripts/validate-supabase-dev.mjs
9+
src/dev-runtime/auth/provider-contract-stubs.mjs
10+
tests/dev-runtime/SupabaseProviderContractStub.test.mjs
11+
tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs
12+
113
# git status --short
2-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
14+
M docs_build/dev/reports/codex_changed_files.txt
15+
M docs_build/dev/reports/codex_review.diff
16+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
317
M docs_build/dev/reports/playwright_v8_coverage_report.txt
4-
M src/dev-runtime/server/local-api-router.mjs
5-
M tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs
6-
M toolbox/game-workspace/game-workspace.js
7-
?? .env.uat
8-
?? docs_build/dev/reports/PR_26167_192-env-config-and-game-workspace-create-fix.md
9-
10-
# git ls-files --others --exclude-standard
11-
.env.uat
12-
docs_build/dev/reports/PR_26167_192-env-config-and-game-workspace-create-fix.md
18+
?? docs_build/dev/reports/PR_26167_193-env-runtime-single-file-and-generic-db-url.md
1319

1420
# git diff --stat
15-
.../dev/reports/coverage_changed_js_guardrail.txt | 15 ++-
16-
.../dev/reports/playwright_v8_coverage_report.txt | 52 ++++----
17-
src/dev-runtime/server/local-api-router.mjs | 31 ++++-
18-
.../tools/GameWorkspaceMockRepository.spec.mjs | 133 +++++++++++++++++++++
19-
toolbox/game-workspace/game-workspace.js | 115 +++++++++++++++---
20-
5 files changed, 299 insertions(+), 47 deletions(-)
21+
docs_build/dev/reports/codex_changed_files.txt | 18 +-
22+
docs_build/dev/reports/codex_review.diff | 1076 ++++++++------------
23+
.../dev/reports/coverage_changed_js_guardrail.txt | 20 -
24+
.../dev/reports/playwright_v8_coverage_report.txt | 38 +-
25+
4 files changed, 456 insertions(+), 696 deletions(-)

0 commit comments

Comments
 (0)