-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audiences, Attributes and Events implementation #438
Conversation
…hange lists to use OptimizelyAttribute and OptimizelyEvent. Convert Attribute and EventTypes to lists of OptimizleyAttribute and OptimizelyEvent lists before calling OptimizelyConfig constructor.
switch statement, same for conditionUtils. Audience implementation and addition of OptimizelyAudience class. Updated OptimizelyConfig with Audiences and added implementation in OptimizelyConfigService. Updated OptimizelyExperiment to get the serialized audienceConditions list from experiment. Test cases will come in additional Commits.
core-api/src/main/java/com/optimizely/ab/config/Experiment.java
Outdated
Show resolved
Hide resolved
|
Might be something that can be automatically checked. Don't let it gate a merge. |
good catch! thanks |
Testing the serialize portion of the audienceConditions as part of Experiments is a bit different in this one since each condition is actually based off an interface and many of the checks pertaining to edge cases (ie. empty list, or a list of just audienceId's) are covered during the parsing of the datafile and creates either an EmptyCondition or and AudienceIdCondition, both which implement Condition, so when its time to actually serialize we can check if an empty condition or an AudienceIdCondition. If a list of AudienceId's is present in the datafile parsing then it already creates an OrCondition with a list of AudienceIdConditions, meaning we will never have a case in the Experiment that we only have a list of AudienceId's as it will always be an OrCondition object with a list of those ID's. |
3 failing scenarios shown here: https://travis-ci.com/github/optimizely/fullstack-sdk-compatibility-suite/builds/234971801 pass with custom build on FSC fix branch: https://travis-ci.com/github/optimizely/fullstack-sdk-compatibility-suite/jobs/530428847 |
Passing all test cases for FSC: https://travis-ci.com/github/optimizely/fullstack-sdk-compatibility-suite/builds/235065614 @msohailhussain would you mind a final review/approval on this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all looks good but just have few suggestions, want to discuss before approving it.
core-api/src/main/java/com/optimizely/ab/config/Experiment.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/Experiment.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/Experiment.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/Experiment.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/Experiment.java
Outdated
Show resolved
Hide resolved
core-api/src/main/java/com/optimizely/ab/config/audience/AndCondition.java
Outdated
Show resolved
Hide resolved
return "{name='" + name + "\'" + | ||
", type='" + type + "\'" + | ||
", match='" + match + "\'" + | ||
", value=" + valueStr + | ||
", value=" + ((value instanceof String) ? ("'" + getValueStr() + "'") : getValueStr()) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why single quote here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was part of the original logic that I didn't want to change (Line 127) but don't need for the function above and wanted to reuse the same code minus those quotes. We can chat offline if you like.
core-api/src/main/java/com/optimizely/ab/config/parser/ConditionJacksonDeserializer.java
Show resolved
Hide resolved
this(experimentsMap, featuresMap, revision, sdkKey, environmentKey, attributes, events, audiences, null); | ||
} | ||
|
||
public OptimizelyConfig(Map<String, OptimizelyExperiment> experimentsMap, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case we are supposed to use it internally, can we set access modifier accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment about deprecation notation
* @Deprecated The experimentsMap has been deprecated. </br> | ||
* Use experimentRules and deliveryRules instead. | ||
* */ | ||
@Deprecated() | ||
private Map<String, OptimizelyExperiment> experimentsMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not show deprecation note when I open the doc. Can you check? Also it use different deprecation notation. You can make it consistent (for compatibility issue for android support?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, let me take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jaeopt Updated to follow suite with Android.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Test plan
Issues