feat(cli): port supabase test db and test new - #5522
Merged
Conversation
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.
What changed
Native TypeScript port of
supabase test dbandsupabase test newinto the legacy shell (stable channel), replacing the Phase-0 Go proxies.test new— writessupabase/tests/<name>_test.sqlfrom the embedded pgtap template; matches Go's relative-path success message, file location, and exit codes.--template(pgtap).test db—--db-url/--local/--linked+ variadic paths. Connects via@effect/sql-pgto enable/disable the pgTAP extension, then runssupabase/pg_prove:3.36throughdocker run(read-only volume mounts,--security-opt label:disable, local docker network or host networking). Honors--network-id, and thedb-url/linked/localmutual-exclusivity is byte-for-byte identical to Go's cobra error.New shared infrastructure (for upcoming
db reset/db dumpports)LegacyDbConnection— Postgres connection seam (single swap point for the driver).LegacyDbConfigResolver—--db-url/--local/--linkedresolution, including the linked sub-flow (temp login-role viaV1CreateLoginRole, pooler fallback with a public-suffix MITM domain check, network-ban unban, backoff). Ports Go'sflags.ParseDatabaseConfig+NewDbConfigWithPassword.LegacyDockerRun— one-shotdocker runrunner.The Management API stack is built lazily on the
--linkedbranch only, so--local/--db-urlnever resolve an access token (auth-free, matching Go).Reviewer notes
@effect/sql-pg(4.0.0-beta.75, pure-JSpg); verified it bundles and round-trips underbun build --compile.PgClientexposes noOnNoticehook, so "already installed" is detected with apg_extensionpre-check before enabling — equivalent observable behavior to Go's notice-code 42710 callback.SIDE_EFFECTS.md):test dbhas no--output-formatmachine envelope (Go has none; TAP streams to stdout in all modes); the[images] pgproveconfig override is not modeled by the TS config schema.Known follow-up
The
--linkedsub-flow (login-role / pooler / unban / backoff) is implemented and type-checked but lacks a dedicated integration test — it requires the real management runtime with a mocked HTTP transport and a real linked project to verify faithfully. The local/db-url resolver paths andtomlparsing are covered.Closes CLI-1318