-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fix(is_feature_enabled): Added rollout experiment key map for onboarding datafile #168
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ class ProjectConfig | |
attr_reader :feature_variable_key_map | ||
attr_reader :group_key_map | ||
attr_reader :rollout_id_map | ||
attr_reader :rollout_experiment_id_map | ||
attr_reader :rollout_experiment_key_map | ||
attr_reader :variation_id_map | ||
attr_reader :variation_id_to_variable_usage_map | ||
attr_reader :variation_key_map | ||
|
@@ -120,13 +120,13 @@ def initialize(datafile, logger, error_handler) | |
end | ||
end | ||
@rollout_id_map = generate_key_map(@rollouts, 'id') | ||
# split out the experiment id map for rollouts | ||
@rollout_experiment_id_map = {} | ||
# split out the experiment key map for rollouts | ||
@rollout_experiment_key_map = {} | ||
@rollout_id_map.each_value do |rollout| | ||
exps = rollout.fetch('experiments') | ||
@rollout_experiment_id_map = @rollout_experiment_id_map.merge(generate_key_map(exps, 'id')) | ||
@rollout_experiment_key_map = @rollout_experiment_key_map.merge(generate_key_map(exps, 'key')) | ||
end | ||
@all_experiments = @experiment_key_map.merge(@rollout_experiment_id_map) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow this is a big mistake we didn't catch in the code review last time around There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Luckily IDs and keys have been same, but if it had changed things would be really very bad. |
||
@all_experiments = @experiment_key_map.merge(@rollout_experiment_key_map) | ||
@all_experiments.each do |key, exp| | ||
variations = exp.fetch('variations') | ||
variations.each do |variation| | ||
|
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.
Now where
rollout_experiment_id_map
is being used in the code.