-
Notifications
You must be signed in to change notification settings - Fork 32
revise rollout bucketing to check audience in last rollout rule #174
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
revise rollout bucketing to check audience in last rollout rule #174
Conversation
Pull Request Test Coverage Report for Build 486
💛 - Coveralls |
// get last rule which is the fall back rule | ||
Experiment finalRule = rollout.getExperiments().get(rolloutRulesLength - 1); | ||
if (ExperimentUtils.isUserInExperiment(projectConfig, finalRule, filteredAttributes)) { | ||
variation = bucketer.bucket(finalRule, bucketingId); // ignore audience |
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.
We no longer ignore audience so this comment is incorrect
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 comment is still incorrect
@@ -217,34 +217,26 @@ public DecisionService(@Nonnull Bucketer bucketer, | |||
Variation variation; | |||
for (int i = 0; i < rolloutRulesLength - 1; i++) { | |||
Experiment rolloutRule = rollout.getExperiments().get(i); | |||
Audience audience = projectConfig.getAudienceIdMapping().get(rolloutRule.getAudienceIds().get(0)); |
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.
I think these log messages are still useful
variation = bucketer.bucket(rolloutRule, bucketingId); | ||
if (variation == null) { | ||
logger.debug("User \"{}\" was excluded due to traffic allocation.", userId); |
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 one we can definitely get rid of
break; | ||
} | ||
return new FeatureDecision(rolloutRule, variation, | ||
FeatureDecision.DecisionSource.ROLLOUT); | ||
} else { | ||
logger.debug("User \"{}\" did not meet the conditions to be in rollout rule for audience \"{}\".", |
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 is still helpful for debugging
// get last rule which is the fall back rule | ||
Experiment finalRule = rollout.getExperiments().get(rolloutRulesLength - 1); | ||
if (ExperimentUtils.isUserInExperiment(projectConfig, finalRule, filteredAttributes)) { | ||
variation = bucketer.bucket(finalRule, bucketingId); // ignore audience |
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 comment is still incorrect
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.
Passes e2e tests for feature management. I will approve as soon as you change the comment mentioned. :)
No description provided.