From 14a9f6e7e1bbe18e8630c96a60679e83aed340eb Mon Sep 17 00:00:00 2001 From: Jared Lockhart <119884+jaredlockhart@users.noreply.github.com> Date: Tue, 14 Jul 2020 16:35:57 -0400 Subject: [PATCH] Connect firefox version to V3 API fixes #3042 --- app/experimenter/docs/openapi-schema.json | 1040 ++++++++++++++--- app/experimenter/docs/swagger-ui.html | 1040 ++++++++++++++--- .../experiments/api/v3/serializers.py | 18 +- .../tests/api/v3/test_serializers.py | 70 +- .../experiments/tests/api/v3/test_views.py | 10 + .../static/rapid/__tests__/app.test.tsx | 1 + .../__tests__/experimentDetails.test.tsx | 4 + .../rapid/__tests__/experimentForm.test.tsx | 7 +- .../experiments/ExperimentDetails.tsx | 9 +- .../rapid/components/forms/ExperimentForm.tsx | 21 +- .../forms/ExperimentFormOptions.tsx | 27 + .../rapid/contexts/experiment/context.ts | 1 + .../static/rapid/types/experiment.ts | 1 + 13 files changed, 1840 insertions(+), 409 deletions(-) diff --git a/app/experimenter/docs/openapi-schema.json b/app/experimenter/docs/openapi-schema.json index 2c488e9ac73..80588d5406b 100644 --- a/app/experimenter/docs/openapi-schema.json +++ b/app/experimenter/docs/openapi-schema.json @@ -7613,43 +7613,94 @@ "application/json": { "schema": { "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -7680,12 +7731,11 @@ "application/json": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7693,30 +7743,81 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "application/x-www-form-urlencoded": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7724,30 +7825,81 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "multipart/form-data": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7755,66 +7907,169 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" - ] - } - }, - "required": [ - "name", - "objectives", - "features", - "audience" - ] - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" + ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + } + }, + "required": [ + "audience", + "features", + "firefox_min_version", + "name", + "objectives" + ] + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -7845,12 +8100,11 @@ "application/json": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7858,11 +8112,62 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } } } @@ -7870,12 +8175,11 @@ "application/x-www-form-urlencoded": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7883,11 +8187,62 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } } } @@ -7895,12 +8250,11 @@ "multipart/form-data": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7908,11 +8262,62 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } } } @@ -7925,43 +8330,94 @@ "application/json": { "schema": { "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -7984,43 +8440,93 @@ "application/json": { "schema": { "properties": { + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] + }, + "features": { + "type": "array", + "items": { + "type": null + } + }, + "firefox_min_version": { + "enum": [ + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" + ] + }, "name": { "type": "string", "maxLength": 255 }, "objectives": { "type": "string" - }, - "features": { - "type": "array", - "items": { - "type": null - } - }, - "audience": { - "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" - ] } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "application/x-www-form-urlencoded": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -8028,30 +8534,81 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "multipart/form-data": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -8059,18 +8616,70 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -8082,43 +8691,94 @@ "application/json": { "schema": { "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } diff --git a/app/experimenter/docs/swagger-ui.html b/app/experimenter/docs/swagger-ui.html index 677cd9964e4..637f6eeebab 100644 --- a/app/experimenter/docs/swagger-ui.html +++ b/app/experimenter/docs/swagger-ui.html @@ -7625,43 +7625,94 @@ "application/json": { "schema": { "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -7692,12 +7743,11 @@ "application/json": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7705,30 +7755,81 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "application/x-www-form-urlencoded": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7736,30 +7837,81 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "multipart/form-data": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7767,66 +7919,169 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" - ] - } - }, - "required": [ - "name", - "objectives", - "features", - "audience" - ] - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" + ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + } + }, + "required": [ + "audience", + "features", + "firefox_min_version", + "name", + "objectives" + ] + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -7857,12 +8112,11 @@ "application/json": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7870,11 +8124,62 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } } } @@ -7882,12 +8187,11 @@ "application/x-www-form-urlencoded": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7895,11 +8199,62 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } } } @@ -7907,12 +8262,11 @@ "multipart/form-data": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -7920,11 +8274,62 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } } } @@ -7937,43 +8342,94 @@ "application/json": { "schema": { "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -7996,43 +8452,93 @@ "application/json": { "schema": { "properties": { + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] + }, + "features": { + "type": "array", + "items": { + "type": null + } + }, + "firefox_min_version": { + "enum": [ + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" + ] + }, "name": { "type": "string", "maxLength": 255 }, "objectives": { "type": "string" - }, - "features": { - "type": "array", - "items": { - "type": null - } - }, - "audience": { - "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" - ] } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "application/x-www-form-urlencoded": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -8040,30 +8546,81 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } }, "multipart/form-data": { "schema": { "properties": { - "name": { - "type": "string", - "maxLength": 255 - }, - "objectives": { - "type": "string" + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, "features": { "type": "array", @@ -8071,18 +8628,70 @@ "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] + }, + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } @@ -8094,43 +8703,94 @@ "application/json": { "schema": { "properties": { - "owner": { - "type": "string", - "readOnly": true - }, - "name": { - "type": "string", - "maxLength": 255 + "audience": { + "enum": [ + "AUDIENCE 1", + "AUDIENCE 2" + ] }, - "slug": { + "bugzilla_url": { "type": "string", "readOnly": true }, - "objectives": { - "type": "string" - }, "features": { "type": "array", "items": { "type": null } }, - "audience": { + "firefox_min_version": { "enum": [ - "AUDIENCE 1", - "AUDIENCE 2" + "55.0", + "56.0", + "57.0", + "58.0", + "59.0", + "60.0", + "61.0", + "62.0", + "63.0", + "64.0", + "65.0", + "66.0", + "67.0", + "68.0", + "69.0", + "70.0", + "71.0", + "72.0", + "73.0", + "74.0", + "75.0", + "76.0", + "77.0", + "78.0", + "79.0", + "80.0", + "81.0", + "82.0", + "83.0", + "84.0", + "85.0", + "86.0", + "87.0", + "88.0", + "89.0", + "90.0", + "91.0", + "92.0", + "93.0", + "94.0", + "95.0", + "96.0", + "97.0", + "98.0", + "99.0", + "100.0" ] }, - "bugzilla_url": { + "name": { + "type": "string", + "maxLength": 255 + }, + "objectives": { + "type": "string" + }, + "owner": { + "type": "string", + "readOnly": true + }, + "slug": { "type": "string", "readOnly": true } }, "required": [ - "name", - "objectives", + "audience", "features", - "audience" + "firefox_min_version", + "name", + "objectives" ] } } diff --git a/app/experimenter/experiments/api/v3/serializers.py b/app/experimenter/experiments/api/v3/serializers.py index 42df5077778..2c1f36aadf8 100644 --- a/app/experimenter/experiments/api/v3/serializers.py +++ b/app/experimenter/experiments/api/v3/serializers.py @@ -24,20 +24,24 @@ class ExperimentRapidSerializer(ChangelogSerializerMixin, serializers.ModelSeria required=True, choices=Experiment.RAPID_AUDIENCE_CHOICES ) bugzilla_url = serializers.ReadOnlyField() + firefox_min_version = serializers.ChoiceField( + required=True, choices=Experiment.VERSION_CHOICES, + ) class Meta: model = Experiment fields = ( - "type", - "rapid_type", - "owner", + "audience", + "bugzilla_url", + "features", + "firefox_min_version", "name", - "slug", "objectives", + "owner", "public_description", - "features", - "audience", - "bugzilla_url", + "rapid_type", + "slug", + "type", ) def validate(self, data): diff --git a/app/experimenter/experiments/tests/api/v3/test_serializers.py b/app/experimenter/experiments/tests/api/v3/test_serializers.py index d5698085f0a..3c97a4de3e4 100644 --- a/app/experimenter/experiments/tests/api/v3/test_serializers.py +++ b/app/experimenter/experiments/tests/api/v3/test_serializers.py @@ -9,6 +9,9 @@ from experimenter.bugzilla.tests.mixins import MockBugzillaTasksMixin +firefox_min_version = Experiment.VERSION_CHOICES[0][0] + + class TestExperimentRapidSerializer(MockRequestMixin, MockBugzillaTasksMixin, TestCase): def test_serializer_outputs_expected_schema(self): owner = UserFactory(email="owner@example.com") @@ -21,6 +24,7 @@ def test_serializer_outputs_expected_schema(self): objectives="gotta go fast", audience="AUDIENCE 1", features=["FEATURE 1"], + firefox_min_version=firefox_min_version, ) serializer = ExperimentRapidSerializer(experiment) @@ -37,16 +41,17 @@ def test_serializer_outputs_expected_schema(self): "bugzilla_url": "{bug_host}show_bug.cgi?id={bug_id}".format( bug_host=settings.BUGZILLA_HOST, bug_id=experiment.bugzilla_id ), + "firefox_min_version": firefox_min_version, }, ) def test_serializer_required_fields(self): serializer = ExperimentRapidSerializer(data={}, context={"request": self.request}) self.assertFalse(serializer.is_valid()) - self.assertIn("name", serializer.errors) - self.assertIn("objectives", serializer.errors) - self.assertIn("audience", serializer.errors) - self.assertIn("features", serializer.errors) + self.assertEqual( + set(serializer.errors.keys()), + set(["name", "objectives", "audience", "features", "firefox_min_version"]), + ) def test_serializer_bad_audience_value(self): data = { @@ -54,6 +59,7 @@ def test_serializer_bad_audience_value(self): "objectives": "gotta go fast", "audience": " WRONG AUDIENCE CHOICE", "features": ["FEATURE 1", "FEATURE 2"], + "firefox_min_version": firefox_min_version, } serializer = ExperimentRapidSerializer( data=data, context={"request": self.request} @@ -67,6 +73,7 @@ def test_serializer_bad_feature_value(self): "objectives": "gotta go fast", "audience": "AUDIENCE 1", "features": ["WRONG FEATURE 1", "WRONG FEATURE 2"], + "firefox_min_version": firefox_min_version, } serializer = ExperimentRapidSerializer( data=data, context={"request": self.request} @@ -74,13 +81,27 @@ def test_serializer_bad_feature_value(self): self.assertFalse(serializer.is_valid()) self.assertIn("features", serializer.errors) - def test_serializer_creates_experiment_and_sets_slug_and_changelog(self): + def test_serializer_bad_firefox_min_version_value(self): + data = { + "name": "rapid experiment", + "objectives": "gotta go fast", + "audience": "AUDIENCE 1", + "features": ["FEATURE 1", "FEATURE 2"], + "firefox_min_version": "invalid version", + } + serializer = ExperimentRapidSerializer( + data=data, context={"request": self.request} + ) + self.assertFalse(serializer.is_valid()) + self.assertIn("firefox_min_version", serializer.errors) + def test_serializer_creates_experiment_and_sets_slug_and_changelog(self): data = { "name": "rapid experiment", "objectives": "gotta go fast", "audience": "AUDIENCE 1", "features": ["FEATURE 1", "FEATURE 2"], + "firefox_min_version": firefox_min_version, } serializer = ExperimentRapidSerializer( @@ -95,6 +116,9 @@ def test_serializer_creates_experiment_and_sets_slug_and_changelog(self): self.assertEqual(experiment.name, "rapid experiment") self.assertEqual(experiment.slug, "rapid-experiment") self.assertEqual(experiment.objectives, "gotta go fast") + self.assertEqual(experiment.audience, "AUDIENCE 1") + self.assertEqual(experiment.features, ["FEATURE 1", "FEATURE 2"]) + self.assertEqual(experiment.firefox_min_version, firefox_min_version) self.assertEqual( experiment.public_description, Experiment.BUGZILLA_RAPID_EXPERIMENT_TEMPLATE ) @@ -135,6 +159,11 @@ def test_serializer_creates_experiment_and_sets_slug_and_changelog(self): "new_value": ["FEATURE 1", "FEATURE 2"], "old_value": None, }, + "firefox_min_version": { + "display_name": "Firefox Min Version", + "new_value": firefox_min_version, + "old_value": None, + }, } self.assertTrue( experiment.changes.filter( @@ -156,6 +185,7 @@ def test_serializer_creates_changelog_for_updates(self): objectives="gotta go fast", audience="AUDIENCE 1", features=["FEATURE 1"], + firefox_min_version=firefox_min_version, public_description=Experiment.BUGZILLA_RAPID_EXPERIMENT_TEMPLATE, ) @@ -163,8 +193,9 @@ def test_serializer_creates_changelog_for_updates(self): data = { "name": "changing the name", "objectives": "changing objectives", - "audience": "AUDIENCE 1", - "features": ["FEATURE 1"], + "audience": "AUDIENCE 2", + "features": ["FEATURE 2"], + "firefox_min_version": Experiment.VERSION_CHOICES[1][0], } serializer = ExperimentRapidSerializer( instance=experiment, data=data, context={"request": self.request} @@ -175,14 +206,29 @@ def test_serializer_creates_changelog_for_updates(self): changed_values = { "name": { + "display_name": "Name", "new_value": "changing the name", "old_value": "rapid experiment", - "display_name": "Name", }, "objectives": { + "display_name": "Objectives", "new_value": "changing objectives", "old_value": "gotta go fast", - "display_name": "Objectives", + }, + "audience": { + "display_name": "Audience", + "new_value": "AUDIENCE 2", + "old_value": "AUDIENCE 1", + }, + "features": { + "display_name": "Features", + "new_value": ["FEATURE 2"], + "old_value": ["FEATURE 1"], + }, + "firefox_min_version": { + "display_name": "Firefox Min Version", + "new_value": Experiment.VERSION_CHOICES[1][0], + "old_value": firefox_min_version, }, } self.assertTrue( @@ -194,12 +240,12 @@ def test_serializer_creates_changelog_for_updates(self): ) def test_serializer_returns_errors_for_non_alpha_numeric_name(self): - data = { "name": "!!!!!!!!!!!!!!!", "objectives": "gotta go fast", "audience": "AUDIENCE 1", "features": ["FEATURE 1", "FEATURE 2"], + "firefox_min_version": firefox_min_version, } serializer = ExperimentRapidSerializer( @@ -211,7 +257,6 @@ def test_serializer_returns_errors_for_non_alpha_numeric_name(self): ) def test_serializer_returns_error_for_non_unique_slug(self): - ExperimentFactory.create(name="non unique slug", slug="non-unique-slug") data = { @@ -219,6 +264,7 @@ def test_serializer_returns_error_for_non_unique_slug(self): "objectives": "gotta go fast", "audience": "AUDIENCE 1", "features": ["FEATURE 1", "FEATURE 2"], + "firefox_min_version": firefox_min_version, } serializer = ExperimentRapidSerializer( @@ -231,7 +277,6 @@ def test_serializer_returns_error_for_non_unique_slug(self): ) def test_serializer_update_experiment_does_not_throw_slug_err(self): - experiment = ExperimentFactory.create( name="non unique slug", slug="non-unique-slug" ) @@ -241,6 +286,7 @@ def test_serializer_update_experiment_does_not_throw_slug_err(self): "objectives": "gotta go fast", "audience": "AUDIENCE 1", "features": ["FEATURE 1", "FEATURE 2"], + "firefox_min_version": firefox_min_version, } serializer = ExperimentRapidSerializer( diff --git a/app/experimenter/experiments/tests/api/v3/test_views.py b/app/experimenter/experiments/tests/api/v3/test_views.py index 77efb7af32c..7ab8ac86ce5 100644 --- a/app/experimenter/experiments/tests/api/v3/test_views.py +++ b/app/experimenter/experiments/tests/api/v3/test_views.py @@ -58,6 +58,7 @@ def test_post_detail_edits_rapid_experiment(self): user_email = "user@example.com" audience = Experiment.RAPID_AUDIENCE_CHOICES[0][1] features = [feature[0] for feature in Experiment.RAPID_FEATURE_CHOICES] + firefox_min_version = Experiment.VERSION_CHOICES[0][0] owner = UserFactory(email=user_email) experiment = ExperimentFactory.create( @@ -76,6 +77,7 @@ def test_post_detail_edits_rapid_experiment(self): "objectives": "new hypothesis", "audience": audience, "features": features, + "firefox_min_version": firefox_min_version, } ) @@ -92,11 +94,15 @@ def test_post_detail_edits_rapid_experiment(self): self.assertEqual(experiment.name, "new name") self.assertEqual(experiment.slug, "rapid-experiment") self.assertEqual(experiment.objectives, "new hypothesis") + self.assertEqual(experiment.audience, audience) + self.assertEqual(experiment.features, features) + self.assertEqual(experiment.firefox_min_version, firefox_min_version) def test_post_list_creates_rapid_experiment(self): user_email = "user@example.com" audience = Experiment.RAPID_AUDIENCE_CHOICES[0][1] features = [feature[0] for feature in Experiment.RAPID_FEATURE_CHOICES] + firefox_min_version = Experiment.VERSION_CHOICES[0][0] data = json.dumps( { @@ -104,6 +110,7 @@ def test_post_list_creates_rapid_experiment(self): "objectives": "gotta go fast", "audience": audience, "features": features, + "firefox_min_version": firefox_min_version, } ) @@ -120,3 +127,6 @@ def test_post_list_creates_rapid_experiment(self): self.assertEqual(experiment.name, "rapid experiment") self.assertEqual(experiment.slug, "rapid-experiment") self.assertEqual(experiment.objectives, "gotta go fast") + self.assertEqual(experiment.audience, audience) + self.assertEqual(experiment.features, features) + self.assertEqual(experiment.firefox_min_version, firefox_min_version) diff --git a/app/experimenter/static/rapid/__tests__/app.test.tsx b/app/experimenter/static/rapid/__tests__/app.test.tsx index a0d10af5975..2bb19f5f01a 100644 --- a/app/experimenter/static/rapid/__tests__/app.test.tsx +++ b/app/experimenter/static/rapid/__tests__/app.test.tsx @@ -62,6 +62,7 @@ describe("", () => { owner: "test@owner.com", features: ["FEATURE 1", "FEATURE 2"], audience: "AUDIENCE 1", + firefox_min_version: "78.0", }); }); diff --git a/app/experimenter/static/rapid/__tests__/experimentDetails.test.tsx b/app/experimenter/static/rapid/__tests__/experimentDetails.test.tsx index 8bbc4b7d90b..f74967e9a6f 100644 --- a/app/experimenter/static/rapid/__tests__/experimentDetails.test.tsx +++ b/app/experimenter/static/rapid/__tests__/experimentDetails.test.tsx @@ -24,6 +24,7 @@ describe("", () => { owner: "test@owner.com", features: ["FEATURE 1", "FEATURE 2"], audience: "AUDIENCE 1", + firefox_min_version: "78.0", }, }), ); @@ -46,6 +47,7 @@ describe("", () => { owner: "test@owner.com", features: ["FEATURE 1", "FEATURE 2"], audience: "AUDIENCE 1", + firefox_min_version: "78.0", bugzilla_url: "https://example.com", }, }), @@ -66,6 +68,7 @@ describe("", () => { owner: "test@owner.com", features: ["FEATURE 1", "FEATURE 2"], audience: "AUDIENCE 1", + firefox_min_version: "78.0", }, }), ); @@ -87,6 +90,7 @@ describe("", () => { owner: "test@owner.com", features: ["FEATURE 1", "FEATURE 2"], audience: "AUDIENCE 1", + firefox_min_version: "78.0", }, }), ); diff --git a/app/experimenter/static/rapid/__tests__/experimentForm.test.tsx b/app/experimenter/static/rapid/__tests__/experimentForm.test.tsx index fd65cdd0dcf..5a1481c9e81 100644 --- a/app/experimenter/static/rapid/__tests__/experimentForm.test.tsx +++ b/app/experimenter/static/rapid/__tests__/experimentForm.test.tsx @@ -88,6 +88,10 @@ describe("", () => { const audienceField = getByLabelText("Audience"); await selectEvent.select(audienceField, "AUDIENCE 2"); + // Update the firefox version field + const firefoxVersionField = getByLabelText("Firefox Minimum Version"); + await selectEvent.select(firefoxVersionField, "Firefox 78.0"); + // Click the save button fireEvent.click(getByText("Save")); @@ -104,6 +108,7 @@ describe("", () => { objectives: "test objective", audience: "AUDIENCE 2", features: ["FEATURE 1", "FEATURE 2"], + firefox_min_version: "78.0", }); }); @@ -165,7 +170,7 @@ describe("", () => { }); }); - ["name", "objectives", "features", "audience", "version"].forEach( + ["name", "objectives", "features", "audience", "firefox_min_version"].forEach( (fieldName) => { it(`shows the appropriate error message for '${fieldName}' on save`, async () => { const { getByText } = renderWithRouter( diff --git a/app/experimenter/static/rapid/components/experiments/ExperimentDetails.tsx b/app/experimenter/static/rapid/components/experiments/ExperimentDetails.tsx index ddf0904a5c4..33fcd748e34 100644 --- a/app/experimenter/static/rapid/components/experiments/ExperimentDetails.tsx +++ b/app/experimenter/static/rapid/components/experiments/ExperimentDetails.tsx @@ -4,6 +4,7 @@ import { Link } from "react-router-dom"; import { featureOptions, audienceOptions, + firefoxVersionOptions, } from "experimenter-rapid/components/forms/ExperimentFormOptions"; import { useExperimentState } from "experimenter-rapid/contexts/experiment/hooks"; @@ -75,7 +76,13 @@ const ExperimentDetails: React.FC = () => { label="Audience" value={displaySelectOptionLabels(audienceOptions, data.audience)} /> - +

Results

diff --git a/app/experimenter/static/rapid/components/forms/ExperimentForm.tsx b/app/experimenter/static/rapid/components/forms/ExperimentForm.tsx index e4b47f9fe1a..f611ae0c41c 100644 --- a/app/experimenter/static/rapid/components/forms/ExperimentForm.tsx +++ b/app/experimenter/static/rapid/components/forms/ExperimentForm.tsx @@ -10,7 +10,11 @@ import { useExperimentState, } from "experimenter-rapid/contexts/experiment/hooks"; -import { featureOptions, audienceOptions } from "./ExperimentFormOptions"; +import { + featureOptions, + audienceOptions, + firefoxVersionOptions, +} from "./ExperimentFormOptions"; import { XSelect } from "./XSelect"; interface ErrorListProperties { @@ -140,8 +144,8 @@ const ExperimentForm: React.FC = () => {

-