Skip to content

Commit 5213955

Browse files
authored
Merge pull request #485 from splitio/flagset-config-fix
Flagset config fix
2 parents 84b5f57 + 55f39a0 commit 5213955

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

CHANGES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
9.6.1 (Nov 3, 2023)
2+
- 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):
3+
- Added new variations of the get treatment methods to support evaluating flags in given flag set/s.
4+
- get_treatments_by_flag_set and get_treatments_by_flag_sets
5+
- get_treatments_with_config_by_flag_set and get_treatments_with_config_by_flag_sets
6+
- Added a new optional Split Filter configuration option. This allows the SDK and Split services to only synchronize the flags in the specified flag sets, avoiding unused or unwanted flags from being synced on the SDK instance, bringing all the benefits from a reduced payload.
7+
- Note: Only applicable when the SDK is in charge of the rollout data synchronization. When not applicable, the SDK will log a warning on init.
8+
- Updated the following SDK manager methods to expose flag sets on flag views.
9+
- Removed raising an exception when Telemetry post config data fails, SDK will only log the error.
10+
111
9.5.1 (Sep 5, 2023)
212
- Exclude tests from when building the package
313
- Fixed exception when fetching telemetry stats if no SSE Feature flags update events are stored

splitio/api/telemetry.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def record_init(self, configs):
7676
'Error posting init config because an exception was raised by the HTTPClient'
7777
)
7878
_LOGGER.debug('Error: ', exc_info=True)
79-
raise APIException('Init config data not flushed properly.') from exc
8079

8180
def record_stats(self, stats):
8281
"""

splitio/client/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ def sanitize(sdk_key, config):
143143
_LOGGER.warning('metricRefreshRate parameter minimum value is 60 seconds, defaulting to 3600 seconds.')
144144
processed['metricsRefreshRate'] = 3600
145145

146-
processed['flagSetsFilter'] = sorted(validate_flag_sets(processed['flagSetsFilter'], 'SDK Config')) if processed['flagSetsFilter'] is not None else None
146+
if config['operationMode'] == 'consumer' and config.get('flagSetsFilter') is not None:
147+
processed['flagSetsFilter'] = None
148+
_LOGGER.warning('config: FlagSets filter is not applicable for Consumer modes where the SDK does keep rollout data in sync. FlagSet filter was discarded.')
149+
else:
150+
processed['flagSetsFilter'] = sorted(validate_flag_sets(processed['flagSetsFilter'], 'SDK Config')) if processed['flagSetsFilter'] is not None else None
147151

148152
return processed

tests/client/test_config.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ def test_sanitize_imp_mode(self):
6565

6666
def test_sanitize(self):
6767
"""Test sanitization."""
68-
configs = {}
69-
processed = config.sanitize('some', configs)
70-
68+
processed = config.sanitize('some', {})
7169
assert processed['redisLocalCacheEnabled'] # check default is True
72-
assert processed['flagSetsFilter'] is None
70+
assert processed['flagSetsFilter'] is None
71+
72+
processed = config.sanitize('some', {'redisHost': 'x', 'flagSetsFilter': ['set']})
73+
assert processed['flagSetsFilter'] is None
74+
75+
processed = config.sanitize('some', {'storageType': 'pluggable', 'flagSetsFilter': ['set']})
76+
assert processed['flagSetsFilter'] is None

0 commit comments

Comments
 (0)