Skip to content

Commit

Permalink
fixed naming for FlagSetsFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
mmelograno committed Dec 6, 2023
1 parent 54179a8 commit 2f60725
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion splitio/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions splitio/client/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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{})
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions splitio/client/input_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion splitio/conf/sdkconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion splitio/conf/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion splitio/version.go
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 2f60725

Please sign in to comment.