Skip to content

Commit 39bf0e7

Browse files
authored
fix(cli): enable vector buckets by default (#5421)
## Summary Enable local storage vector bucket support by default in generated CLI config. This makes fresh and missing `storage.vector.enabled` config paths opt in to vector buckets automatically, while still allowing users to explicitly disable the feature with `enabled = false`. The local start happy path now expects the default vector bucket seed call so the test coverage matches the new behavior.
1 parent 8680362 commit 39bf0e7

4 files changed

Lines changed: 38 additions & 1 deletion

File tree

apps/cli-e2e/fixtures/scenarios/seed-buckets-creates-buckets-defined-in-config/interactions.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,37 @@
6262
"name": "my-bucket"
6363
}
6464
}
65+
},
66+
{
67+
"request": {
68+
"method": "POST",
69+
"path": "/storage/v1/vector/ListVectorBuckets",
70+
"query": {},
71+
"headers": {
72+
"accept-encoding": "gzip",
73+
"apikey": "__JWT__",
74+
"authorization": "Bearer __ACCESS_TOKEN__",
75+
"content-length": "3",
76+
"content-type": "application/json",
77+
"host": "localhost:__PORT__",
78+
"user-agent": "SupabaseCLI/"
79+
},
80+
"body": {}
81+
},
82+
"response": {
83+
"status": 200,
84+
"headers": {
85+
"access-control-allow-origin": "*",
86+
"content-type": "application/json; charset=utf-8",
87+
"sb-gateway-mode": "direct",
88+
"sb-gateway-version": "1",
89+
"sb-project-ref": "__PROJECT_REF__",
90+
"sb-request-id": "__UUID__",
91+
"x-content-type-options": "nosniff"
92+
},
93+
"body": {
94+
"vectorBuckets": []
95+
}
96+
}
6597
}
6698
]

apps/cli-go/internal/start/start_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ func TestDatabaseStart(t *testing.T) {
241241
Get("/storage/v1/bucket").
242242
Reply(http.StatusOK).
243243
JSON([]storage.BucketResponse{})
244+
gock.New(utils.Config.Api.ExternalUrl).
245+
Post("/storage/v1/vector/ListVectorBuckets").
246+
Reply(http.StatusOK).
247+
JSON(storage.ListVectorBucketsResponse{})
244248
// Run test
245249
err = run(ctx, fsys, []string{}, pgconn.Config{Host: utils.DbId}, conn.Intercept)
246250
// Check error

apps/cli-go/pkg/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func TestConfigParsing(t *testing.T) {
3737
err := config.Load("", fs.MapFS{})
3838
// Check error
3939
assert.NoError(t, err)
40+
assert.True(t, config.Storage.VectorBuckets.Enabled)
4041
})
4142

4243
t.Run("auth external url defaults from api external url", func(t *testing.T) {

apps/cli-go/pkg/config/templates/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ max_catalogs = 2
145145

146146
# Store vector embeddings in S3 for large and durable datasets
147147
[storage.vector]
148-
enabled = false
148+
enabled = true
149149
max_buckets = 10
150150
max_indexes = 5
151151

0 commit comments

Comments
 (0)