fix(db): guard hosted migration role usage#1077
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughAdds a hosted migration-role guard to repository validation and CI, pins immutable historical migration content, and updates bare-image storage scaffolding to discover the local schema owner dynamically. Documentation records the hosted and local role-handling rules. ChangesMigration role safety
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CI
participant MigrationRoleGuard
participant Repository
CI->>MigrationRoleGuard: Run check:migration-role
MigrationRoleGuard->>Repository: Enumerate files and read contents
Repository-->>MigrationRoleGuard: Paths and file contents
MigrationRoleGuard-->>CI: Pass or failure exit status
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
storageschema owner at runtime for drift replay and disaster recovery.RAG impact: no retrieval behaviour change — CI/database replay guardrails only; no protected RAG surface changed.
Verification
origin/mainred proof: the new guard rejected the current generator, scaffold, and runbook on six hard-coded role references.npm run check:migration-rolenpm run check:gate-manifest— 21/21 local cheap gates represented in CI.node scripts/run-vitest.mjs run tests/hosted-migration-role-guard.test.ts tests/drift-detection.test.ts --reporter=verbose— 15/15 passed.npm run drift:manifest -- --container clinical-kb-migration-role-reconcile --port 56642— disposable PostgreSQL 17.6 replay passed in 17s; container removed; regenerated snapshot structurally identical.npm run verify:cheap— all 21 gates passed; 359 files, 3,182 tests passed, 1 skipped.npm run format:changed && npm run build && npm run check:rag:fixtures— formatting, production build, client-secret scan, 36 fixtures and 21 suites passed.verify:pr-local -- --dry-runselected runtime, format, lint, typecheck, unit, build and offline RAG fixtures. Its unit/static work was already covered byverify:cheap; the remaining format/build/fixture commands were run individually to avoid repeating the full unit suite.Verification not run: browser matrix because no UI/browser behavior changed. No live Supabase project check, migration apply, OpenAI, Railway, or live RAG evaluation was run because this changes local/CI guardrails only and does not alter hosted schema or retrieval behavior.
Risk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes