Skip to content

feat(OptimizelyConfig): Add new fields to OptimizelyConfig #285

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

Merged
merged 21 commits into from
Aug 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
depreciation comments added
  • Loading branch information
ozayr-zaviar committed Aug 12, 2021
commit eb45b1a8cc7fd7a6a2074aa3cb552c557e3896e4
6 changes: 5 additions & 1 deletion lib/optimizely/optimizely_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def config
config = {
'sdkKey' => @project_config.sdk_key,
'datafile' => @project_config.datafile,
# This experimentsMap is for experiments of legacy projects only
# This experimentsMap is for experiments of legacy projects only.
# For flag projects, experiment keys are not guaranteed to be unique
# across multiple flags, so this map may not include all experiments
# when keys conflict. Use experimentRules and deliveryRules instead.
Expand Down Expand Up @@ -152,6 +152,10 @@ def get_features_map(all_experiments_map)
feature['key'] => {
'id' => feature['id'],
'key' => feature['key'],
# This experimentsMap is for experiments of legacy projects only.
# For flag projects, experiment keys are not guaranteed to be unique
# across multiple flags, so this map may not include all experiments
# when keys conflict. Use experimentRules and deliveryRules instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message should be chanaged to:
"This experimentsMap is deprecated. Use experimentRules and deliveryRules instead."

The one at top level ("experimentsMap" in OptimizleyConfig) looks good.

'experimentsMap' => feature['experimentIds'].reduce({}) do |experiments_map, experiment_id|
experiment_key = @project_config.experiment_id_map[experiment_id]['key']
experiments_map.update(experiment_key => experiments_id_map[experiment_id])
Expand Down