[sc-118386] - Adds proper support to MVT experiments #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Disclaimer: This PR enables code found here.
(To test you need to run both branches locally and make Opticks a local dependency.)
This PR adds support to MVT tests and simplifies the usage of Optimizely JS SDK. This is achieved through:
Removing the distinction between feature and experiment.
Optimizely's SDK now makes no distinction on their
decisionInfo
contract, leading to a simplification of code and a need for conventions to be set in place.Retro-compatible support for
on
andoff
We added temporary retro-compatibility to transforming
on
andoff
variants intob
anda
respectively.Why we needed this? We used to use the property
decisionInfo.enabled
to determine which side the customer would fall in a rollout, by usingconvertBooleanToggleToFeatureVariant
to convertenabled:true|false
intob
ora
.enabled
in its turn, on Optimizely's side responds to "On", "Off" automatically. This logic was fine if we had only rollouts. However,enabled
is not used on MVT (enabled is boolean, MVT is multivariant).We had to find a different way to return the variant. Given that now we can set the value of
variationKey
, we can as well usea, b, c, ...
directly into Optimizely's dashboard. This led to a simplification on our code and more intuitive usage of the product.Shortcut Story
https://app.shortcut.com/findhotel/story/XXXXX
[sc-XXXXX]
How to review/test this change
Checklist
Mandatory
Optional (as needed)