Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
- uses: golangci/golangci-lint-action@v9
with:
args: --timeout 3m --verbose
version: latest

start:
name: Start
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/supabase/cli

go 1.24.10
go 1.25.5

require (
github.com/BurntSushi/toml v1.6.0
Expand Down Expand Up @@ -28,7 +28,7 @@ require (
github.com/go-xmlfmt/xmlfmt v1.1.3
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/google/go-github/v62 v62.0.0
github.com/google/go-querystring v1.1.0
github.com/google/go-querystring v1.2.0
github.com/google/uuid v1.6.0
github.com/h2non/gock v1.2.0
github.com/jackc/pgconn v1.14.3
Expand All @@ -46,7 +46,7 @@ require (
github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1
github.com/stripe/pg-schema-diff v1.0.2
github.com/stripe/pg-schema-diff v1.0.3
github.com/supabase/cli/pkg v1.0.0
github.com/tidwall/jsonc v0.3.2
github.com/withfig/autocomplete-tools/packages/cobra v1.2.0
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,13 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4=
github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=
github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
Expand Down Expand Up @@ -1048,8 +1049,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/stripe/pg-schema-diff v1.0.2 h1:1R4ZQb7mHvOc9BGw1xYrddqb2voL8ICyiUYSoAmTAFo=
github.com/stripe/pg-schema-diff v1.0.2/go.mod h1:LlN2VVP/njIq1Y7o6Nt35ItEyr6OWOCEz6+Jc/axbIY=
github.com/stripe/pg-schema-diff v1.0.3 h1:1fR6fIXrWKK7GJSb+nLgoUrex/Htnr/ZohVR/+alMAc=
github.com/stripe/pg-schema-diff v1.0.3/go.mod h1:3IctPaAqm+0LtWw/GiwyRoRlU1/N/+00+eXVk0KZIHs=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/tdakkota/asciicheck v0.4.1 h1:bm0tbcmi0jezRA2b5kg4ozmMuGAFotKI3RZfrhfovg8=
Expand Down
45 changes: 33 additions & 12 deletions internal/start/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,27 +257,48 @@ func TestDatabaseStart(t *testing.T) {

func TestFormatMapForEnvConfig(t *testing.T) {
t.Run("It produces the correct format and removes the trailing comma", func(t *testing.T) {
testcases := []struct {
key string
value string
expected string
}{
{
key: "123456",
value: "123456",
expected: `^\w{6}:\w{6}$`,
},
{
key: "234567",
value: "234567",
expected: `^\w{6}:\w{6},\w{6}:\w{6}$`,
},
{
key: "345678",
value: "345678",
expected: `^\w{6}:\w{6},\w{6}:\w{6},\w{6}:\w{6}$`,
},
{
key: "456789",
value: "456789",
expected: `^\w{6}:\w{6},\w{6}:\w{6},\w{6}:\w{6},\w{6}:\w{6}$`,
},
}

output := bytes.Buffer{}
input := map[string]string{}

keys := [4]string{"123456", "234567", "345678", "456789"}
values := [4]string{"123456", "234567", "345678", "456789"}
expected := [4]string{
`^\w{6}:\w{6}$`,
`^\w{6}:\w{6},\w{6}:\w{6}$`,
`^\w{6}:\w{6},\w{6}:\w{6},\w{6}:\w{6}$`,
`^\w{6}:\w{6},\w{6}:\w{6},\w{6}:\w{6},\w{6}:\w{6}$`,
}
formatMapForEnvConfig(input, &output)
if len(output.Bytes()) > 0 {
t.Error("No values should be expected when empty map is provided")
}
for i := range 4 {

for _, c := range testcases {
output.Reset()
input[keys[i]] = values[i]
input[c.key] = c.value
formatMapForEnvConfig(input, &output)
result := output.String()
assert.Regexp(t, regexp.MustCompile(expected[i]), result)
r, err := regexp.Compile(c.expected)
require.NoError(t, err)
assert.Regexp(t, r, result)
}
})
}