Skip to content

Commit 6903782

Browse files
committed
[FSSDK-12813] Remove ticket references from code comments per cross-sdk guideline
1 parent 31675bf commit 6903782

6 files changed

Lines changed: 10 additions & 28 deletions

File tree

optimizely/event/event_factory.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,6 @@ def _create_visitor(cls, event: Optional[user_event.UserEvent], logger: Logger)
135135
if isinstance(event.experiment, entities.Experiment):
136136
experiment_layerId = event.experiment.layerId
137137

138-
# FSSDK-12813: Normalize decision-event IDs uniformly across all
139-
# decision types (experiment, feature test, rollout, holdout).
140-
# campaign_id falls back to experiment_id when invalid.
141-
# variation_id becomes None when invalid.
142-
# entity_id on the impression event mirrors campaign_id (FR-009)
143-
# so the two fields are byte-equivalent for the same event.
144138
normalized_campaign_id = event_id_normalizer.normalize_campaign_id(
145139
experiment_layerId, experiment_id
146140
)

optimizely/event/event_id_normalizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
This module provides byte-equivalent, cross-SDK normalization for the
1717
``campaign_id``, ``variation_id``, and impression ``entity_id`` fields that
18-
appear in dispatched decision events. See FSSDK-12813.
18+
appear in dispatched decision events.
1919
2020
Rules:
2121
* ``campaign_id`` and impression ``entity_id`` accept **any non-empty

optimizely/event/payload.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ def __init__(
8080
):
8181
self.campaign_id = campaign_id
8282
self.experiment_id = experiment_id
83-
# FSSDK-12813: variation_id may be None when input is invalid /
84-
# non-numeric (FR-003/FR-004). All other decision fields remain
85-
# strings.
8683
self.variation_id = variation_id
8784
self.metadata = metadata
8885

optimizely/event_builder.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,6 @@ def _get_required_params_for_impression(
191191
"""
192192
snapshot: dict[str, list[dict[str, Any]]] = {}
193193

194-
# FSSDK-12813: Normalize decision-event IDs uniformly across all
195-
# decision types. campaign_id falls back to experiment_id when
196-
# invalid; variation_id becomes None when invalid; entity_id mirrors
197-
# the normalized campaign_id (FR-009).
198194
normalized_campaign_id = event_id_normalizer.normalize_campaign_id(
199195
experiment.layerId, experiment.id
200196
)

tests/test_event_factory.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ def test_create_impression_event_without_cmab_uuid(self):
12401240

12411241

12421242
class EventFactoryIdNormalizationIntegrationTest(base.BaseTest):
1243-
"""FSSDK-12813: end-to-end decision-event ID normalization.
1243+
"""End-to-end decision-event ID normalization.
12441244
12451245
These tests build real ``ImpressionEvent`` instances using crafted
12461246
Experiment/Variation objects, then call ``EventFactory.create_log_event``
@@ -1323,24 +1323,21 @@ def test_empty_campaign_id_falls_back_to_experiment_id(self):
13231323
self.assertEqual('111127', event['entity_id'])
13241324

13251325
def test_opaque_string_campaign_id_passes_through(self):
1326-
# FSSDK-12813: opaque (non-numeric) campaign_id values are valid and
1327-
# pass through unchanged per the relaxed FR-001 contract.
13281326
impression = self._build_impression('111127', 'campaign_a', '111129')
13291327
decision, event = self._dispatched_decision(impression)
13301328
self.assertEqual('campaign_a', decision['campaign_id'])
13311329
self.assertEqual('campaign_a', event['entity_id'])
13321330

13331331
def test_prefixed_opaque_campaign_id_passes_through(self):
1334-
# FSSDK-12813: e.g. holdout layer IDs like "default-12345".
1332+
# Holdout layer IDs are opaque strings like "default-12345".
13351333
impression = self._build_impression('111127', 'default-12345', '111129')
13361334
decision, event = self._dispatched_decision(impression)
13371335
self.assertEqual('default-12345', decision['campaign_id'])
13381336
self.assertEqual('default-12345', event['entity_id'])
13391337

13401338
def test_whitespace_campaign_id_passes_through(self):
1341-
# FSSDK-12813: whitespace is a non-empty string and so is accepted;
1342-
# character-content validation is deferred to the upstream datafile
1343-
# producer.
1339+
# Whitespace is a non-empty string; character-content validation is
1340+
# the upstream datafile producer's responsibility.
13441341
impression = self._build_impression('111127', ' ', '111129')
13451342
decision, event = self._dispatched_decision(impression)
13461343
self.assertEqual(' ', decision['campaign_id'])
@@ -1370,8 +1367,6 @@ def test_whitespace_variation_id_becomes_none(self):
13701367

13711368
# ------------------------------------------------------------------ FR-005
13721369
def test_normalization_applies_to_rollout_decisions(self):
1373-
# FSSDK-12813: empty campaign_id falls back to experiment_id;
1374-
# non-numeric variation_id normalizes to None.
13751370
impression = self._build_impression(
13761371
'111127', '', 'bad_var', rule_type='rollout'
13771372
)
@@ -1399,8 +1394,8 @@ def test_normalization_applies_to_holdout_decisions(self):
13991394
self.assertEqual('111127', event['entity_id'])
14001395

14011396
def test_holdout_with_opaque_layer_id_passes_through(self):
1402-
# FSSDK-12813: the canonical holdout caseopaque layerId like
1403-
# "default-12345" is now a valid campaign_id and is NOT replaced.
1397+
# Canonical holdout case: opaque layerId like "default-12345" is a
1398+
# valid campaign_id and must not be replaced.
14041399
impression = self._build_impression(
14051400
'111127', 'default-12345', '111129', rule_type='holdout'
14061401
)
@@ -1427,7 +1422,7 @@ def test_entity_id_equals_campaign_id_byte_for_byte(self):
14271422
for layer_id, exp_id, expected in [
14281423
('111182', '111127', '111182'), # numeric campaign_id wins
14291424
('', '111127', '111127'), # empty falls back to experiment_id
1430-
# FSSDK-12813: opaque non-numeric IDs now pass through unchanged.
1425+
# Opaque non-numeric IDs pass through unchanged.
14311426
('default-12345', '111127', 'default-12345'),
14321427
('layer_abc', '111127', 'layer_abc'),
14331428
('007', '111127', '007'), # leading zeros preserved

tests/test_event_id_normalizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14-
"""Unit tests for :mod:`optimizely.event.event_id_normalizer` (FSSDK-12813)."""
14+
"""Unit tests for :mod:`optimizely.event.event_id_normalizer`."""
1515

1616
import unittest
1717

@@ -143,7 +143,7 @@ def test_returns_campaign_id_when_numeric(self):
143143
)
144144

145145
def test_returns_campaign_id_when_opaque_string(self):
146-
# FSSDK-12813: opaque IDs (e.g. holdout layer IDs) pass through.
146+
# Opaque IDs (e.g. holdout layer IDs) pass through.
147147
self.assertEqual(
148148
'default-12345',
149149
event_id_normalizer.normalize_campaign_id('default-12345', '111127'),

0 commit comments

Comments
 (0)