Skip to content

Commit

Permalink
fix #6625 feat(nimbus): Add isRollout to v6 api
Browse files Browse the repository at this point in the history
  • Loading branch information
Elise Richards committed Jul 7, 2022
1 parent add8239 commit fa1c0da
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/experimenter/docs/openapi-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3040,6 +3040,10 @@
"type": "string",
"readOnly": true
},
"isRollout": {
"type": "string",
"readOnly": true
},
"bucketConfig": {
"type": "object",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions app/experimenter/docs/swagger-ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -3052,6 +3052,10 @@
"type": "string",
"readOnly": true
},
"isRollout": {
"type": "string",
"readOnly": true
},
"bucketConfig": {
"type": "object",
"properties": {
Expand Down
2 changes: 2 additions & 0 deletions app/experimenter/experiments/api/v6/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class NimbusExperimentSerializer(serializers.ModelSerializer):
userFacingName = serializers.ReadOnlyField(source="name")
userFacingDescription = serializers.ReadOnlyField(source="public_description")
isEnrollmentPaused = serializers.ReadOnlyField(source="is_paused")
isRollout = serializers.ReadOnlyField(source="is_rollout")
bucketConfig = NimbusBucketRangeSerializer(source="bucket_range")
featureIds = serializers.SerializerMethodField()
probeSets = serializers.ReadOnlyField(default=[])
Expand All @@ -138,6 +139,7 @@ class Meta:
"userFacingName",
"userFacingDescription",
"isEnrollmentPaused",
"isRollout",
"bucketConfig",
"featureIds",
"probeSets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_expected_schema_with_desktop_single_feature(self):
"endDate": experiment.end_date.isoformat().replace("+00:00", "Z"),
"id": experiment.slug,
"isEnrollmentPaused": True,
"isRollout": False,
"proposedDuration": experiment.proposed_duration,
"proposedEnrollment": experiment.proposed_enrollment,
"referenceBranch": experiment.reference_branch.slug,
Expand Down Expand Up @@ -117,7 +118,6 @@ def test_expected_schema_with_desktop_multifeature(self):
primary_outcomes=["foo", "bar", "baz"],
secondary_outcomes=["quux", "xyzzy"],
)

serializer = NimbusExperimentSerializer(experiment)
experiment_data = serializer.data.copy()
bucket_data = dict(experiment_data.pop("bucketConfig"))
Expand All @@ -142,6 +142,7 @@ def test_expected_schema_with_desktop_multifeature(self):
"endDate": experiment.end_date.isoformat().replace("+00:00", "Z"),
"id": experiment.slug,
"isEnrollmentPaused": True,
"isRollout": False,
"proposedDuration": experiment.proposed_duration,
"proposedEnrollment": experiment.proposed_enrollment,
"referenceBranch": experiment.reference_branch.slug,
Expand Down

0 comments on commit fa1c0da

Please sign in to comment.