feat!: implement experimentation tracking - #37
Conversation
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
|
@themis-blindfold review |
⚖️ Themis review: ✅ Ship itSolid, well-guarded experimentation surface. The tracking/exposure logic is correct against the SDK's
📝 Walkthrough
🧪 How to verify
Automate: all covered by Product take: This closes the experimentation gap between the JS and Python OpenFeature providers. Users can now record experiment exposures via the hook (recommended), explicit 🧭 Assumptions & unverified claims
Clean experimentation surface, correct guards, thorough tests — the rare PR where the reviewer's job is to confirm rather than correct. · reviewed at 2682781 |
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
4012ab6 to
d070cb4
Compare
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
39feaf6 to
b8aa931
Compare
Signed-off-by: wadii <wadii.zaim@flagsmith.com>
b8aa931 to
b09d685
Compare
Changes
Ports the experimentation surface of the JS OpenFeature provider (open-feature/js-sdk-contrib#1591) to the Python provider.
reason,variantandflag_metadata(enabled,featureId, andexperiment.arm/experiment.active/experiment.unitfor multivariate assignments). Multivariate percentage-split assignments resolve with reasonSPLIT, aligned with the engine's reason taxonomy.feature_flag.exposureevent records experiment exposures, with an explicit variant, or variant-less (the provider resolves the flag for the context's targeting key and applies the same guards as the SDK'sget_experiment_flag).FlagsmithExposureHook, an opt-in after-hook that records an exposure when an evaluation resolves with a variant and reasonSPLIT, deduped per identity/flag/variant in a bounded thread-safe LRU. Attaching the hook to a call site is the experiment declaration; nothing auto-exposes."transient": Truecontext attribute.track()crashing with an uncaughtTypeErroron flagsmith >=5.4 (the SDK renamedtrack_event(identity_identifier=)toidentifier=).How did you test this code?
BREAKING CHANGE
The minimum supported flagsmith version is now 5.5. track() previously crashed with a TypeError on flagsmith >=5.4 due to the SDK's renamed track_event signature; it now calls the current signature and sends TrackingEventDetails.value as the first-class Flagsmith event value instead of metadata["value"].