Repository navigation
TML-2503: extension-supabase Slice E — docs, real-Supabase acceptance harness, close-out - #985
Conversation
…sions Correct the package README (the "does not ship" section listed shipped features — runtime, RLS, roles, cross-contract FK, namespace queries — as unshipped); add runtime usage, the role-binding model (ADR 230), JWT validation modes (jwtSecret/jwksUrl), the service_role .supabase admin root (C15), unsupported scope, and post-launch deferrals. Fold in the runtime-usage content from the codex README draft (supersedes #913). Author the missing examples/supabase/README.md (FR20/AC9): what the example proves and how to run both test lanes, including the real-Supabase acceptance procedure. Mark the umbrella decisions log shipped with merged-PR links (C5, C8, C12–C16). Part of extension-supabase Slice E (TML-2503). Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
examples/supabase/test/real-supabase.acceptance.test.ts is the launch- blocking acceptance run: the four RLS role-binding flows (asUser owner-only, asAnon public-read, asServiceRole BYPASSRLS, expired-JWT InvalidJwtError) plus the ORM update-own + withCheck flow, run against a live Supabase Postgres. describe.skipIf on DATABASE_URL + SUPABASE_JWT_SECRET keeps it skipped-green on the normal CI path; it executes only when both are set. JWTs are signed with the real secret (HS256, as GoTrue issues them); the two auth.users rows the FK needs are seeded over the privileged connection and torn down after, so the suite is re-runnable. No PGlite shim — a real project already has auth.*/storage.* and the platform roles. Part of extension-supabase Slice E (TML-2503). Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Add the Slice E slice contract + build plan (matching slices D/G), and mark the parent plan status: docs + acceptance harness shipped; the extension- authoring skill repoint deferred (no authoring skill exists in-tree yet, only the upgrade skill); the real-Supabase acceptance execution is a manual post- merge step; and the project-dir deletion is deferred to the umbrella close-out (the live projects/supabase-integration/ densely references this dir, and its own README says constituent dirs are deleted alongside it). Part of extension-supabase Slice E (TML-2503). Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds real-Supabase acceptance tests covering role-bound RLS, ownership updates, SQL middleware capture, and expired JWTs. Expands Supabase runtime documentation and adds an example README describing configuration and test modes. ChangesSupabase runtime validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Test
participant SupabaseDb
participant Postgres
Test->>SupabaseDb: Bind asUser, asAnon, or asServiceRole
SupabaseDb->>Postgres: Execute ORM query
Postgres-->>SupabaseDb: Apply RLS and return result
SupabaseDb-->>Test: Return rows or error
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
size-limit report 📦
|
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/extension-supabase
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/config-loader
@prisma-next/emitter
@prisma-next/language-server
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
The check:upgrade-coverage PR gate requires every PR touching examples/ or packages/3-extensions/ to record a per-PR declaration in the in-flight 0.14-to-0.15 upgrade-instructions files. Slice E s substrate diff is docs + one env-guarded example test — no consumer-facing change — so no changes[] entry is warranted; record the incidental touch as a scope note, matching the existing convention in both files. Part of extension-supabase Slice E (TML-2503). Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
What this is
The launch-readiness close-out for
@prisma-next/extension-supabase— the last slice of the extension-supabase project. Everything the package does already shipped (contract, roles, RLS-through-authoring, thedb.supabaseadmin root, the complete contract in #960). This makes it launch-ready: accurate docs and the real-Supabase acceptance harness.What ships here
jwtSecret/jwksUrl, theservice_role.supabaseadmin root, a TS.rls()note), an honest Not supported (out of v0.1 scope) list, and a Known gaps (deferred to post-launch) note.examples/supabase/README.md— the example had none, yet FR20/AC9 require one. Covers what the example proves and how to run both test lanes.examples/supabase/test/real-supabase.acceptance.test.ts, the launch-blocking acceptance run (see below).decisions.md— a ✅ shipped-status table mapping each realized decision (C5, C8, C12–C16) to its merged PR.The acceptance harness
It is the existing four-flow hermetic test (
rls-role-binding.integration.test.ts) reparameterized for a live Supabase Postgres: the four flows (asUser owner-only, asAnon public-read, asServiceRole BYPASSRLS, expired-JWTInvalidJwtError) plus the ORM update-own +withCheckflow.describe.skipIf(!DATABASE_URL || !SUPABASE_JWT_SECRET)keeps it skipped-green on the normal CI path; it executes only when both env vars are set — so the infra dependency collapses to "set two env vars, run one suite." JWTs are signed with the real secret (HS256, exactly as GoTrue issues them), and the twoauth.usersrows the FK needs are seeded over the privileged connection and torn down after, so it's re-runnable. No PGlite shim — a real project already hasauth.*/storage.*and the platform roles.Three decisions worth calling out
projects/extension-supabase/here, but the live umbrellaprojects/supabase-integration/(whose close-out is out of scope) densely references it — the README constituent table,overview.md§7–8,decisions.mdC2/C12,design-holes.md, andnative-postgres-enums. The umbrella's own README says constituent dirs are deleted alongside it, so the deletion rides with that rather than leaving the live umbrella with dangling links.Verified
pnpm --filter @prisma-next/example-supabase typecheckandlintclean; the acceptance suite reports skipped (green) with no env vars set, and the rest of the example suite stays green. Docs are markdown-only (no build/test impact). Branch is cut fresh from post-#960main.Deferred / manual (not gates on this PR)
Part of the Supabase integration umbrella. Closes the extension-supabase project's substantive work; only the umbrella-level close-out paperwork remains.
🤖 Generated with Claude Code
Summary by CodeRabbit
/runtimeusage guide, JWT validation options, role-bound execution (asUser,asAnon,asServiceRole), and guidance for RLS policy authoring and service-role administration.