Skip to content

fix(logs): Fixing log messages #259

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 13 commits into from
Jul 21, 2020
Merged

Conversation

oakbani
Copy link
Contributor

@oakbani oakbani commented Jul 6, 2020

Summary

  • This PR modifies log messages to be explicit when it's evaluating an experiment and when it's doing so for a Rollout.

Test plan

  • Added additional unit test to assert audience logs for rollouts.
  • Existing tests should continue to pass.

@oakbani oakbani requested a review from a team as a code owner July 6, 2020 10:41
@oakbani oakbani removed their assignment Jul 6, 2020
@coveralls
Copy link

coveralls commented Jul 6, 2020

Coverage Status

Coverage decreased (-0.001%) to 99.566% when pulling 9cb09f8 on oakbani/targeted-rollout-level into 41afc38 on master.

@oakbani oakbani changed the title fix(logs): Fixing log messages for Targeted Rollouts fix(logs): Fixing log messages Jul 8, 2020
@msohailhussain msohailhussain removed their assignment Jul 8, 2020
Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

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

Some more changes for variable evaluation logs.

@@ -810,7 +810,7 @@ def get_feature_variable_for_variation(feature_flag_key, feature_enabled, variat
end
else
@logger.log(Logger::DEBUG,
"Feature '#{feature_flag_key}' for variation '#{variation['key']}' is not enabled. Returning the default variable value '#{variable_value}'.")
"Feature '#{feature_flag_key}' is not enabled for user '#{user_id}'. Returning the default variable value '#{variable_value}'.")
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes are incomplete here.

On line 809 it should say Variable value is not defined. Returning the default variable value <variable value> for variable <variable key>

On line 916 it should say User <user ID> was not bucketed into experiment or rollout for feature flag <feature flag key>. Returning the default variable value <variable value>

def user_in_experiment?(config, experiment, attributes, logger)
# Determine for given experiment if user satisfies the audiences for the experiment.
def user_meets_audience_conditions?(config, experiment, attributes, logger, logging_hash = nil, logging_key = nil)
# Determine for given experiment/rollout rule if user satisfies the audiences.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. satisfies the audience conditions.

#
# config - Representation of the Optimizely project config.
# experiment - Experiment for which visitor is to be bucketed.
# experiment - Experiment/Rollout rule for which visitor is to be bucketed.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. ...in which user is to be bucketed

@oakbani oakbani requested a review from aliabbasrizvi July 10, 2020 06:32
Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

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

Looks good.

@aliabbasrizvi aliabbasrizvi merged commit e532857 into master Jul 21, 2020
@aliabbasrizvi aliabbasrizvi deleted the oakbani/targeted-rollout-level branch July 21, 2020 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants