-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: odp datafile parsing and audience evaluation #303
Conversation
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.
Looks ok to me.
Just ine comment about comment indentaton.
def qualified_evaluator(condition) | ||
# Evaluate the given match condition for the given user qaulified segments. | ||
# Returns boolean true if condition value is in the user's qualified segments, | ||
# false if the condition value is not in the user's qualified segments, |
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.
Is this wide indent a ruby commenting style? I don't know, just mentioning :)
Seems a bit weird?
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.
I just matched the existing style in this file. Looks like the intention was to line up the different return values visually. I have no strong feelings about it either way 🤷
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.
Looks good! A couple of small changes suggested.
lib/optimizely/audience.rb
Outdated
attributes ||= {} | ||
|
||
custom_attr_condition_evaluator = CustomAttributeConditionEvaluator.new(attributes, logger) | ||
custom_attr_condition_evaluator = CustomAttributeConditionEvaluator.new(user_context, logger) |
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.
Not sure if we should fix them all but this name is not good any more "CustomAttributeConditionEvaluator" since it evaluates more than custom-attributes. We can consider something like "ConditionEvaluator" or "UserConditionEvaluator".
@@ -22,7 +22,7 @@ | |||
|
|||
module Optimizely | |||
class CustomAttributeConditionEvaluator | |||
CUSTOM_ATTRIBUTE_CONDITION_TYPE = 'custom_attribute' | |||
CONDITION_TYPES = %w[custom_attribute third_party_dimension].freeze |
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 is what I meant by name change. It's not "custom attribute" evaluator any more.
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.
Yea I agree, I made the change
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.
LGTM! Great work @andrewleap-optimizely
Summary
A new field
integrations
and new audience typeodp.audiences
will be added to the datafile schema for ODP integration.parse the odp values (
publicKey
andhost
)accept datafile with and without the
integrations
section or empty section as well.support a new audience with the
odp.audiences
andqualified
match.support any (allowed) combination of audiences, including ODP and other existing audiences.
Ticket:
OASIS-8393
Test plan
Added/extended tests in: