-
Notifications
You must be signed in to change notification settings - Fork 19
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: Experiment override service #164
Conversation
… NewCompositeService
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.
Implementation looks great! I have some suggestions
if variation.Key == variationKey { | ||
decision.Variation = &variation | ||
decision.Reason = reasons.OverrideVariationAssignmentFound | ||
eosLogger.Info(fmt.Sprintf("Override variation %v found for user %v", variationKey, userContext.ID)) |
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 think this should be a debug level message
return decision, nil | ||
} | ||
|
||
// TODO(Matt): Add a VariationsByKey map to the Experiment struct, and use it to look up Variation by key |
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.
Probably a keyToID map and then you can just look up by ID
return decision, nil | ||
} | ||
|
||
// TODO(Matt): Add a VariationsByKey map to the Experiment struct, and use it to look up Variation by key |
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 TODO still needed ?
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 think it's needed. Ideally we would not have to iterate over variations to find the one with a given key.
Summary
Add
ExperimentOverrideService
, a decision service that can pull variations from anExperimentOverrideStore
, which is an interface that returns variations for experiment key/user ID pairs.Included is an implementation of
ExperimentOverrideStore
based on a map.Test plan
New unit tests
JIRA Issues
https://optimizely.atlassian.net/browse/OASIS-5419