Skip to content
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

fix #6625 feat(nimbus): Add isRollout to v6 api #7476

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

eliserichards
Copy link

@eliserichards eliserichards commented Jun 30, 2022

Because...

This commit...

  • adds isRollout to the v6 API so that it can be accessed by jetstream/clients

#6625

@@ -3040,6 +3040,10 @@
"type": "string",
"readOnly": true
},
"isRollout": {
"type": "string",
Copy link
Author

Choose a reason for hiding this comment

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

Question: should this be string or boolean? I was going off the example of isEnrollmentPaused right above, which is boolean other places but string here 🤔

Copy link
Member

@freshstrangemusic freshstrangemusic Jun 30, 2022

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah that's a bit wonky. We should look into that separately.

Copy link
Contributor

@yashika-khurana yashika-khurana left a comment

Choose a reason for hiding this comment

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

LGTM, 🎉 Might be worth considering a test case with isRollout set to True

Copy link
Contributor

@yashika-khurana yashika-khurana left a comment

Choose a reason for hiding this comment

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

🎉 🎉 🎉 🚀

Copy link
Collaborator

@jaredlockhart jaredlockhart left a comment

Choose a reason for hiding this comment

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

Approved thnx @eliserichards ! You can probably take those two extra test cases out but up to you.

Comment on lines 400 to 426
def test_serializer_rollouts_true(self):
experiment = NimbusExperimentFactory.create_with_lifecycle(
NimbusExperimentFactory.Lifecycles.LAUNCH_APPROVE,
publish_status=NimbusExperiment.PublishStatus.APPROVED,
targeting_config_slug=NimbusExperiment.TargetingConfig.NO_TARGETING,
application=NimbusExperiment.Application.FENIX,
firefox_min_version=NimbusExperiment.Version.FIREFOX_94,
is_rollout=True,
)

serializer = NimbusExperimentSerializer(experiment)
self.assertEqual(serializer.data["isRollout"], True)
check_schema("experiments/NimbusExperiment", serializer.data)

def test_serializer_rollouts_false(self):
experiment = NimbusExperimentFactory.create_with_lifecycle(
NimbusExperimentFactory.Lifecycles.LAUNCH_APPROVE,
publish_status=NimbusExperiment.PublishStatus.APPROVED,
targeting_config_slug=NimbusExperiment.TargetingConfig.NO_TARGETING,
application=NimbusExperiment.Application.FENIX,
firefox_min_version=NimbusExperiment.Version.FIREFOX_94,
is_rollout=False,
)

serializer = NimbusExperimentSerializer(experiment)
self.assertEqual(serializer.data["isRollout"], False)
check_schema("experiments/NimbusExperiment", serializer.data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need these tests, the field is using entirely built in serializer functionality so just updating the above tests that the field is included should be sufficient.

@@ -3040,6 +3040,10 @@
"type": "string",
"readOnly": true
},
"isRollout": {
"type": "string",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah that's a bit wonky. We should look into that separately.

@eliserichards eliserichards enabled auto-merge (squash) July 7, 2022 19:52
@eliserichards eliserichards merged commit 3f9c3c0 into mozilla:main Jul 7, 2022
@eliserichards eliserichards deleted the 6625 branch February 6, 2024 22:17
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