|
| 1 | +# PR_26166_128 Supabase DEV Activation Checklist |
| 2 | + |
| 3 | +## Branch Validation |
| 4 | + |
| 5 | +- PASS: Current branch is `main`. |
| 6 | +- Expected branch: `main`. |
| 7 | + |
| 8 | +## Scope Notes |
| 9 | + |
| 10 | +- PASS: Scoped this PR to DEV activation checklist and diagnostics. |
| 11 | +- PASS: Did not activate Supabase automatically. |
| 12 | +- PASS: Did not add secrets. |
| 13 | +- PASS: Local DB remains active by default. |
| 14 | + |
| 15 | +## DEV Activation Checklist |
| 16 | + |
| 17 | +1. Create the reviewed Supabase DEV project outside the repo. |
| 18 | +2. Add local-only environment values outside source control: |
| 19 | + - `GAMEFOUNDRY_SUPABASE_URL` |
| 20 | + - `GAMEFOUNDRY_SUPABASE_ANON_KEY` |
| 21 | + - `GAMEFOUNDRY_SUPABASE_SERVICE_ROLE_KEY` |
| 22 | + - `GAMEFOUNDRY_SUPABASE_DATABASE_URL` |
| 23 | +3. Confirm `/api/providers/contract` reports: |
| 24 | + - `activationReadiness.supabaseAuthReady = true` |
| 25 | + - `activationReadiness.supabasePostgresReady = true` |
| 26 | + - `activationReadiness.siteSetupReady = true` |
| 27 | + - `activationReadiness.readyBeforeActivation = true` |
| 28 | +4. Switch the auth provider only after diagnostics are ready: |
| 29 | + - `GAMEFOUNDRY_AUTH_PROVIDER=supabase-auth` |
| 30 | +5. Switch the DB provider only after diagnostics are ready: |
| 31 | + - `GAMEFOUNDRY_DB_PROVIDER=supabase-postgres` |
| 32 | +6. Run Admin -> Site Setup readiness checks before setup execution. |
| 33 | +7. Migrate or map users and roles through reviewed Admin Site Setup behavior: |
| 34 | + - Supabase auth user id -> `users.key` |
| 35 | + - `roles.key` |
| 36 | + - `user_roles.userKey` |
| 37 | + - `user_roles.roleKey` |
| 38 | +8. Validate DB Viewer readiness and Local API provider diagnostics. |
| 39 | +9. Recommend the next PR only after the user creates the Supabase DEV project and local env vars. |
| 40 | + |
| 41 | +## Expected Diagnostics |
| 42 | + |
| 43 | +- PASS: Missing Supabase Auth config reports missing browser-safe variables. |
| 44 | +- PASS: Missing Supabase Postgres config reports missing URL/server-only credentials without exposing server-only names or values. |
| 45 | +- PASS: `activationReadiness.readyBeforeActivation` is `false` until both Auth and Postgres are configured. |
| 46 | +- PASS: `activationReadiness.readyBeforeActivation` is `true` when the required Auth and Postgres config exists. |
| 47 | +- PASS: `activationReadiness.rollback` states how to return to Local DB. |
| 48 | +- PASS: Active providers remain `local-db/local-db` until a future activation PR explicitly changes behavior. |
| 49 | + |
| 50 | +## Rollback Checklist |
| 51 | + |
| 52 | +1. Set `GAMEFOUNDRY_AUTH_PROVIDER=local-db`. |
| 53 | +2. Set `GAMEFOUNDRY_DB_PROVIDER=local-db`. |
| 54 | +3. Restart the Local API. |
| 55 | +4. Confirm `/api/providers/contract` reports active providers `local-db/local-db`. |
| 56 | +5. Confirm `account/sign-in.html` opens. |
| 57 | +6. Confirm `admin/db-viewer.html` opens and remains Local DB-backed. |
| 58 | + |
| 59 | +## Requirement Checklist |
| 60 | + |
| 61 | +- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before execution. |
| 62 | +- PASS: Verified current branch is `main`. |
| 63 | +- PASS: Scoped to activation checklist and diagnostics only. |
| 64 | +- PASS: Did not activate Supabase automatically. |
| 65 | +- PASS: Did not add secrets. |
| 66 | +- PASS: Added clear DEV activation checklist. |
| 67 | +- PASS: Included required env vars. |
| 68 | +- PASS: Included auth provider switch. |
| 69 | +- PASS: Included DB provider switch. |
| 70 | +- PASS: Included expected diagnostics. |
| 71 | +- PASS: Included rollback to Local DB. |
| 72 | +- PASS: Included Admin Site Setup steps. |
| 73 | +- PASS: Included user/role migration steps. |
| 74 | +- PASS: Added diagnostics that confirm whether Supabase Auth and Postgres are ready before activation. |
| 75 | +- PASS: Recommended next PR only after the user creates Supabase DEV project and env vars. |
| 76 | + |
| 77 | +## Validation Lane Report |
| 78 | + |
| 79 | +- Impacted lane: DB/Auth provider diagnostics. |
| 80 | +- Runtime JavaScript changed: Yes, because activation readiness diagnostics were added to provider contract output. |
| 81 | +- Playwright impacted: Yes. |
| 82 | +- Broad lanes skipped: full samples smoke, full engine, broad toolbox, full Playwright. |
| 83 | +- Skip reason: targeted provider contract, sign-in, and DB Viewer validation covered the affected route/runtime surface. |
| 84 | +- Samples decision: SKIP because samples are not in scope. |
| 85 | +- V8 coverage: `docs_build/dev/reports/playwright_v8_coverage_report.txt`. |
| 86 | +- V8 coverage note: changed server-side dev-runtime JS is advisory WARN in browser V8 coverage and covered by Node tests. |
| 87 | + |
| 88 | +## Commands Run |
| 89 | + |
| 90 | +- PASS: `node --check src/dev-runtime/auth/provider-contract-stubs.mjs`. |
| 91 | +- PASS: `node --check tests/dev-runtime/SupabaseProviderContractStub.test.mjs`. |
| 92 | +- PASS: `node --test tests/dev-runtime/SupabaseProviderContractStub.test.mjs` passed 9/9 tests. |
| 93 | +- PASS: Targeted Playwright passed 3/3 tests for DB Viewer and sign-in/session routes. |
| 94 | +- PASS: `npm run dev:local-api` started through `npm.cmd` on port `5537`. |
| 95 | +- PASS: Local API provider diagnostics confirmed: |
| 96 | + - `activationReadiness.readyBeforeActivation = false` before Supabase config |
| 97 | + - active providers `local-db/local-db` |
| 98 | + - Supabase Auth status `adapter-inactive` |
| 99 | + - Supabase Postgres status `adapter-inactive` |
| 100 | + - secret values exposed `false` |
| 101 | + - server-only names exposed `false` |
| 102 | +- PASS: `git diff --check`. |
| 103 | + |
| 104 | +## Manual Validation Notes |
| 105 | + |
| 106 | +- No Supabase runtime is active by default after this PR. |
| 107 | +- No UAT/PROD auth behavior changed. |
| 108 | +- No package dependency was added. |
| 109 | +- No secrets were committed. |
| 110 | +- Repo-structured ZIP path: `tmp/PR_26166_128-supabase-dev-activation-checklist_delta.zip`. |
0 commit comments