-
Notifications
You must be signed in to change notification settings - Fork 83
feat(decision-listener): Incorporated new decision notification listener changes. #258
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
Conversation
FEATURE: 'feature', | ||
FEATURE_TEST: 'feature-test', | ||
FEATURE_VARIABLE: 'feature_variable', |
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.
Missed it earlier. This needs to be feature-variable
@@ -89,10 +89,16 @@ module.exports = { | |||
|
|||
projectConfig.forcedVariationMap = {}; | |||
|
|||
// Object containing experiment Ids that exist in any feature | |||
// for checking that experiment is a feature experiment or not. | |||
projectConfig.featureExperimentsMap = {}; |
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.
More meaningful is experimentFeatureMap.
projectConfig.featureKeyMap = fns.keyBy(projectConfig.featureFlags || [], 'key'); | ||
fns.forOwn(projectConfig.featureKeyMap, function(feature) { | ||
feature.variableKeyMap = fns.keyBy(feature.variables, 'key'); | ||
fns.forEach(feature.experimentIds || [], function(experimentId) { | ||
// Add this experiment in feature experiment map. | ||
projectConfig.featureExperimentsMap[experimentId] = true; |
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.
Instead of true
, if we can assign featureId would be more meaning. @aliabbasrizvi What do you suggest?
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.
Agreed. It would be much better if we add featureId
on experiment
and use that.
* any feature, false otherwise. | ||
*/ | ||
isFeatureExperiment: function(projectConfig, experimentId) { | ||
return projectConfig.featureExperimentsMap[experimentId]; |
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 condition after making suggested changes, should be like
projectConfig.featureExperimentsMap[experimentId] != undefined
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.
Summary
Test plan