feat(portability): committed materialized (ejected) vendor modules, both directions - #33
Merged
Merged
Conversation
…oth directions Bump @pgpmjs/* + supabase-test to the freshly published versions (core 7.20.0, portability 0.3.0, supabase-test 3.9.0) and add persistent ejected modules under portability/materialized/, separate from the source fixtures in packages/. Forward (Supabase -> pgpm) deploys + tests on plain PG; reverse (pgpm -> Supabase) deploys on the vendor stack; both directions covered by a deterministic byte-identical drift gate.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
@pgpmjs/*+supabase-testto the freshly published versions (core7.20.0, portability0.3.0,supabase-test3.9.0, …) and adds persistent, committed materialized ("ejected") vendor modules in both directions, kept in a separateportability/materialized/tree so they don't clutter the source fixtures inportability/packages/.Until now the transform only ran at deploy time (
seed.apply) — nothing landed on disk to review. This ejects the apply proxies into ordinary pgpm modules (deploy/ revert/ verify/ pgpm.plan / *.control, nopgpm.apply.json) with the transforms baked into the SQL, so they deploy like any hand-written module. Every transform is derived from thesupabasevendor shape (fromVendorProfile/toVendorProfile), not hand-written routing.What each direction bakes in:
uuid_generate_v4vendor-app-materialized(fwd)plpgsql, uuid-ossp, auth-providerapp_auth.usersapp_auth.current_user_id()vendor-app-native-materialized(rev)plpgsqlauth.usersauth.uid()extensions.uuid_generate_v4()Tests added (run serially):
materialized-drift.test.ts— the drift gate on plain PostgreSQL: re-materializes into a temp dir and asserts byte-identical output vs. what's committed (both directions), plus asserts each module is a plain pgpm module (nopgpm.apply.json).materialized-forward.test.ts— deploys the committed forward module on plain PostgreSQL (PgpmPackage.deployresolvesauth-provider+uuid-osspfirst) and assertsauth/extensionsschemas are absent, the FK/RLS are rebound onto the generic provider, and RLS is enforced throughapp_auth.current_user_id().materialized-reverse.test.ts— deploys Supabase's nativesupabasefixture, then the committed reverse module on top, asserting the FK/RLS rebind back ontoauth.users/auth.uid(). Gated behindVENDOR_STACK=1(the vendor workflow) because the native subsystem needs Supabase-only extensions (pg_graphql,supabase_vault) unavailable on plainpostgres-plus; the ejected SQL and its determinism for this direction are still verified on plain PG by the drift gate.src/materialize-fixtures.tsis the committed generator (materializeApplyModuleover the vendor-shape specs) used both to regenerate the artifacts and by the drift test. It also finalizes the ejected.controlrequires(forward addsauth-provider, keepsuuid-ossp; reverse drops both — the stack ownsauthand theextensionsschema natively), sincematerializeApplyModuledoes not yet fold apply-specrequiresinto the emitted control.portability/pgpm.jsonnow globsmaterialized/packages/*so the ejected modules are discoverable for plain deployment.Local: on
postgres-plus:18, 20 tests pass + 4 skipped (the vendor-stack reverse/deploy suites gate off withoutVENDOR_STACK).Link to Devin session: https://app.devin.ai/sessions/025fb88043964fdbb335ac5e39df2478
Requested by: @pyramation