From 2f607250b4aa1b496652f140387319bc7a989261 Mon Sep 17 00:00:00 2001 From: Matias Melograno Date: Wed, 6 Dec 2023 10:54:16 -0300 Subject: [PATCH] fixed naming for FlagSetsFilter --- CHANGES.txt | 3 +++ splitio/client/client_test.go | 2 +- splitio/client/factory.go | 12 ++++++------ splitio/client/input_validator_test.go | 4 ++-- splitio/conf/sdkconf.go | 2 +- splitio/conf/util.go | 2 +- splitio/version.go | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 4892d42..1000d52 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +6.5.1 (Dec 6, 2023) +- Fixed FlagSetsFilter naming in Advanced config. + 6.5.0 (Nov 29, 2023) - Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation): - Added new variations of the get treatment methods to support evaluating flags in given flag set/s. diff --git a/splitio/client/client_test.go b/splitio/client/client_test.go index 46c9231..2105f5d 100644 --- a/splitio/client/client_test.go +++ b/splitio/client/client_test.go @@ -160,7 +160,7 @@ func getFactoryByFlagSets() SplitFactory { telemetryStorage, _ := inmemory.NewTelemetryStorage() cfg := conf.Default() cfg.LabelsEnabled = true - cfg.Advanced.FlagSetFilter = []string{"set1", "set2"} + cfg.Advanced.FlagSetsFilter = []string{"set1", "set2"} logger := logging.NewLogger(nil) impressionObserver, _ := strategy.NewImpressionObserver(500) diff --git a/splitio/client/factory.go b/splitio/client/factory.go index c387446..4efe994 100644 --- a/splitio/client/factory.go +++ b/splitio/client/factory.go @@ -173,7 +173,7 @@ func (f *SplitFactory) recordInitTelemetry(tags []string, currentFactories map[s TaskPeriods: config.TaskPeriods(f.cfg.TaskPeriods), ImpressionsMode: f.cfg.ImpressionsMode, ListenerEnabled: f.cfg.Advanced.ImpressionListener != nil, - FlagSetsTotal: int64(len(f.cfg.Advanced.FlagSetFilter)), + FlagSetsTotal: int64(len(f.cfg.Advanced.FlagSetsFilter)), FlagSetsInvalid: flagSetsInvalid, }, time.Now().UTC().Sub(f.startTime).Milliseconds(), @@ -288,7 +288,7 @@ func setupInMemoryFactory( ) (*SplitFactory, error) { advanced, warnings := conf.NormalizeSDKConf(cfg.Advanced) printWarnings(logger, warnings) - flagSetsInvalid := int64(len(cfg.Advanced.FlagSetFilter) - len(advanced.FlagSetsFilter)) + flagSetsInvalid := int64(len(cfg.Advanced.FlagSetsFilter) - len(advanced.FlagSetsFilter)) if strings.TrimSpace(cfg.SplitSyncProxyURL) != "" { advanced.StreamingEnabled = false } @@ -404,8 +404,8 @@ func setupRedisFactory(apikey string, cfg *conf.SplitSdkConfig, logger logging.L inMememoryFullQueue := make(chan string, 2) // Size 2: So that it's able to accept one event from each resource simultaneously. impressionStorage := redis.NewImpressionStorage(redisClient, metadata, logger) - if len(cfg.Advanced.FlagSetFilter) != 0 { - cfg.Advanced.FlagSetFilter = []string{} + if len(cfg.Advanced.FlagSetsFilter) != 0 { + cfg.Advanced.FlagSetsFilter = []string{} logger.Warning("FlagSets filter is not applicable for Consumer modes where the SDK does not keep rollout data in sync. FlagSet filter was discarded") } flagSetFilter := flagsets.NewFlagSetFilter([]string{}) @@ -472,8 +472,8 @@ func setupLocalhostFactory( logger logging.LoggerInterface, metadata dtos.Metadata, ) (*SplitFactory, error) { - flagSets, errs := flagsets.SanitizeMany(cfg.Advanced.FlagSetFilter) - flagSetsInvalid := int64(len(cfg.Advanced.FlagSetFilter) - len(flagSets)) + flagSets, errs := flagsets.SanitizeMany(cfg.Advanced.FlagSetsFilter) + flagSetsInvalid := int64(len(cfg.Advanced.FlagSetsFilter) - len(flagSets)) printWarnings(logger, errs) flagSetFilter := flagsets.NewFlagSetFilter(flagSets) splitStorage := mutexmap.NewMMSplitStorage(flagSetFilter) diff --git a/splitio/client/input_validator_test.go b/splitio/client/input_validator_test.go index 3a47f7d..5277a6f 100644 --- a/splitio/client/input_validator_test.go +++ b/splitio/client/input_validator_test.go @@ -598,7 +598,7 @@ func TestInMemoryFactoryFlagSets(t *testing.T) { cfg.TaskPeriods.ImpressionSync = 60 cfg.TaskPeriods.EventsSync = 60 cfg.Advanced.StreamingEnabled = false - cfg.Advanced.FlagSetFilter = []string{"a", "_b", "a", "a", "c", "d", "_d"} + cfg.Advanced.FlagSetsFilter = []string{"a", "_b", "a", "a", "c", "d", "_d"} factory, _ := NewSplitFactory("test", cfg) client := factory.Client() @@ -625,7 +625,7 @@ func TestConsumerFactoryFlagSets(t *testing.T) { logger := getMockedLogger() sdkConf := conf.Default() sdkConf.OperationMode = conf.RedisConsumer - sdkConf.Advanced.FlagSetFilter = []string{"a", "b"} + sdkConf.Advanced.FlagSetsFilter = []string{"a", "b"} sdkConf.Logger = logger factory, _ := NewSplitFactory("something", sdkConf) diff --git a/splitio/conf/sdkconf.go b/splitio/conf/sdkconf.go index 1f3ab62..f7d8dcb 100644 --- a/splitio/conf/sdkconf.go +++ b/splitio/conf/sdkconf.go @@ -94,7 +94,7 @@ type AdvancedConfig struct { ImpressionsQueueSize int ImpressionsBulkSize int64 StreamingEnabled bool - FlagSetFilter []string + FlagSetsFilter []string } // Default returns a config struct with all the default values diff --git a/splitio/conf/util.go b/splitio/conf/util.go index 378d4e9..2fdf5dd 100644 --- a/splitio/conf/util.go +++ b/splitio/conf/util.go @@ -48,7 +48,7 @@ func NormalizeSDKConf(sdkConfig AdvancedConfig) (conf.AdvancedConfig, []error) { } config.StreamingEnabled = sdkConfig.StreamingEnabled - flagSets, errs := flagsets.SanitizeMany(sdkConfig.FlagSetFilter) + flagSets, errs := flagsets.SanitizeMany(sdkConfig.FlagSetsFilter) config.FlagSetsFilter = flagSets return config, errs } diff --git a/splitio/version.go b/splitio/version.go index 65db916..a0a8eec 100644 --- a/splitio/version.go +++ b/splitio/version.go @@ -1,4 +1,4 @@ package splitio // Version contains a string with the split sdk version -const Version = "6.5.0" +const Version = "6.5.1-rc1"