Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

TML-2503: extension-supabase Slice E — docs, real-Supabase acceptance harness, close-out - #985

Merged
wmadden-electric merged 4 commits into
mainfrom
tml-2503-supabase-slice-e-closeout
Jul 15, 2026
Merged

wmadden-electric merged 4 commits into
mainfrom
tml-2503-supabase-slice-e-closeout

Conversation

@wmadden-electric

@wmadden-electric wmadden-electric commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

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, the db.supabase admin root, the complete contract in #960). This makes it launch-ready: accurate docs and the real-Supabase acceptance harness.

What ships here

  • Package README, corrected to as-built. TML-2503: the complete, faithful Supabase contract — introspected from a reference instance #960 rewrote the Overview well but left a self-contradiction: the "What this pack does not ship" section still listed the runtime, RLS, roles, cross-contract FK, and namespace queries as unshipped, even though the Overview says they shipped. Replaced with a Runtime usage section (role-binding model per ADR 230, JWT validation modes jwtSecret/jwksUrl, the service_role .supabase admin 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.
  • Real-Supabase acceptance harness — examples/supabase/test/real-supabase.acceptance.test.ts, the launch-blocking acceptance run (see below).
  • Umbrella 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-JWT InvalidJwtError) plus the ORM update-own + withCheck flow.

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 two auth.users rows 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 has auth.*/storage.* and the platform roles.

Three decisions worth calling out

Verified

pnpm --filter @prisma-next/example-supabase typecheck and lint clean; 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-#960 main.

Deferred / manual (not gates on this PR)

  • Executing the acceptance run against a provisioned real Supabase project — the launch evidence; needs infra (provisioning owner TBD).
  • Perf benchmarks (NFR1/2) and per-subpath bundle thresholds (NFR3) — operator-approved post-launch, recorded in the package README's "Known gaps."
  • A background task was spun off to finish the explicit-namespace-dsl project close-out (promote its ADR draft, delete its dir) — flagged, not absorbed here.

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

  • Documentation
    • Expanded the Supabase extension README with a full /runtime usage guide, JWT validation options, role-bound execution (asUser, asAnon, asServiceRole), and guidance for RLS policy authoring and service-role administration.
    • Added/updated the runnable Supabase example documentation and clarified upgrade instructions.
  • Tests
    • Added real-Supabase acceptance tests (env-guarded) covering RLS behavior for authenticated, anonymous, and service-role access, plus ownership and expired-JWT handling.

…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]>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 500b5735-f75b-4409-a5f9-9d0c318abbd4

📥 Commits

Reviewing files that changed from the base of the PR and between 0eb9cf9 and f6dd875.

📒 Files selected for processing (2)
  • skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
  • skills/upgrade/prisma-next-upgrade/upgrades/0.14-to-0.15/instructions.md

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Supabase runtime validation

Layer / File(s) Summary
Acceptance environment and database setup
examples/supabase/test/real-supabase.acceptance.test.ts
Adds environment gating, JWT signing, SQL recording, database initialization, grants, and temporary migration cleanup.
Role-bound RLS acceptance tests
examples/supabase/test/real-supabase.acceptance.test.ts
Validates user, anonymous, and service-role access, ownership-scoped mutations, middleware SQL behavior, and expired JWT rejection.
Runtime and example documentation
packages/3-extensions/supabase/README.md, examples/supabase/README.md, skills/.../instructions.md
Documents runtime dependencies, role binding, JWT configuration, admin access, RLS authoring, supported scope, example test execution, and upgrade notes.

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
Loading

Possibly related PRs

  • prisma/prisma-next#845: Introduces the service-role secondary namespace validated by these docs and tests.
  • prisma/prisma-next#950: Adds the Supabase contract RLS policies exercised by the acceptance suite.
  • prisma/prisma-next#957: Introduces the role vocabulary and runtime behavior exercised by asUser, asAnon, and asServiceRole.

Suggested reviewers: wmadden, tensordreams, sevinf

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: Supabase docs, a real-Supabase acceptance harness, and close-out work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-2503-supabase-slice-e-closeout

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
postgres / no-emit 157.93 KB (0%)
postgres / emit 131.71 KB (0%)
mongo / no-emit 98.71 KB (0%)
mongo / emit 89.43 KB (0%)
cf-worker / no-emit 184.61 KB (0%)
cf-worker / emit 155.81 KB (0%)

@pkg-pr-new

pkg-pr-new Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/@prisma-next/extension-author-tools@985

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/@prisma-next/mongo-runtime@985

@prisma-next/family-mongo

npm i https://pkg.pr.new/@prisma-next/family-mongo@985

@prisma-next/sql-runtime

npm i https://pkg.pr.new/@prisma-next/sql-runtime@985

@prisma-next/family-sql

npm i https://pkg.pr.new/@prisma-next/family-sql@985

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/@prisma-next/extension-arktype-json@985

@prisma-next/middleware-cache

npm i https://pkg.pr.new/@prisma-next/middleware-cache@985

@prisma-next/mongo

npm i https://pkg.pr.new/@prisma-next/mongo@985

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/@prisma-next/extension-paradedb@985

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/@prisma-next/extension-pgvector@985

@prisma-next/extension-postgis

npm i https://pkg.pr.new/@prisma-next/extension-postgis@985

@prisma-next/postgres

npm i https://pkg.pr.new/@prisma-next/postgres@985

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/@prisma-next/sql-orm-client@985

@prisma-next/sqlite

npm i https://pkg.pr.new/@prisma-next/sqlite@985

@prisma-next/extension-supabase

npm i https://pkg.pr.new/@prisma-next/extension-supabase@985

@prisma-next/target-mongo

npm i https://pkg.pr.new/@prisma-next/target-mongo@985

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/@prisma-next/adapter-mongo@985

@prisma-next/driver-mongo

npm i https://pkg.pr.new/@prisma-next/driver-mongo@985

@prisma-next/contract

npm i https://pkg.pr.new/@prisma-next/contract@985

@prisma-next/utils

npm i https://pkg.pr.new/@prisma-next/utils@985

@prisma-next/config

npm i https://pkg.pr.new/@prisma-next/config@985

@prisma-next/errors

npm i https://pkg.pr.new/@prisma-next/errors@985

@prisma-next/framework-components

npm i https://pkg.pr.new/@prisma-next/framework-components@985

@prisma-next/operations

npm i https://pkg.pr.new/@prisma-next/operations@985

@prisma-next/ts-render

npm i https://pkg.pr.new/@prisma-next/ts-render@985

@prisma-next/contract-authoring

npm i https://pkg.pr.new/@prisma-next/contract-authoring@985

@prisma-next/ids

npm i https://pkg.pr.new/@prisma-next/ids@985

@prisma-next/psl-parser

npm i https://pkg.pr.new/@prisma-next/psl-parser@985

@prisma-next/psl-printer

npm i https://pkg.pr.new/@prisma-next/psl-printer@985

@prisma-next/cli

npm i https://pkg.pr.new/@prisma-next/cli@985

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/@prisma-next/cli-telemetry@985

@prisma-next/config-loader

npm i https://pkg.pr.new/@prisma-next/config-loader@985

@prisma-next/emitter

npm i https://pkg.pr.new/@prisma-next/emitter@985

@prisma-next/language-server

npm i https://pkg.pr.new/@prisma-next/language-server@985

@prisma-next/migration-tools

npm i https://pkg.pr.new/@prisma-next/migration-tools@985

prisma-next

npm i https://pkg.pr.new/prisma-next@985

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/@prisma-next/vite-plugin-contract-emit@985

@prisma-next/mongo-codec

npm i https://pkg.pr.new/@prisma-next/mongo-codec@985

@prisma-next/mongo-contract

npm i https://pkg.pr.new/@prisma-next/mongo-contract@985

@prisma-next/mongo-value

npm i https://pkg.pr.new/@prisma-next/mongo-value@985

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/@prisma-next/mongo-contract-psl@985

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/@prisma-next/mongo-contract-ts@985

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/@prisma-next/mongo-emitter@985

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/@prisma-next/mongo-schema-ir@985

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/@prisma-next/mongo-query-ast@985

@prisma-next/mongo-orm

npm i https://pkg.pr.new/@prisma-next/mongo-orm@985

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/@prisma-next/mongo-query-builder@985

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/@prisma-next/mongo-lowering@985

@prisma-next/mongo-wire

npm i https://pkg.pr.new/@prisma-next/mongo-wire@985

@prisma-next/sql-contract

npm i https://pkg.pr.new/@prisma-next/sql-contract@985

@prisma-next/sql-errors

npm i https://pkg.pr.new/@prisma-next/sql-errors@985

@prisma-next/sql-operations

npm i https://pkg.pr.new/@prisma-next/sql-operations@985

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/@prisma-next/sql-schema-ir@985

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/@prisma-next/sql-contract-psl@985

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/@prisma-next/sql-contract-ts@985

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/@prisma-next/sql-contract-emitter@985

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/@prisma-next/sql-lane-query-builder@985

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/@prisma-next/sql-relational-core@985

@prisma-next/sql-builder

npm i https://pkg.pr.new/@prisma-next/sql-builder@985

@prisma-next/target-postgres

npm i https://pkg.pr.new/@prisma-next/target-postgres@985

@prisma-next/target-sqlite

npm i https://pkg.pr.new/@prisma-next/target-sqlite@985

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/@prisma-next/adapter-postgres@985

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/@prisma-next/adapter-sqlite@985

@prisma-next/driver-postgres

npm i https://pkg.pr.new/@prisma-next/driver-postgres@985

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/@prisma-next/driver-sqlite@985

commit: f6dd875

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]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants