-
Notifications
You must be signed in to change notification settings - Fork 927
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate variantManager to remote config (#3758)
Task/Issue URL: https://app.asana.com/0/0/1205644869911729/f ### Description This PR introduces the capability to download experiment variants from remote config, replacing the previous hardcoding approach. Additionally, it includes a refactoring of the old `getVariant()` method, which previously served as both a setter and a getter for user variants, into separate setter and getter methods for improved clarity and maintainability. ### Steps to test this PR _Replace `PRIVACY_REMOTE_CONFIG_URL` endpoint for https://www.jsonblob.com/api/1164161108453220352 so you can edit remote variants for each test_ _Experiment Variants Allocation_ - In remote config add "ma/weight 1.0/ no filters", "mb/weight 1.0/no filters", "mc/weight 1.0/no filters" - Fresh install from branch - [x] Check any of the 3 variants is allocated to the user _Experiment Variants with weight 0.0_ - In remote config add "ma/weight 0.0/ no filters" & "mb/weight 0.0/no filters" - Fresh install from branch - [x] Check default variant is allocated (_empty string_) _Experiment Variants with matching locale filter_ - In remote config add "ma/weight 1.0/ locale ["en_US"]" & "mb/weight 1.0/filters: locale ["en_US"]"" - Set your device to English (United States) - Fresh install from branch - [x] Check any of the variants have been allocated _Experiment Variants without matching locale filter_ - Set your device language to English (United States) - In remote config add "ma/weight 1.0/ locale ["de_DE"]" & "mb/weight 1.0/filters: locale ["de_DE"]"" - Fresh install from branch - [x] Check default variant is allocated (_empty string_) _Experiment Variants Update - Disable experiment_ - Make sure you have already a variant allocated (_"ma"_ or _"mb"_) - In remote config change weight to 0.0 "ma/weight 0.0/no filters" & "mb/weight 0.0/no filters" - Install from branch - [x] Check variant is still allocated to the user _Experiment Variants Update - Remove experiment_ - Make sure you have already a variant allocated (_"ma"_ or _"mb"_) - In remote config remove variant allocated to the user - Install from branch - [x] Check user variant is updated to default variant (_empty string_) _Experiment Variants Update - Add new experiment_ - Make sure you have already the default variant allocated (_empty string_) - In remote config add a new experiment with variants "md/weight 1.0/ no filters" & "me/weight 1.0/no filters" - Install from branch - [x] Check user variant is not updated (ℹ️ experiments work for new installs only) _getVariantKey() should NOT update variant value_ - Install from branch - Perform an action which would call 'getVariantKey()' -> _e.g._ Send any pixel - [x] Check we only get the variant and no setting the value like we used to do ### No UI changes --------- Co-authored-by: Cris Barreiro <cbarreiro@duckduckgo.com> Co-authored-by: Aitor Viana <aitorvs@gmail.com>
- Loading branch information
1 parent
b289c87
commit 40495c5
Showing
86 changed files
with
1,890 additions
and
734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.