Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cfd7f06
chore(deps): bump github.com/golangci/golangci-lint/v2 from 2.1.2 to …
dependabot[bot] Apr 25, 2025
fc12a40
chore(deps): bump supabase/postgres from 17.4.1.019 to 17.4.1.020 in …
dependabot[bot] Apr 25, 2025
58ad868
fix: reuse flags for native bundler (#3485)
sweatybridge Apr 25, 2025
d745c72
fix: skip storage version when linking (#3488)
sweatybridge Apr 25, 2025
27ca207
fix: retry on error listing functions (#3490)
sweatybridge Apr 27, 2025
bd05f59
fix: retry bulk update endpoint on error (#3492)
sweatybridge Apr 27, 2025
aea419c
chore(deps): bump supabase/studio from 2025.04.21-sha-173cc56 to 2025…
dependabot[bot] Apr 28, 2025
1b59e5c
chore(deps): bump supabase/postgres from 17.4.1.020 to 17.4.1.021 in …
dependabot[bot] Apr 28, 2025
5f46c77
chore(deps): bump supabase/storage-api from v1.22.7 to v1.22.8 in /pk…
dependabot[bot] Apr 29, 2025
730c0c5
chore(deps): bump supabase/postgres from 17.4.1.021 to 17.4.1.022 in …
dependabot[bot] Apr 29, 2025
dc8dddb
fix: use correct env var name to pass auth jwks to storage container …
itslenny Apr 29, 2025
cb77a67
chore(deps): bump supabase/storage-api from v1.22.8 to v1.22.9 in /pk…
dependabot[bot] Apr 30, 2025
fdf8706
chore(deps): bump supabase/storage-api from v1.22.9 to v1.22.11 in /p…
dependabot[bot] May 1, 2025
1e43131
chore(deps): bump supabase/postgres from 17.4.1.022 to 17.4.1.026 in …
dependabot[bot] May 2, 2025
0bfa100
chore(deps): bump postgrest/postgrest from v12.2.11 to v12.2.12 in /p…
dependabot[bot] May 2, 2025
a2da527
chore(deps): bump golangci/golangci-lint-action from 7 to 8 (#3515)
dependabot[bot] May 5, 2025
0b28307
chore(deps): bump supabase/studio from 2025.04.28-sha-dd03625 to 2025…
dependabot[bot] May 5, 2025
0759b2f
chore(deps): bump supabase/postgres from 17.4.1.026 to 17.4.1.027 in …
dependabot[bot] May 5, 2025
776e47a
chore: remove keyring mock (#3517)
sweatybridge May 5, 2025
5d1fa9c
chore(deps): bump github.com/golangci/golangci-lint/v2 from 2.1.5 to …
dependabot[bot] May 5, 2025
679f873
chore: add some utils tests (#3514)
egor-romanov May 5, 2025
032c2cb
fix: remove deprecated remote changes and commit (#3520)
sweatybridge May 5, 2025
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
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
# Required by: internal/utils/credentials/keyring_test.go
- uses: t1m0thyj/unlock-keyring@v1
- run: |
go run gotest.tools/gotestsum -- -race -v -count=1 -coverprofile=coverage.out \
`go list ./... | grep -Ev 'cmd|docs|examples|pkg/api|tools'`
pkgs=$(go list ./pkg/... | grep -Ev 'pkg/api' | paste -sd ',' -)
go run gotest.tools/gotestsum -- -race -v -count=1 ./... \
-coverpkg="./cmd/...,./internal/...,${pkgs}" -coverprofile=coverage.out

- uses: coverallsapp/github-action@v2
with:
Expand All @@ -41,7 +42,7 @@ jobs:
# Linter requires no cache
cache: false

- uses: golangci/golangci-lint-action@v7
- uses: golangci/golangci-lint-action@v8
with:
args: --timeout 3m --verbose

Expand Down
10 changes: 5 additions & 5 deletions cmd/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"github.com/supabase/cli/internal/db/lint"
"github.com/supabase/cli/internal/db/pull"
"github.com/supabase/cli/internal/db/push"
"github.com/supabase/cli/internal/db/remote/changes"
"github.com/supabase/cli/internal/db/remote/commit"
"github.com/supabase/cli/internal/db/reset"
"github.com/supabase/cli/internal/db/start"
"github.com/supabase/cli/internal/db/test"
Expand Down Expand Up @@ -175,7 +173,7 @@ var (
Short: "Show changes on the remote database",
Long: "Show changes on the remote database since last migration.",
RunE: func(cmd *cobra.Command, args []string) error {
return changes.Run(cmd.Context(), schema, flags.DbConfig, afero.NewOsFs())
return diff.Run(cmd.Context(), schema, file, flags.DbConfig, diff.DiffSchemaMigra, afero.NewOsFs())
},
}

Expand All @@ -184,7 +182,7 @@ var (
Use: "commit",
Short: "Commit remote changes as a new migration",
RunE: func(cmd *cobra.Command, args []string) error {
return commit.Run(cmd.Context(), schema, flags.DbConfig, afero.NewOsFs())
return pull.Run(cmd.Context(), schema, flags.DbConfig, "remote_commit", afero.NewOsFs())
},
}

Expand Down Expand Up @@ -304,10 +302,12 @@ func init() {
dbCmd.AddCommand(dbPullCmd)
// Build remote command
remoteFlags := dbRemoteCmd.PersistentFlags()
remoteFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.")
remoteFlags.String("db-url", "", "Connect using the specified Postgres URL (must be percent-encoded).")
remoteFlags.Bool("linked", true, "Connect to the linked project.")
dbRemoteCmd.MarkFlagsMutuallyExclusive("db-url", "linked")
remoteFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", remoteFlags.Lookup("password")))
remoteFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.")
dbRemoteCmd.AddCommand(dbRemoteChangesCmd)
dbRemoteCmd.AddCommand(dbRemoteCommitCmd)
dbCmd.AddCommand(dbRemoteCmd)
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/go-viper/mapstructure/v2 v2.2.1
github.com/go-xmlfmt/xmlfmt v1.1.3
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/golangci/golangci-lint/v2 v2.1.2
github.com/golangci/golangci-lint/v2 v2.1.6
github.com/google/go-github/v62 v62.0.0
github.com/google/go-querystring v1.1.0
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -68,14 +68,13 @@ require (
github.com/Antonboom/nilnil v1.1.0 // indirect
github.com/Antonboom/testifylint v1.6.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Crocmagnon/fatcontext v0.7.2 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect
github.com/Masterminds/semver/v3 v3.3.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
github.com/ProtonMail/go-crypto v1.1.6 // indirect
github.com/alecthomas/chroma/v2 v2.16.0 // indirect
github.com/alecthomas/chroma/v2 v2.17.2 // indirect
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
github.com/alexkohler/nakedret/v2 v2.0.6 // indirect
github.com/alexkohler/prealloc v1.0.0 // indirect
Expand Down Expand Up @@ -281,7 +280,7 @@ require (
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tdakkota/asciicheck v0.4.1 // indirect
github.com/tetafro/godot v1.5.0 // indirect
github.com/tetafro/godot v1.5.1 // indirect
github.com/theupdateframework/notary v0.7.0 // indirect
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect
github.com/timonwong/loggercheck v0.11.0 // indirect
Expand All @@ -304,8 +303,9 @@ require (
github.com/yuin/goldmark v1.7.8 // indirect
github.com/yuin/goldmark-emoji v1.0.5 // indirect
gitlab.com/bosi/decorder v0.4.2 // indirect
go-simpler.org/musttag v0.13.0 // indirect
go-simpler.org/musttag v0.13.1 // indirect
go-simpler.org/sloglint v0.11.0 // indirect
go.augendre.info/fatcontext v0.8.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Crocmagnon/fatcontext v0.7.2 h1:BY5/dUhs2kuD3sDn7vZrgOneRib5EHk9GOiyK8Vg+14=
github.com/Crocmagnon/fatcontext v0.7.2/go.mod h1:OAZCUteH59eiddbJZ9/bF4ppC140jYD/hepU2FDkFk4=
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM=
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 h1:Sz1JIXEcSfhz7fUi7xHnhpIE0thVASYjvosApmHuD2k=
Expand All @@ -77,8 +75,8 @@ github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMz
github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=
github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/chroma/v2 v2.16.0 h1:QC5ZMizk67+HzxFDjQ4ASjni5kWBTGiigRG1u23IGvA=
github.com/alecthomas/chroma/v2 v2.16.0/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk=
github.com/alecthomas/chroma/v2 v2.17.2 h1:Rm81SCZ2mPoH+Q8ZCc/9YvzPUN/E7HgPiPJD8SLV6GI=
github.com/alecthomas/chroma/v2 v2.17.2/go.mod h1:RVX6AvYm4VfYe/zsk7mjHueLDZor3aWCNE14TFlepBk=
github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU=
github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
Expand Down Expand Up @@ -416,8 +414,8 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP
github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s=
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d h1:viFft9sS/dxoYY0aiOTsLKO2aZQAPT4nlQCsimGcSGE=
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d/go.mod h1:ivJ9QDg0XucIkmwhzCDsqcnxxlDStoTl89jDMIoNxKY=
github.com/golangci/golangci-lint/v2 v2.1.2 h1:bcOB+jVr4EYEgOEIskQIhtdxOpIGl+iOCwliG/hNPXw=
github.com/golangci/golangci-lint/v2 v2.1.2/go.mod h1:ApmXnYUmWDGu1CUZRkT3yzzFATmaViCY7BEtytG2AiU=
github.com/golangci/golangci-lint/v2 v2.1.6 h1:LXqShFfAGM5BDzEOWD2SL1IzJAgUOqES/HRBsfKjI+w=
github.com/golangci/golangci-lint/v2 v2.1.6/go.mod h1:EPj+fgv4TeeBq3TcqaKZb3vkiV5dP4hHHKhXhEhzci8=
github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 h1:AkK+w9FZBXlU/xUmBtSJN1+tAI4FIvy5WtnUnY8e4p8=
github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95/go.mod h1:k9mmcyWKSTMcPPvQUCfRWWQ9VHJ1U9Dc0R7kaXAgtnQ=
github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs=
Expand Down Expand Up @@ -951,8 +949,8 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA
github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0=
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag=
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY=
github.com/tetafro/godot v1.5.0 h1:aNwfVI4I3+gdxjMgYPus9eHmoBeJIbnajOyqZYStzuw=
github.com/tetafro/godot v1.5.0/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio=
github.com/tetafro/godot v1.5.1 h1:PZnjCol4+FqaEzvZg5+O8IY2P3hfY9JzRBNPv1pEDS4=
github.com/tetafro/godot v1.5.1/go.mod h1:cCdPtEndkmqqrhiCfkmxDodMQJ/f3L1BCNskCUZdTwk=
github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c=
github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw=
github.com/tidwall/jsonc v0.3.2 h1:ZTKrmejRlAJYdn0kcaFqRAKlxxFIC21pYq8vLa4p2Wc=
Expand Down Expand Up @@ -1018,10 +1016,12 @@ gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo=
gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8=
go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ=
go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28=
go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE=
go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM=
go-simpler.org/musttag v0.13.1 h1:lw2sJyu7S1X8lc8zWUAdH42y+afdcCnHhWpnkWvd6vU=
go-simpler.org/musttag v0.13.1/go.mod h1:8r450ehpMLQgvpb6sg+hV5Ur47eH6olp/3yEanfG97k=
go-simpler.org/sloglint v0.11.0 h1:JlR1X4jkbeaffiyjLtymeqmGDKBDO1ikC6rjiuFAOco=
go-simpler.org/sloglint v0.11.0/go.mod h1:CFDO8R1i77dlciGfPEPvYke2ZMx4eyGiEIWkyeW2Pvw=
go.augendre.info/fatcontext v0.8.0 h1:2dfk6CQbDGeu1YocF59Za5Pia7ULeAM6friJ3LP7lmk=
go.augendre.info/fatcontext v0.8.0/go.mod h1:oVJfMgwngMsHO+KB2MdgzcO+RvtNdiCEOlWvSFtax/s=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
Expand Down
47 changes: 0 additions & 47 deletions internal/db/remote/changes/changes.go

This file was deleted.

106 changes: 0 additions & 106 deletions internal/db/remote/commit/commit.go

This file was deleted.

3 changes: 2 additions & 1 deletion internal/functions/deploy/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap
}
hostOutputPath := filepath.Join(hostOutputDir, "output.eszip")
// Create exec command
cmd := []string{"bundle", "--entrypoint", utils.ToDockerPath(entrypoint), "--output", utils.ToDockerPath(hostOutputPath), "--decorator", "tc39"}
cmd := []string{"bundle", "--entrypoint", utils.ToDockerPath(entrypoint), "--output", utils.ToDockerPath(hostOutputPath)}
if len(importMap) > 0 {
cmd = append(cmd, "--import-map", utils.ToDockerPath(importMap))
}
Expand All @@ -60,6 +60,7 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap
if viper.GetBool("DEBUG") {
cmd = append(cmd, "--verbose")
}
cmd = append(cmd, function.BundleFlags...)

env := []string{}
if custom_registry := os.Getenv("NPM_CONFIG_REGISTRY"); custom_registry != "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/logout/logout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestLogoutCommand(t *testing.T) {
})

t.Run("removes all Supabase CLI credentials", func(t *testing.T) {
t.Cleanup(credentials.MockInit())
keyring.MockInit()
require.NoError(t, credentials.StoreProvider.Set(utils.AccessTokenKey, token))
require.NoError(t, credentials.StoreProvider.Set("project1", "password1"))
require.NoError(t, credentials.StoreProvider.Set("project2", "password2"))
Expand Down
8 changes: 1 addition & 7 deletions internal/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func listRemoteImages(ctx context.Context, projectRef string) map[string]string
return linked
}
api := tenant.NewTenantAPI(ctx, projectRef, keys.Anon)
wg.Add(3)
wg.Add(2)
go func() {
defer wg.Done()
if version, err := api.GetGotrueVersion(ctx); err == nil {
Expand All @@ -93,12 +93,6 @@ func listRemoteImages(ctx context.Context, projectRef string) map[string]string
linked[utils.Config.Api.Image] = version
}
}()
go func() {
defer wg.Done()
if version, err := api.GetStorageVersion(ctx); err == nil {
linked[utils.Config.Storage.Image] = version
}
}()
wg.Wait()
return linked
}
Expand Down
2 changes: 1 addition & 1 deletion internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ EOF
"ANON_KEY=" + utils.Config.Auth.AnonKey.Value,
"SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value,
"AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value,
fmt.Sprintf("AUTH_JWT_JWKS=%s", jwks),
fmt.Sprintf("JWT_JWKS=%s", jwks),
fmt.Sprintf("DATABASE_URL=postgresql://supabase_storage_admin:%s@%s:%d/%s", dbConfig.Password, dbConfig.Host, dbConfig.Port, dbConfig.Database),
fmt.Sprintf("FILE_SIZE_LIMIT=%v", utils.Config.Storage.FileSizeLimit),
"STORAGE_BACKEND=file",
Expand Down
Loading