Skip to content

Commit 38e0e3e

Browse files
more pr feedback
1 parent befebaa commit 38e0e3e

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

backend/compact-connect/lambdas/python/feature-flag/feature_flag_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ class StatSigFeatureFlagClient(FeatureFlagClient):
202202
StatSig implementation of the FeatureFlagClient interface.
203203
204204
This client uses StatSig's Python SDK to check feature flags.
205-
Configuration is handled through environment variables.
206205
"""
207206

208207
def __init__(self, environment: str):

backend/compact-connect/lambdas/python/feature-flag/tests/function/test_statsig_client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def test_upsert_flag_create_new_in_test_environment(self, mock_requests, mock_st
284284

285285
# Verify API calls
286286
mock_requests.get.assert_called_once()
287-
# Verify POST payload - test environment always gets passPercentage=100 regardless of auto_enable
287+
# Verify POST payload
288288
mock_requests.post.assert_called_once_with(
289289
f'{STATSIG_API_BASE_URL}/gates',
290290
headers={
@@ -308,7 +308,7 @@ def test_upsert_flag_create_new_in_test_environment(self, mock_requests, mock_st
308308
}
309309
],
310310
'environments': ['development'],
311-
'passPercentage': 100, # Always 100 for test environment
311+
'passPercentage': 100, # Always 100 if auto_enable is true
312312
}
313313
],
314314
},
@@ -490,7 +490,7 @@ def test_upsert_flag_prod_environment_auto_enable_true_no_existing_flag(self, mo
490490
def test_upsert_flag_beta_environment_auto_enable_false_no_existing_rule_create_rule(
491491
self, mock_requests, mock_statsig
492492
):
493-
"""Test upsert in prod environment with autoEnable=True and no existing flag"""
493+
"""Test upsert in prod environment with autoEnable=True and no existing flag creates beta rule"""
494494
self._setup_mock_statsig(mock_statsig)
495495

496496
existing_flag = {
@@ -1018,7 +1018,7 @@ def test_delete_flag_api_error_on_patch_raises_exception(self, mock_requests, mo
10181018
@patch('feature_flag_client.Statsig')
10191019
@patch('feature_flag_client.requests')
10201020
def test_upsert_flag_custom_attributes_as_string(self, mock_requests, mock_statsig):
1021-
"""Test upsert_flag with custom attributes as string values - development environment always enabled"""
1021+
"""Test upsert_flag with custom attributes as string values"""
10221022
self._setup_mock_statsig(mock_statsig)
10231023

10241024
# Mock GET request (flag doesn't exist)
@@ -1037,7 +1037,7 @@ def test_upsert_flag_custom_attributes_as_string(self, mock_requests, mock_stats
10371037
# Verify result
10381038
self.assertEqual(result['id'], 'gate-string-attrs')
10391039

1040-
# Verify API calls - string values should be converted to lists, no conditions when auto_enable=False in test
1040+
# Verify API calls - string values should be converted to lists; conditions included even when auto_enable=False
10411041
mock_requests.post.assert_called_once_with(
10421042
f'{STATSIG_API_BASE_URL}/gates',
10431043
headers={
@@ -1062,7 +1062,7 @@ def test_upsert_flag_custom_attributes_as_string(self, mock_requests, mock_stats
10621062
{'type': 'custom_field', 'targetValue': ['new'], 'field': 'feature', 'operator': 'any'},
10631063
],
10641064
'environments': ['development'],
1065-
'passPercentage': 0, # 0 since auto_enabled is false
1065+
'passPercentage': 0, # 0 since auto_enable is false
10661066
}
10671067
],
10681068
},
@@ -1091,7 +1091,7 @@ def test_upsert_flag_custom_attributes_as_list(self, mock_requests, mock_statsig
10911091
# Verify result
10921092
self.assertEqual(result['id'], 'gate-list-attrs')
10931093

1094-
# Verify API calls - list values preserved but no conditions when auto_enable=False
1094+
# Verify API calls - list values preserved; conditions included even when auto_enable=False
10951095
mock_requests.post.assert_called_once_with(
10961096
f'{STATSIG_API_BASE_URL}/gates',
10971097
headers={

backend/compact-connect/stacks/feature_flag_stack/feature_flag_resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class FeatureFlagEnvironmentName(StrEnum):
1717
BETA = 'beta'
1818
PROD = 'prod'
1919
# add sandbox environment names here if needed
20-
SANDBOX = 'sandbox'
20+
SANDBOX = 'landon'
2121

2222

2323
class FeatureFlagResource(Construct):

0 commit comments

Comments
 (0)