Skip to content

Feature Toggle #102

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 5 commits into from
Feb 22, 2018
Merged

Feature Toggle #102

merged 5 commits into from
Feb 22, 2018

Conversation

oakbani
Copy link
Contributor

@oakbani oakbani commented Feb 16, 2018

No description provided.

@optibot
Copy link

optibot commented Feb 16, 2018

Can one of the admins verify this patch?

@coveralls
Copy link

coveralls commented Feb 16, 2018

Coverage Status

Coverage increased (+0.2%) to 97.518% when pulling 3db05e8 on oakbani/feature-toggle into 56279de on master.

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -109,7 +109,8 @@ def __init__(self, id, value, **kwards):
self.id = id
self.value = value

def __init__(self, id, key, variables=None, **kwargs):
def __init__(self, id, key, featureEnabled=False, variables=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, just realized this might not work. Only feature experiments will have this property. Regular experiment variations will omit this property and you will run into a situation where the variation comes in with just id, key, and variables so you'd need to accommodate that scenario

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't be an issue. generate_key_map in project_config calls as key,value arguments.
Still, have added a new test case to test the scenario.

Copy link
Contributor

@mikeproeng37 mikeproeng37 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 mostly, please address the remaining feedback.

@@ -973,6 +985,25 @@ def test_init__with_v4_datafile(self):
self.assertEqual(expected_rollout_id_map, project_config.rollout_id_map)
self.assertEqual(expected_variation_variable_usage_map, project_config.variation_variable_usage_map)

def test_variation_has_featureEnabled_false_if_prop_undefined(self):
""" Test that featureEnabled property by default is set to False, when not given in the data file"""
variation = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please indent this correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean 4 space indent? The whole file right now is on a 2 space indent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm github just shows it weird. See how line 1003 (the closing bracket) does not match the indentation of the opening bracket on line 990

}]}

variation_entity = entities.Variation(**variation)
self.assertFalse(variation_entity.featureEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also assert that the rest of the properties are properly populated?

@mikeproeng37
Copy link
Contributor

build

Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

lgtm

@mikeproeng37
Copy link
Contributor

build

@mikeproeng37 mikeproeng37 merged commit 7fd816b into master Feb 22, 2018
@oakbani oakbani deleted the oakbani/feature-toggle branch February 23, 2018 11:14
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.

4 participants