Skip to content
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

Delivery rules correction for proper rollout key #351

Merged
merged 14 commits into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion optimizely/optimizely_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def _get_delivery_rules(self, rollouts, rollout_id):
audiences_map[optly_audience.id] = optly_audience.name

# Get the experiments_map for that rollout
The-inside-man marked this conversation as resolved.
Show resolved Hide resolved
experiments = rollout.get('experiments_map')
experiments = rollout.get('experiments')
if experiments:
for experiment in experiments:
optly_exp = OptimizelyExperiment(
Expand Down
194 changes: 189 additions & 5 deletions tests/test_optimizely_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,53 @@ def setUp(self):
'experiments_map': {

},
'delivery_rules': [],
'delivery_rules': [
{
'id': '211127',
'key': '211127',
'variations_map': {
'211129': {
'id': '211129',
'key': '211129',
'feature_enabled': True,
'variables_map': {}
},
'211229': {
'id': '211229',
'key': '211229',
'feature_enabled': False,
'variables_map': {}
}
},
'audiences': ''
The-inside-man marked this conversation as resolved.
Show resolved Hide resolved
},
{
'id': '211137',
'key': '211137',
'variations_map': {
'211139': {
'id': '211139',
'key': '211139',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
},
{
'id': '211147',
'key': '211147',
'variations_map': {
'211149': {
'id': '211149',
'key': '211149',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
}
],
'experiment_rules': [],
'id': '91112',
'key': 'test_feature_in_rollout'
Expand Down Expand Up @@ -677,7 +723,7 @@ def setUp(self):
},
'test_feature_in_experiment_and_rollout': {
'variables_map': {

The-inside-man marked this conversation as resolved.
Show resolved Hide resolved
},
'experiments_map': {
'group_exp_2': {
Expand All @@ -704,7 +750,53 @@ def setUp(self):
'audiences': ''
}
},
'delivery_rules': [],
'delivery_rules': [
{
'id': '211127',
'key': '211127',
'variations_map': {
'211129': {
'id': '211129',
'key': '211129',
'feature_enabled': True,
'variables_map': {}
},
'211229': {
'id': '211229',
'key': '211229',
'feature_enabled': False,
'variables_map': {}
}
},
'audiences': ''
},
{
'id': '211137',
'key': '211137',
'variations_map': {
'211139': {
'id': '211139',
'key': '211139',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
},
{
'id': '211147',
'key': '211147',
'variations_map': {
'211149': {
'id': '211149',
'key': '211149',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
}
],
'experiment_rules': [
{
'id': '32223',
Expand Down Expand Up @@ -780,7 +872,53 @@ def setUp(self):
'audiences': '"Test attribute users 3"'
}
},
'delivery_rules': [],
'delivery_rules': [
{
'id': '211127',
'key': '211127',
'variations_map': {
'211129': {
'id': '211129',
'key': '211129',
'feature_enabled': True,
'variables_map': {}
},
'211229': {
'id': '211229',
'key': '211229',
'feature_enabled': False,
'variables_map': {}
}
},
'audiences': ''
},
{
'id': '211137',
'key': '211137',
'variations_map': {
'211139': {
'id': '211139',
'key': '211139',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
},
{
'id': '211147',
'key': '211147',
'variations_map': {
'211149': {
'id': '211149',
'key': '211149',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
}
],
'experiment_rules': [
{
'id': '42222',
Expand Down Expand Up @@ -876,7 +1014,53 @@ def setUp(self):
'audiences': '"Test attribute users 3"'
}
},
'delivery_rules': [],
'delivery_rules': [
{
'id': '211127',
'key': '211127',
'variations_map': {
'211129': {
'id': '211129',
'key': '211129',
'feature_enabled': True,
'variables_map': {}
},
'211229': {
'id': '211229',
'key': '211229',
'feature_enabled': False,
'variables_map': {}
}
},
'audiences': ''
},
{
'id': '211137',
'key': '211137',
'variations_map': {
'211139': {
'id': '211139',
'key': '211139',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
},
{
'id': '211147',
'key': '211147',
'variations_map': {
'211149': {
'id': '211149',
'key': '211149',
'feature_enabled': True,
'variables_map': {}
}
},
'audiences': ''
}
],
'experiment_rules': [
{
'id': '111134',
Expand Down