Skip to content

Commit 3fc085a

Browse files
committed
feat(provider): remove Unleash provider tracking
Signed-off-by: Kiki L Hakiem <[email protected]>
1 parent 6cccc1e commit 3fc085a

File tree

4 files changed

+4
-313
lines changed

4 files changed

+4
-313
lines changed

providers/openfeature-provider-unleash/README.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -84,41 +84,6 @@ provider.remove_handler(ProviderEvent.PROVIDER_READY, on_provider_ready)
8484

8585
Note: `ProviderEvent.PROVIDER_STALE` handlers can be registered but are not currently emitted by this provider.
8686

87-
### Tracking support
88-
89-
The Unleash provider supports OpenFeature tracking for A/B testing and analytics:
90-
91-
```python
92-
from openfeature.evaluation_context import EvaluationContext
93-
94-
# Basic tracking
95-
provider.track("page_view")
96-
97-
# Tracking with context
98-
context = EvaluationContext(
99-
targeting_key="user123",
100-
attributes={"email": "[email protected]", "country": "US"}
101-
)
102-
provider.track("button_click", context)
103-
104-
# Tracking with event details
105-
event_details = {
106-
"value": 99.99,
107-
"currency": "USD",
108-
"category": "purchase"
109-
}
110-
provider.track("purchase_completed", event_details=event_details)
111-
112-
# Tracking with both context and details
113-
provider.track("conversion", context, event_details)
114-
```
115-
116-
**Tracking features:**
117-
- **Event Names**: Track user actions or application states
118-
- **Evaluation Context**: Include user targeting information
119-
- **Event Details**: Add numeric values and custom fields for analytics
120-
- **Unleash Integration**: Uses UnleashClient's impression event infrastructure
121-
12287
### Supported flag types
12388

12489
This provider supports resolving the following types via the OpenFeature client:
@@ -157,15 +122,6 @@ context = EvaluationContext(targeting_key="user123", attributes={"sessionId": "s
157122
variant = client.get_string_value("my-variant-flag", "default", context)
158123
print(f"Variant: {variant}")
159124

160-
# Track user actions for A/B testing
161-
user_context = EvaluationContext(
162-
targeting_key="user123",
163-
attributes={"email": "[email protected]", "plan": "premium"}
164-
)
165-
166-
provider.track("feature_experiment_view", user_context)
167-
provider.track("conversion", user_context, {"value": 150.0, "currency": "USD"})
168-
169125
# Shutdown when done
170126
provider.shutdown()
171127
```

providers/openfeature-provider-unleash/src/openfeature/contrib/provider/unleash/__init__.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from .events import EventManager
1616
from .flag_evaluation import FlagEvaluator
17-
from .tracking import Tracker
1817

1918
__all__ = ["UnleashProvider"]
2019

@@ -61,7 +60,6 @@ def __init__(
6160
ProviderEvent.PROVIDER_CONFIGURATION_CHANGED: [],
6261
ProviderEvent.PROVIDER_STALE: [],
6362
}
64-
self._tracking_manager = Tracker(self)
6563
self._event_manager = EventManager(self)
6664
self._flag_evaluator = FlagEvaluator(self)
6765
self.fetch_toggles = fetch_toggles
@@ -147,17 +145,14 @@ def _unleash_event_callback(self, event: BaseEvent) -> None:
147145
def track(
148146
self,
149147
event_name: str,
150-
evaluation_context: Optional[EvaluationContext] = None,
151148
event_details: Optional[dict] = None,
152149
) -> None:
153-
"""Track user actions or application states using Unleash impression events.
150+
"""No-op tracking method.
154151
155-
Args:
156-
event_name: The name of the tracking event
157-
evaluation_context: Optional evaluation context
158-
event_details: Optional tracking event details
152+
Tracking is not implemented for this provider. Per the OpenFeature spec,
153+
when the provider doesn't support tracking, client.track calls should no-op.
159154
"""
160-
self._tracking_manager.track(event_name, evaluation_context, event_details)
155+
return None
161156

162157
def _build_unleash_context(
163158
self, evaluation_context: Optional[EvaluationContext] = None

providers/openfeature-provider-unleash/src/openfeature/contrib/provider/unleash/tracking.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

providers/openfeature-provider-unleash/tests/test_tracking.py

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)