MM-28859 Add feature flag managment system using split.io and remove viper. (#15954)

* Add feature flag managment system using split.io and remove viper.

* Fixing tests.

* Attempt to fix postgres tests.

* Fix watch filepath for advanced logging.

* Review fixes.

* Some error wrapping.

* Remove unessisary store interface.

* Desanitize SplitKey

* Simplify.

* Review feedback.

* Rename split mlog adatper to split logger.

* fsInner

* Style.

* Restore oldcfg test.

* Downgrading non-actionable feature flag errors to warnings.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Christopher Speller
2020-10-29 15:54:39 -07:00
коммит произвёл GitHub
родитель 8bb772638c
Коммит 1aadd36644
423 изменённых файлов: 37646 добавлений и 20257 удалений

Просмотреть файл

@@ -347,7 +347,10 @@ type ServiceSettings struct {
EnableLocalMode *bool
LocalModeSocketLocation *string
EnableAWSMetering *bool
ThreadAutoFollow *bool `access:"experimental"`
SplitKey *string `access:"environment,write_restrictable"`
FeatureFlagSyncIntervalSeconds *int `access:"environment,write_restrictable"`
DebugSplit *bool `access:"environment,write_restrictable"`
ThreadAutoFollow *bool `access:"experimental"`
}
func (s *ServiceSettings) SetDefaults(isUpdate bool) {
@@ -766,10 +769,21 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
s.EnableAWSMetering = NewBool(false)
}
if s.SplitKey == nil {
s.SplitKey = NewString("")
}
if s.FeatureFlagSyncIntervalSeconds == nil {
s.FeatureFlagSyncIntervalSeconds = NewInt(30)
}
if s.DebugSplit == nil {
s.DebugSplit = NewBool(false)
}
if s.ThreadAutoFollow == nil {
s.ThreadAutoFollow = NewBool(true)
}
}
type ClusterSettings struct {
@@ -3637,6 +3651,8 @@ func (o *Config) Sanitize() {
if o.ServiceSettings.GfycatApiSecret != nil && len(*o.ServiceSettings.GfycatApiSecret) > 0 {
*o.ServiceSettings.GfycatApiSecret = FAKE_SETTING
}
*o.ServiceSettings.SplitKey = FAKE_SETTING
}
// structToMapFilteredByTag converts a struct into a map removing those fields that has the tag passed