Skip to content

feat(api): Feature variable APIs return default variable value when featureEnabled property is false. #162

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 3 commits into from
Apr 1, 2019

Conversation

rashidsp
Copy link
Contributor

@rashidsp rashidsp commented Mar 26, 2019

Summary

  • Feature variable APIs now return default variable value when featureEnabled property is false.
  • Updated rubocop configuration to fix Metrics/BlockNesting error.

Test plan

  • Added unit tests.

@coveralls
Copy link

coveralls commented Mar 26, 2019

Coverage Status

Coverage increased (+5.0e-05%) to 99.949% when pulling fe07d30 on rashid/feature-enable-checking into 511b93d on master.

@rashidsp rashidsp requested a review from a team March 26, 2019 15:54
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.

Please correct the log message. Otherwise it looks good.

@@ -473,7 +473,7 @@ def get_feature_variable_for_type(feature_flag_key, variable_key, variable_type,
variation = decision['variation']
variation_variable_usages = @config.variation_id_to_variable_usage_map[variation['id']]
variable_id = variable['id']
if variation_variable_usages&.key?(variable_id)
if variation['featureEnabled'] && variation_variable_usages&.key?(variable_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the log message in the else clause is incorrect for this new scenario. It should be the log message in the else clause for decision (above). Please update accordingly.

@rashidsp rashidsp requested a review from aliabbasrizvi March 28, 2019 07:11
@aliabbasrizvi aliabbasrizvi merged commit 5f45ea9 into master Apr 1, 2019
@aliabbasrizvi aliabbasrizvi deleted the rashid/feature-enable-checking branch April 1, 2019 16:52
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.

3 participants