@@ -356,14 +356,21 @@ def get_variation_for_rollout(self, project_config, feature, user):
356
356
return Decision (None , None , enums .DecisionSources .ROLLOUT ), decide_reasons
357
357
358
358
rollout = project_config .get_rollout_from_id (feature .rolloutId )
359
- rollout_rules = project_config .get_rollout_experiments (rollout )
360
359
361
- if not rollout or not rollout_rules :
360
+ if not rollout :
362
361
message = 'There is no rollout of feature {}.' .format (feature .key )
363
362
self .logger .debug (message )
364
363
decide_reasons .append (message )
365
364
return Decision (None , None , enums .DecisionSources .ROLLOUT ), decide_reasons
366
365
366
+ rollout_rules = project_config .get_rollout_experiments (rollout )
367
+
368
+ if not rollout_rules :
369
+ message = 'Rollout {} has no experiments.' .format (rollout .id )
370
+ self .logger .debug (message )
371
+ decide_reasons .append (message )
372
+ return Decision (None , None , enums .DecisionSources .ROLLOUT ), decide_reasons
373
+
367
374
index = 0
368
375
while index < len (rollout_rules ):
369
376
skip_to_everyone_else = False
@@ -478,4 +485,7 @@ def get_variation_for_feature(self, project_config, feature, user_context, optio
478
485
message = 'User "{}" is not bucketed into any of the experiments on the feature "{}".' .format (
479
486
user_context .user_id , feature .key )
480
487
self .logger .debug (message )
481
- return self .get_variation_for_rollout (project_config , feature , user_context )
488
+ variation , rollout_variation_reasons = self .get_variation_for_rollout (project_config , feature , user_context )
489
+ if rollout_variation_reasons :
490
+ decide_reasons += rollout_variation_reasons
491
+ return variation , decide_reasons
0 commit comments