Skip to content

Commit 56c2cc4

Browse files
authored
fix(config): default value for seed remote (#2797)
1 parent aaa0d7f commit 56c2cc4

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

pkg/config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,8 @@ func (c *config) Load(path string, fsys fs.FS) error {
697697
c.Remotes = make(map[string]baseConfig, len(c.Overrides))
698698
for name, remote := range c.Overrides {
699699
base := c.baseConfig.Clone()
700+
// On remotes branches set seed as disabled by default
701+
base.Db.Seed.Enabled = false
700702
// Encode a toml file with only config overrides
701703
var buf bytes.Buffer
702704
if err := toml.NewEncoder(&buf).Encode(remote); err != nil {

pkg/config/config_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ func TestConfigParsing(t *testing.T) {
9393
assert.Equal(t, false, production.Auth.EnableSignup)
9494
assert.Equal(t, false, production.Auth.External["azure"].Enabled)
9595
assert.Equal(t, "nope", production.Auth.External["azure"].ClientId)
96+
// Check seed should be disabled by default for remote configs
97+
assert.Equal(t, false, production.Db.Seed.Enabled)
9698
// Check the values for the staging override
9799
assert.Equal(t, "staging-project", staging.ProjectId)
98100
assert.Equal(t, []string{"image/png"}, staging.Storage.Buckets["images"].AllowedMimeTypes)
101+
assert.Equal(t, true, staging.Db.Seed.Enabled)
99102
})
100103
}
101104

pkg/config/testdata/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,5 +237,8 @@ client_id = "nope"
237237
[remotes.staging]
238238
project_id = "staging-project"
239239

240+
[remotes.staging.db.seed]
241+
enabled = true
242+
240243
[remotes.staging.storage.buckets.images]
241244
allowed_mime_types = ["image/png"]

0 commit comments

Comments
 (0)