Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4bf6abb
fix(cli): port db start container bootstrap to native TS (CLI-1954)
Coly010 Jul 31, 2026
6953d03
fix(cli): honor --experimental declarative schema files in db start b…
Coly010 Jul 31, 2026
0646831
fix(cli): route SIGINT/SIGTERM through the global handler for db star…
Coly010 Jul 31, 2026
4a0f16a
docs(cli): document the remote-Docker-daemon caveat of secretFiles bi…
Coly010 Jul 31, 2026
2fcadb5
docs(cli): document the --experimental declarative schema branch in S…
Coly010 Jul 31, 2026
e7d0d95
fix(cli): resolve db.migrations.schema_paths via the toml reader to m…
Coly010 Jul 31, 2026
05e5e91
fix(cli): attach the failing schema file as Go's CmdSuggestion on dec…
Coly010 Jul 31, 2026
c734713
fix(cli): exclude symlinks when expanding schema_paths directories (r…
Coly010 Jul 31, 2026
fea3be9
fix(cli): validate auth duration config fields before native db start…
Coly010 Jul 31, 2026
0e15da5
fix(cli): normalize Windows path separators before globbing schema/se…
Coly010 Jul 31, 2026
b7d2a3b
docs(cli): fix markdown table column alignment in start/db-start SIDE…
Coly010 Jul 31, 2026
89e7533
fix(cli): validate config before the already-running short-circuit in…
Coly010 Jul 31, 2026
f7415c5
fix(cli): preserve the filesystem root when globbing an absolute sche…
Coly010 Jul 31, 2026
0a39dda
fix(cli): restore Go's exact network/volume-probe order and JWKS majo…
Coly010 Aug 1, 2026
06391b4
fix(cli): resolve PG15+ setup-job images per-job instead of batching …
Coly010 Aug 1, 2026
5c07a87
fix(cli): port db reset local recreate to native TS (CLI-1955)
Coly010 Aug 1, 2026
1e7d21d
fix(cli): apply project-dotenv Docker client env before db start boot…
Coly010 Aug 1, 2026
c223fdb
fix(cli): tee one-shot migrate job stderr under --debug (review: PRRT…
Coly010 Aug 1, 2026
9e14165
docs(cli): document project-dotenv Docker env + --debug migrate-job t…
Coly010 Aug 1, 2026
7cd904d
fix(cli): treat Podman's lowercase not-found errors as absent contain…
Coly010 Aug 1, 2026
3bb14c1
fix(cli): recognize DOCKER_CONFIG as a Docker-client env var (review:…
Coly010 Aug 1, 2026
9f7b87e
fix(cli): validate auth.rate_limit and gate SMS warning on auth.enabl…
Coly010 Aug 1, 2026
bae95bf
fix(cli): validate remaining typed config overrides in db start befor…
Coly010 Aug 1, 2026
cc93e73
docs(cli): document why db start's hostname/passkey checks already ma…
Coly010 Aug 1, 2026
26a602f
fix(cli): honor SUPABASE_NETWORK_ID env fallback in db start and start
Coly010 Aug 1, 2026
7ebbc0c
fix(cli): label PG15+ one-shot setup jobs for rollback discovery (rev…
Coly010 Aug 1, 2026
d9e6ba8
fix(cli): print the OrioleDB S3 env-unset WARN exactly once during fr…
Coly010 Aug 1, 2026
18ae9fe
fix(cli): validate Realtime env overrides in db start's eager battery…
Coly010 Aug 1, 2026
dd76ae9
fix(cli): emit db start's "Starting database..." progress line uncond…
Coly010 Aug 1, 2026
42cafbf
fix(cli): install project-dotenv BITBUCKET_CLONE_DIR before Docker br…
Coly010 Aug 1, 2026
46b2a3c
fix(cli): validate auth.jwt_expiry before db start's already-running …
Coly010 Aug 1, 2026
f8f8aaf
fix(cli): validate the complete root-auth scalar group before db star…
Coly010 Aug 1, 2026
c6b7cdc
fix(cli): validate api.port before db start's already-running shortcut
Coly010 Aug 1, 2026
96c013b
fix(cli): validate db.settings.* before db start's already-running sh…
Coly010 Aug 1, 2026
2795e54
fix(cli): validate db.health_timeout/storage.file_size_limit/realtime…
Coly010 Aug 1, 2026
1cae8b8
fix(cli): discard one-shot setup-job stdout instead of buffering it (…
Coly010 Aug 1, 2026
78b9d96
fix(cli): validate storage.enabled before db start's already-running …
Coly010 Aug 1, 2026
6bd9981
fix(cli): validate edge_runtime/network_restrictions/studio/local_smt…
Coly010 Aug 1, 2026
76cdae8
fix(cli): validate db.pooler.enabled eagerly in db start's config bat…
Coly010 Aug 1, 2026
69b0568
fix(cli): validate studio.port eagerly in db start's config battery (…
Coly010 Aug 1, 2026
6560307
fix(cli): create the current-branch file with Go's 0644 mode (review:…
Coly010 Aug 1, 2026
26f71f1
fix(cli): only treat a confirmed not-found image inspect as a cache m…
Coly010 Aug 1, 2026
0f2b6d9
fix(cli): expand matched seed directories to their .sql files (review…
Coly010 Aug 1, 2026
cf19c1e
Merge remote-tracking branch 'origin/develop' into columferry/cli-195…
Coly010 Aug 3, 2026
f9b5dda
fix(cli): pass debug through legacyRollbackStart at db start's call site
Coly010 Aug 3, 2026
22704e8
Merge remote-tracking branch 'origin/develop' into columferry/cli-195…
Coly010 Aug 3, 2026
f74d5cd
fix(cli): thread --debug through db start's rollback after develop merge
Coly010 Aug 3, 2026
f640ded
Merge remote-tracking branch 'origin/columferry/cli-1954-port-db-star…
Coly010 Aug 3, 2026
3a1c55e
Merge remote-tracking branch 'origin/develop' into columferry/cli-195…
Coly010 Aug 6, 2026
e899e29
fix(cli): run db schema declarative's local reset in-process (CLI-2062)
Coly010 Aug 6, 2026
ef499aa
fix(cli): pass --nginx-conf on kong reload and use normalized schema_…
Coly010 Aug 7, 2026
9df1d7b
style(cli): fix oxfmt formatting in reset.integration.test.ts
Coly010 Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions apps/cli-e2e/src/tests/live/db-reset-start.live.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import { testLive } from "./live-context.ts";
// Exercises `db start`'s native container-bootstrap sequence (network/volume/container
// bring-up, health wait, the fresh-volume SetupLocalDatabase-equivalent pipeline, and
// `_current_branch`) and `db reset --local`'s container-recreate flow end-to-end — the
// real-Docker boundary the in-process integration suites mock. `db reset --local` still
// delegates its container-recreate flow to the bundled Go binary's hidden
// `db __db-bootstrap --mode recreate` seam (CLI-1955, unclaimed as of CLI-1954); `db start`
// no longer does (see `commands/db/start/start.handler.ts`). The start → already-running →
// reset cycle runs in one test so it shares a single booted stack, and `finally` stops it
// (legacy proxies `stop` to Go) so the run never leaves containers behind.
// real-Docker boundary the in-process integration suites mock. Both are fully native TS
// now: `db reset --local`'s hidden Go `db __db-bootstrap` seam (`--mode recreate`/
// `--mode await-storage`) was removed in CLI-1955 (see
// `commands/db/reset/reset.handler.ts` / `shared/db-bootstrap/recreate-local-database.ts`),
// the same way `db start`'s own seam usage was removed in CLI-1954 (see
// `commands/db/start/start.handler.ts`). The start → already-running → reset cycle runs
// in one test so it shares a single booted stack, and `finally` stops it (legacy proxies
// `stop` to Go) so the run never leaves containers behind.
describe.skipIf(TARGET === "ts-next")("db start / db reset --local (live, local Docker)", () => {
testLive(
"db start boots, is idempotent, and db reset --local recreates",
Expand Down
67 changes: 0 additions & 67 deletions apps/cli-go/cmd/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,66 +270,6 @@ var (
},
}

bootstrapMode string
bootstrapSqlPaths []string
bootstrapVersion string
bootstrapNoSeed bool

// dbBootstrapCmd is a hidden seam used by the native-TypeScript `db reset --local`
// command to drive the container-bootstrap primitives that are not yet ported to
// TypeScript: recreating the local Postgres container, applying the initial
// schema, and the storage health gate. The TS caller orchestrates everything else
// (version/last resolution, bucket seeding, the git-branch "Finished…" line,
// telemetry, and --output-format shaping); the seam stays in Go only for the
// Docker lifecycle. It mirrors the existing db __shadow seam: it carries no
// db-url/local/linked target flags, so it loads supabase/config.toml explicitly
// (the root PersistentPreRunE only loads it when a target flag is set). Progress
// goes to stderr; the only stdout output is a single machine-parseable marker
// for --mode await-storage ("ready" or "absent"). `db start`'s own container
// bootstrap (--mode start) was removed from this seam by CLI-1954 — it is now a
// fully native TypeScript implementation
// (apps/cli/src/legacy/commands/db/start/start.handler.ts), reusing
// legacy/shared/db-bootstrap/'s already-ported container-bootstrap primitives
// instead of shelling out to this binary. `start.StartDatabase` itself (called
// below by the real, customer-facing `db start` Go command) is untouched — it
// remains the parity oracle this TS port was checked against.
dbBootstrapCmd = &cobra.Command{
Use: "__db-bootstrap",
Hidden: true,
Short: "Internal: container bootstrap for the native db start / db reset commands",
RunE: func(cmd *cobra.Command, args []string) error {
fsys := afero.NewOsFs()
if err := flags.LoadConfig(fsys); err != nil {
return err
}
switch bootstrapMode {
case "recreate":
// The PG14/PG15 container-recreate half of local db reset. The TS
// caller has already printed "Resetting local database…" and validated
// the flags. Apply the same seed handling as `db reset` (dbResetCmd):
// `--no-seed` disables the seed, `--sql-paths` overrides the seed paths,
// before MigrateAndSeed runs inside the recreate.
if err := applyDbResetSeedFlags(bootstrapNoSeed, bootstrapSqlPaths); err != nil {
return err
}
return reset.RecreateLocalDatabase(cmd.Context(), bootstrapVersion, fsys)
case "await-storage":
ready, err := reset.AwaitStorageReady(cmd.Context())
if err != nil {
return err
}
if ready {
fmt.Println("ready")
} else {
fmt.Println("absent")
}
return nil
default:
return fmt.Errorf("unknown bootstrap mode: %s", bootstrapMode)
}
},
}

dbRemoteCmd = &cobra.Command{
Hidden: true,
Use: "remote",
Expand Down Expand Up @@ -680,13 +620,6 @@ func init() {
shadowFlags.StringSliceVarP(&shadowSchema, "schema", "s", []string{}, "Comma separated list of schema to include.")
shadowFlags.StringVar(&shadowProjectRef, "project-ref", "", "Linked project ref, so the shadow merges the matching [remotes.<ref>] config override.")
dbCmd.AddCommand(dbShadowCmd)
// Build hidden container-bootstrap seam command (native db start / db reset)
bootstrapFlags := dbBootstrapCmd.Flags()
bootstrapFlags.StringVar(&bootstrapMode, "mode", "recreate", "Bootstrap mode: recreate or await-storage.")
bootstrapFlags.StringVar(&bootstrapVersion, "version", "", "Reset up to the specified version (recreate mode).")
bootstrapFlags.BoolVar(&bootstrapNoSeed, "no-seed", false, "Skip the seed script after recreate (recreate mode).")
bootstrapFlags.StringArrayVar(&bootstrapSqlPaths, "sql-paths", nil, "Override [db.seed].sql_paths for the recreate (recreate mode).")
dbCmd.AddCommand(dbBootstrapCmd)
// Build remote command
remoteFlags := dbRemoteCmd.PersistentFlags()
remoteFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.")
Expand Down
6 changes: 4 additions & 2 deletions apps/cli-go/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ package cmd
// talks to Docker directly for `start` and never delegates to this binary
// for it, and no other still-live TS->Go delegation seam (db test, db
// branch/remote, db diff --use-pgadmin/--use-pg-schema, db pull
// --experimental, the hidden db __db-bootstrap/__shadow/__catalog seams,
// etc.) ever called into internal/start either -- see
// --experimental, the hidden db __shadow/__catalog seams -- the sibling
// hidden db __db-bootstrap seam was removed outright by CLI-1955, once
// native `db reset --local` became its last remaining caller -- etc.) ever
// called into internal/start either -- see
// apps/cli/docs/binary-distribution.md § Removed commands for the full
// rationale. This command's registration and flags are kept only so this
// binary's cobra tree / `--help` / `__complete` output stays stable for
Expand Down
32 changes: 0 additions & 32 deletions apps/cli-go/internal/db/reset/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,38 +93,6 @@ func toLogMessage(version string) string {
return "..."
}

// RecreateLocalDatabase is the container-lifecycle half of a local `db reset`,
// exposed for the native-TypeScript `db reset --local` seam (cmd db __db-bootstrap).
// It performs the PG14/PG15 branch — recreate the db container/volume, init schema,
// migrate + seed, and restart the satellite containers — WITHOUT the leading
// "Resetting local database…" line, which the TS caller prints itself. Mirrors
// resetDatabase (above) minus that message.
func RecreateLocalDatabase(ctx context.Context, version string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error {
if utils.Config.Db.MajorVersion <= 14 {
return resetDatabase14(ctx, version, fsys, options...)
}
return resetDatabase15(ctx, version, fsys, options...)
}

// AwaitStorageReady mirrors the storage-health gate that local `db reset` runs
// before seeding buckets (Run, above): if the storage container exists but is not
// healthy, wait up to 30s for it. It reports whether the storage container exists
// so the native-TypeScript caller knows whether to run the (already-ported) bucket
// seeding. Any inspect error is treated as "storage not running" → false, matching
// Go's `err == nil` gate, which silently skips buckets on any inspect failure.
func AwaitStorageReady(ctx context.Context) (bool, error) {
resp, err := utils.Docker.ContainerInspect(ctx, utils.StorageId)
if err != nil {
return false, nil
}
if resp.State.Health == nil || resp.State.Health.Status != types.Healthy {
if err := start.WaitForHealthyService(ctx, 30*time.Second, utils.StorageId); err != nil {
return false, err
}
}
return true, nil
}

func resetDatabase14(ctx context.Context, version string, fsys afero.Fs, options ...func(*pgx.ConnConfig)) error {
if err := recreateDatabase(ctx, options...); err != nil {
return err
Expand Down
9 changes: 6 additions & 3 deletions apps/cli-go/pkg/migration/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,12 @@ func trimLeadingSQLComments(sql string) string {
}
}

// ExecBatch is also reached from the shipped supabase-go sidecar: local `db
// start` / `db reset` delegate migration apply to the `db __db-bootstrap`
// seam (apps/cli-go/cmd/db.go), which calls this via apply.MigrateAndSeed.
// ExecBatch is also reached from the shipped supabase-go sidecar via the
// remaining Go-delegated paths (e.g. remote `db push`/`db reset`'s
// apply.MigrateAndSeed) — local `db start`/`db reset` no longer delegate here
// at all: CLI-1954/CLI-1955 removed the hidden `db __db-bootstrap` seam
// (apps/cli-go/cmd/db.go) this comment used to describe, in favor of a fully
// native TypeScript container-bootstrap port.
func (m *MigrationFile) ExecBatch(ctx context.Context, conn *pgx.Conn) error {
batch := &pgconn.Batch{}
batchSize := 0
Expand Down
2 changes: 1 addition & 1 deletion apps/cli/docs/binary-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ This:

### Removed commands

`apps/cli-go/internal/start` (Go's `supabase start` implementation) was deleted outright (CLI-1966), not just excluded from the shipped binary. Native TS `start` talks to Docker directly and never proxies to Go for it, and no other still-live TS→Go delegation seam (`db test`, `db branch`/`db remote`, `db diff --use-pgadmin`/`--use-pg-schema`, `db pull --experimental`, the hidden `db __db-bootstrap`/`__shadow`/`__catalog` seams, etc.) ever called into `internal/start` either — a repo-wide `grep` for the import confirmed the only reference anywhere in `apps/cli-go` was `start`'s own cobra registration. `internal/start` alone previously accounted for roughly half the shipped Go binary's size via its exclusive dependency tree (docker-compose/v2, buildx, buildkit, k8s client-go, aws-sdk-go-v2, notary, secret-detector), which `go mod tidy` dropped entirely once the package was deleted. `cmd/start.go` keeps `start`'s cobra registration and flag surface (needed by the `__complete` passthrough) but its `RunE` is a permanent stub returning a "not available in supabase-go" error — see `apps/cli-go/cmd/start_test.go` for the pinned error text. There is no longer a `bundled` build tag: with no second implementation to select between, the Go CLI's `cmd` package has only one `start`.
`apps/cli-go/internal/start` (Go's `supabase start` implementation) was deleted outright (CLI-1966), not just excluded from the shipped binary. Native TS `start` talks to Docker directly and never proxies to Go for it, and no other still-live TS→Go delegation seam (`db test`, `db branch`/`db remote`, `db diff --use-pgadmin`/`--use-pg-schema`, `db pull --experimental`, the hidden `db __shadow`/`__catalog` seams — the sibling hidden `db __db-bootstrap` seam was removed outright by CLI-1955, once native `db reset --local` became its last remaining caller — etc.) ever called into `internal/start` either — a repo-wide `grep` for the import confirmed the only reference anywhere in `apps/cli-go` was `start`'s own cobra registration. `internal/start` alone previously accounted for roughly half the shipped Go binary's size via its exclusive dependency tree (docker-compose/v2, buildx, buildkit, k8s client-go, aws-sdk-go-v2, notary, secret-detector), which `go mod tidy` dropped entirely once the package was deleted. `cmd/start.go` keeps `start`'s cobra registration and flag surface (needed by the `__complete` passthrough) but its `RunE` is a permanent stub returning a "not available in supabase-go" error — see `apps/cli-go/cmd/start_test.go` for the pinned error text. There is no longer a `bundled` build tag: with no second implementation to select between, the Go CLI's `cmd` package has only one `start`.

## See Also

Expand Down
Loading
Loading