Skip to content

Commit 2b7c4ba

Browse files
committed
Redo single runtime env file and generic database URL - PR_26167_193-env-runtime-single-file-and-generic-db-url-redo
1 parent b66ffd1 commit 2b7c4ba

10 files changed

Lines changed: 511 additions & 499 deletions

.env

Lines changed: 0 additions & 4 deletions
This file was deleted.

.env.uat

Lines changed: 0 additions & 9 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@ docs/dev/reports/playwright_v8_coverage_report.txt
3838
*.mkv
3939

4040
.env
41-
.env.local
41+
.env.*
42+
!.env.example
43+
!.env.sample
44+
!.env.template
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# PR_26167_193-env-runtime-single-file-and-generic-db-url-redo
2+
3+
## Branch Validation
4+
- PASS - Current branch is `main`.
5+
- PASS - `docs_build/dev/PROJECT_INSTRUCTIONS.md` was read before redo work.
6+
7+
## Actual Changed Runtime/Config Files
8+
- PASS - `.gitignore` updated so runtime env files are ignored with `.env` and `.env.*`, while `.env.example`, `.env.sample`, and `.env.template` remain trackable.
9+
- PASS - `.env` removed from git tracking; local ignored file remains user-managed.
10+
- PASS - `.env.uat` removed from git tracking; local ignored file remains user-managed.
11+
- PASS - `scripts/validate-browser-env-agnostic.mjs` expanded from browser/page validation to active app/server/runtime/DB/example environment-branching validation.
12+
- PASS - Runtime/config files already correct in active source and revalidated: `scripts/start-local-api-server.mjs`, `scripts/validate-supabase-dev.mjs`, `scripts/apply-supabase-dev-ddl.mjs`, `src/dev-runtime/auth/provider-contract-stubs.mjs`, `tests/dev-runtime/SupabaseProviderContractStub.test.mjs`, and `tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs`.
13+
14+
## Requirement Checklist
15+
- PASS - Runtime loads only `.env`.
16+
- PASS - Runtime does not auto-load `.env.local`, `.env.uat`, or `.env.prod`.
17+
- PASS - Tests/validation may explicitly load `.env.local`; `npm run validate:supabase-dev` did so.
18+
- PASS - `.gitignore` ignores `.env` and `.env.*`.
19+
- PASS - `.env.example` remains trackable.
20+
- PASS - `GAMEFOUNDRY_AUTH_PROVIDER` and `GAMEFOUNDRY_DB_PROVIDER` are absent from active runtime startup use.
21+
- PASS - `GAMEFOUNDRY_SUPABASE_DATABASE_URL` is absent from active non-report paths.
22+
- PASS - `GAMEFOUNDRY_DATABASE_URL` is used by active runtime/validation/DDL/provider/test paths.
23+
- PASS - Ignored `.env.local` was normalized to the four required keys without printing values.
24+
- PASS - Ignored `.env.uat` was normalized to the same key structure without printing values.
25+
- PASS - No DEV/UAT/PROD deployment-label branching found across active app/server/API/service/DB runtime paths outside tests and validation exceptions.
26+
- PASS - No local-db/mock-db/SQLite fallback was added by this redo.
27+
- PASS - No silent fallback was introduced.
28+
29+
## Env Loading Evidence
30+
- PASS - `scripts/start-local-api-server.mjs` defines `RUNTIME_ENV_FILE = ".env"`.
31+
- PASS - `rg` found no `.env.local`, `.env.uat`, `.env.prod`, provider env vars, or provider-selection wording in runtime startup.
32+
- PASS - Runtime validation temporarily copied `.env.local` to ignored `.env`, ran `npm run dev:local-api`, then restored the original local `.env`.
33+
- PASS - Runtime startup output included `.env loaded for API runtime (4 key(s) applied).`
34+
- PASS - Runtime startup output included `Configured auth connection: configured.`
35+
- PASS - Runtime startup output included `Configured database connection: configured.`
36+
37+
## Rename Evidence
38+
- PASS - Active non-report scan found no `GAMEFOUNDRY_SUPABASE_DATABASE_URL`.
39+
- PASS - `.env.example`, runtime startup, Supabase DEV validation, DDL apply, provider contract stubs, and targeted tests use `GAMEFOUNDRY_DATABASE_URL`.
40+
- PASS - Local ignored `.env.local` and `.env.uat` contain `GAMEFOUNDRY_DATABASE_URL`; values were not printed.
41+
42+
## Provider Var Removal Evidence
43+
- PASS - `scripts/start-local-api-server.mjs` contains no `GAMEFOUNDRY_AUTH_PROVIDER` or `GAMEFOUNDRY_DB_PROVIDER`.
44+
- PASS - `.env.example` contains no `GAMEFOUNDRY_AUTH_PROVIDER` or `GAMEFOUNDRY_DB_PROVIDER`.
45+
- PASS - Runtime startup reports Auth connection and Database connection readiness, not provider selection.
46+
47+
## .env.local/.env.uat Creation Evidence
48+
- PASS - `.env.local`: required key structure present; forbidden provider/old database keys absent; values not printed.
49+
- PASS - `.env.uat`: required key structure present; forbidden provider/old database keys absent; values not printed.
50+
- PASS - Both files are ignored by `.gitignore` and excluded from the ZIP.
51+
52+
## No Environment-Branching Evidence
53+
- PASS - `npm run validate:browser-env-agnostic` wrote `docs_build/dev/reports/environment_agnostic_browser_gate_report.md`.
54+
- PASS - The expanded gate scanned active roots: `account`, `admin`, `assets/theme-v2/js`, `toolbox`, `src/engine`, `src`, `scripts`, and `docs_build/database`.
55+
- PASS - The expanded gate scanned runtime example/config files: `.env.example` and `package.json`.
56+
- PASS - Files scanned: 798.
57+
- PASS - Deployment-label branching findings: None.
58+
- PASS - Account page dependency findings: None.
59+
- PASS - Product service contract findings: None.
60+
- PASS - User-facing implementation wording findings: None.
61+
- PASS - Deprecated SQLite/Local DB technical debt findings: None.
62+
63+
## Validation Lane Report
64+
- PASS - `node --check scripts/validate-browser-env-agnostic.mjs`
65+
- PASS - `node --check scripts/start-local-api-server.mjs`
66+
- PASS - `node --check scripts/validate-supabase-dev.mjs`
67+
- PASS - `node --check scripts/apply-supabase-dev-ddl.mjs`
68+
- PASS - `node --check src/dev-runtime/auth/provider-contract-stubs.mjs`
69+
- PASS - `node --check tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs`
70+
- PASS - `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`
71+
- PASS - `npm run validate:supabase-dev`
72+
- PASS - Explicit `.env.local` DEV validation load.
73+
- PASS - Auth connection URL, anon key, service role key, and database connection URL configured with masked diagnostics.
74+
- PASS - Supabase Auth/REST identity tables reachable.
75+
- WARN - Direct PostgreSQL TLS reported `SELF_SIGNED_CERT_IN_CHAIN`; validator marked this advisory because REST/API identity readiness passed.
76+
- PASS - `npm run dev:local-api` runtime check on alternate port after temporary `.env.local` to `.env` copy.
77+
- PASS - `npx playwright test tests/playwright/tools/GameWorkspaceMockRepository.spec.mjs --grep "Game Workspace creates|active-game API" --workers=1 --reporter=list` (2 passed).
78+
- PASS - `npm run validate:browser-env-agnostic`
79+
- SKIP - Full samples smoke, per instruction.
80+
81+
## Manual Validation Notes
82+
- `.env.local` and `.env.uat` were updated locally as ignored copy-source files; no secret values were printed, reported, or packaged.
83+
- Runtime validation used `.env` as the only startup-loaded env file and restored the original ignored `.env` immediately after the check.
84+
- Targeted Game Workspace validation covered game create/open/delete and active-game API diagnostics without throwing.
85+
- Redo ZIP excludes `.env`, `.env.local`, `.env.uat`, `tmp/` contents, `.log`, and `.pid` files.
Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
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-
131
# git status --short
2+
D .env
3+
D .env.uat
4+
M .gitignore
145
M docs_build/dev/reports/codex_changed_files.txt
156
M docs_build/dev/reports/codex_review.diff
167
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
8+
M docs_build/dev/reports/environment_agnostic_browser_gate_report.md
179
M docs_build/dev/reports/playwright_v8_coverage_report.txt
18-
?? docs_build/dev/reports/PR_26167_193-env-runtime-single-file-and-generic-db-url.md
10+
M scripts/validate-browser-env-agnostic.mjs
11+
?? docs_build/dev/reports/PR_26167_193-env-runtime-single-file-and-generic-db-url-redo.md
12+
13+
# git diff --cached --stat
14+
.env | 4 ----
15+
.env.uat | 9 ---------
16+
.gitignore | 5 ++++-
17+
3 files changed, 4 insertions(+), 14 deletions(-)
1918

2019
# git diff --stat
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(-)
20+
docs_build/dev/reports/codex_changed_files.txt | 41 +-
21+
docs_build/dev/reports/codex_review.diff | 728 ++++++++-------------
22+
.../dev/reports/coverage_changed_js_guardrail.txt | 4 +-
23+
.../environment_agnostic_browser_gate_report.md | 52 +-
24+
.../dev/reports/playwright_v8_coverage_report.txt | 11 +-
25+
scripts/validate-browser-env-agnostic.mjs | 72 +-
26+
6 files changed, 422 insertions(+), 486 deletions(-)
27+
28+
# git ls-files --others --exclude-standard
29+
docs_build/dev/reports/PR_26167_193-env-runtime-single-file-and-generic-db-url-redo.md

0 commit comments

Comments
 (0)