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
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ func (c *config) Load(path string, fsys fs.FS) error {
c.Remotes = make(map[string]baseConfig, len(c.Overrides))
for name, remote := range c.Overrides {
base := c.baseConfig.Clone()
// On remotes branches set seed as disabled by default
base.Db.Seed.Enabled = false
// Encode a toml file with only config overrides
var buf bytes.Buffer
if err := toml.NewEncoder(&buf).Encode(remote); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ func TestConfigParsing(t *testing.T) {
assert.Equal(t, false, production.Auth.EnableSignup)
assert.Equal(t, false, production.Auth.External["azure"].Enabled)
assert.Equal(t, "nope", production.Auth.External["azure"].ClientId)
// Check seed should be disabled by default for remote configs
assert.Equal(t, false, production.Db.Seed.Enabled)
// Check the values for the staging override
assert.Equal(t, "staging-project", staging.ProjectId)
assert.Equal(t, []string{"image/png"}, staging.Storage.Buckets["images"].AllowedMimeTypes)
assert.Equal(t, true, staging.Db.Seed.Enabled)
})
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/config/testdata/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,8 @@ client_id = "nope"
[remotes.staging]
project_id = "staging-project"

[remotes.staging.db.seed]
enabled = true

[remotes.staging.storage.buckets.images]
allowed_mime_types = ["image/png"]