Skip to content

Commit 063295f

Browse files
author
Bilal Al
committed
Merge remote-tracking branch 'origin/development' into Feature/Async
2 parents 485bb49 + 14064fc commit 063295f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+842
-99
lines changed

.github/workflows/update-license-year.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919

@@ -24,7 +24,7 @@ jobs:
2424
run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV"
2525

2626
- name: Update LICENSE
27-
uses: jacobtomlinson/gha-find-replace@v2
27+
uses: jacobtomlinson/gha-find-replace@v3
2828
with:
2929
find: ${{ env.PREVIOUS }}
3030
replace: ${{ env.CURRENT }}
@@ -38,7 +38,7 @@ jobs:
3838
git commit -m "Updated License Year" -a
3939
4040
- name: Create Pull Request
41-
uses: peter-evans/create-pull-request@v3
41+
uses: peter-evans/create-pull-request@v5
4242
with:
4343
token: ${{ secrets.GITHUB_TOKEN }}
4444
title: Update License Year

CHANGES.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
10.0.0 (XXX XX, XXXX)
2+
- Added support for asyncio library
3+
- BREAKING CHANGE: Minimum supported Python version is 3.7.16
4+
5+
9.6.2 (Apr 5, 2024)
6+
- Fixed an issue when pushing unique keys tracker data to redis if no keys exist, i.e. get_treatment flavors are not called.
7+
8+
9.6.1 (Feb 15, 2024)
9+
- Added redisUsername configuration parameter for Redis connection to set the username for accessing redis when not using the default `root` username
10+
11+
9.6.0 (Nov 3, 2023)
12+
- 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):
13+
- Added new variations of the get treatment methods to support evaluating flags in given flag set/s.
14+
- get_treatments_by_flag_set and get_treatments_by_flag_sets
15+
- get_treatments_with_config_by_flag_set and get_treatments_with_config_by_flag_sets
16+
- 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.
17+
- 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.
18+
- Updated the following SDK manager methods to expose flag sets on flag views.
19+
- Removed raising an exception when Telemetry post config data fails, SDK will only log the error.
20+
21+
9.5.1 (Sep 5, 2023)
22+
- Exclude tests from when building the package
23+
- Fixed exception when fetching telemetry stats if no SSE Feature flags update events are stored
24+
25+
9.5.0 (Jul 18, 2023)
26+
- Improved streaming architecture implementation to apply feature flag updates from the notification received which is now enhanced, improving efficiency and reliability of the whole update system.
27+
128
9.4.2 (May 15, 2023)
229
- Updated terminology on the SDKs codebase to be more aligned with current standard without causing a breaking change. The core change is the term split for feature flag on things like logs and code documentation comments.
330
- Added detailed debug logging for redis adapter.

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2023 Split Software, Inc.
1+
Copyright © 2024 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
TESTS_REQUIRES = [
88
'flake8',
99
'pytest==7.0.1',
10-
'pytest-mock>=3.5.1',
10+
'pytest-mock==3.12.0',
1111
'coverage==6.2',
1212
'pytest-cov',
1313
'importlib-metadata==4.2',
@@ -53,5 +53,5 @@
5353
'Programming Language :: Python :: 3',
5454
'Topic :: Software Development :: Libraries'
5555
],
56-
packages=find_packages()
56+
packages=find_packages(exclude=('tests', 'tests.*'))
5757
)

splitio/api/auth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def authenticate(self):
4848
if 200 <= response.status_code < 300:
4949
payload = json.loads(response.body)
5050
return from_raw(payload)
51+
5152
else:
5253
if (response.status_code >= 400 and response.status_code < 500):
5354
self._telemetry_runtime_producer.record_auth_rejections()
@@ -94,6 +95,7 @@ async def authenticate(self):
9495
if 200 <= response.status_code < 300:
9596
payload = json.loads(response.body)
9697
return from_raw(payload)
98+
9799
else:
98100
if (response.status_code >= 400 and response.status_code < 500):
99101
await self._telemetry_runtime_producer.record_auth_rejections()

splitio/api/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def get(self, server, path, sdk_key, query=None, extra_headers=None): # pylint:
145145
)
146146
self._record_telemetry(response.status_code, get_current_epoch_time_ms() - start)
147147
return HttpResponse(response.status_code, response.text, response.headers)
148+
148149
except Exception as exc: # pylint: disable=broad-except
149150
raise HttpClientException('requests library is throwing exceptions') from exc
150151

@@ -184,6 +185,7 @@ def post(self, server, path, sdk_key, body, query=None, extra_headers=None): #
184185
)
185186
self._record_telemetry(response.status_code, get_current_epoch_time_ms() - start)
186187
return HttpResponse(response.status_code, response.text, response.headers)
188+
187189
except Exception as exc: # pylint: disable=broad-except
188190
raise HttpClientException('requests library is throwing exceptions') from exc
189191

@@ -262,6 +264,7 @@ async def get(self, server, path, apikey, query=None, extra_headers=None): # py
262264
_LOGGER.debug(body)
263265
await self._record_telemetry(response.status, get_current_epoch_time_ms() - start)
264266
return HttpResponse(response.status, body, response.headers)
267+
265268
except aiohttp.ClientError as exc: # pylint: disable=broad-except
266269
raise HttpClientException('aiohttp library is throwing exceptions') from exc
267270

@@ -307,6 +310,7 @@ async def post(self, server, path, apikey, body, query=None, extra_headers=None)
307310
_LOGGER.debug(body)
308311
await self._record_telemetry(response.status, get_current_epoch_time_ms() - start)
309312
return HttpResponse(response.status, body, response.headers)
313+
310314
except aiohttp.ClientError as exc: # pylint: disable=broad-except
311315
raise HttpClientException('aiohttp library is throwing exceptions') from exc
312316

@@ -324,6 +328,7 @@ async def _record_telemetry(self, status_code, elapsed):
324328
if 200 <= status_code < 300:
325329
await self._telemetry_runtime_producer.record_successful_sync(self._metric_name, get_current_epoch_time_ms())
326330
return
331+
327332
await self._telemetry_runtime_producer.record_sync_error(self._metric_name, status_code)
328333

329334
async def close_session(self):

splitio/api/commons.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ def __eq__(self, other):
4242
"""Match between other options."""
4343
if self._cache_control_headers != other._cache_control_headers:
4444
return False
45+
4546
if self._change_number != other._change_number:
4647
return False
48+
4749
if self._sets != other._sets:
4850
return False
51+
4952
return True
5053

5154

@@ -69,6 +72,7 @@ def build_fetch(change_number, fetch_options, metadata):
6972
extra_headers = metadata
7073
if fetch_options is None:
7174
return query, extra_headers
75+
7276
if fetch_options.cache_control_headers:
7377
extra_headers[_CACHE_CONTROL] = _CACHE_CONTROL_NO_CACHE
7478
if fetch_options.change_number is not None:

splitio/api/events.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Events API module."""
22
import logging
3-
import time
43

54
from splitio.api import APIException, headers_from_metadata
65
from splitio.api.client import HttpClientException

splitio/api/segments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import json
44
import logging
5-
import time
65

76
from splitio.api import APIException, headers_from_metadata
87
from splitio.api.commons import build_fetch
@@ -61,6 +60,7 @@ def fetch_segment(self, segment_name, change_number, fetch_options):
6160
)
6261
if 200 <= response.status_code < 300:
6362
return json.loads(response.body)
63+
6464
raise APIException(response.body, response.status_code)
6565
except HttpClientException as exc:
6666
_LOGGER.error(
@@ -119,6 +119,7 @@ async def fetch_segment(self, segment_name, change_number, fetch_options):
119119
)
120120
if 200 <= response.status_code < 300:
121121
return json.loads(response.body)
122+
122123
raise APIException(response.body, response.status_code)
123124
except HttpClientException as exc:
124125
_LOGGER.error(

splitio/api/splits.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import logging
44
import json
5-
import time
65

76
from splitio.api import APIException, headers_from_metadata
87
from splitio.api.commons import build_fetch
@@ -56,6 +55,7 @@ def fetch_splits(self, change_number, fetch_options):
5655
)
5756
if 200 <= response.status_code < 300:
5857
return json.loads(response.body)
58+
5959
else:
6060
if response.status_code == 414:
6161
_LOGGER.error('Error fetching feature flags; the amount of flag sets provided are too big, causing uri length error.')
@@ -110,6 +110,7 @@ async def fetch_splits(self, change_number, fetch_options):
110110
)
111111
if 200 <= response.status_code < 300:
112112
return json.loads(response.body)
113+
113114
else:
114115
if response.status_code == 414:
115116
_LOGGER.error('Error fetching feature flags; the amount of flag sets provided are too big, causing uri length error.')

0 commit comments

Comments
 (0)