Skip to content

Commit

Permalink
feat(nimbus): add self testing qa statuses
Browse files Browse the repository at this point in the history
Becuase

* We want to better support feature owning teams with testing their own features
* We also want to track when a team has tested their own feature to understand which features have any testing vs no testing

This commit

* Adds QA statuses for self testing with red, yellow, and green states

fixes #12146
  • Loading branch information
jaredlockhart committed Feb 21, 2025
1 parent 1f8c38d commit a34ce06
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 11 deletions.
9 changes: 6 additions & 3 deletions experimenter/experimenter/experiments/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,12 @@ class Takeaways(models.TextChoices):
)

class QAStatus(models.TextChoices):
RED = "RED"
YELLOW = "YELLOW"
GREEN = "GREEN"
RED = ("RED", "QA: Red")
YELLOW = ("YELLOW", "QA: Yellow")
GREEN = ("GREEN", "QA: Green")
SELF_RED = ("SELF RED", "Self QA: Red")
SELF_YELLOW = ("SELF YELLOW", "Self QA: Yellow")
SELF_GREEN = ("SELF GREEN", "Self QA: Green")
NOT_SET = "NOT SET"

APPLICATION_CONFIGS = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 5.1.5 on 2025-02-21 20:45

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("experiments", "0277_nimbusexperiment_firefox_labs_description_links"),
]

operations = [
migrations.AlterField(
model_name="nimbusexperiment",
name="qa_status",
field=models.CharField(
choices=[
("RED", "QA: Red"),
("YELLOW", "QA: Yellow"),
("GREEN", "QA: Green"),
("SELF RED", "Self QA: Red"),
("SELF YELLOW", "Self QA: Yellow"),
("SELF GREEN", "Self QA: Green"),
("NOT SET", "Not Set"),
],
default="NOT SET",
max_length=255,
verbose_name="QA Status",
),
),
]
3 changes: 3 additions & 0 deletions experimenter/experimenter/nimbus-ui/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ enum NimbusExperimentQAStatusEnum {
RED
YELLOW
GREEN
SELF_RED
SELF_YELLOW
SELF_GREEN
NOT_SET
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,26 @@ export const QAEditor = ({
description:
QA_STATUS_PROPERTIES[NimbusExperimentQAStatusEnum.GREEN].description,
},
{
label: NimbusExperimentQAStatusEnum.SELF_RED,
value: NimbusExperimentQAStatusEnum.SELF_RED,
description:
QA_STATUS_PROPERTIES[NimbusExperimentQAStatusEnum.SELF_RED].description,
},
{
label: NimbusExperimentQAStatusEnum.SELF_YELLOW,
value: NimbusExperimentQAStatusEnum.SELF_YELLOW,
description:
QA_STATUS_PROPERTIES[NimbusExperimentQAStatusEnum.SELF_YELLOW]
.description,
},
{
label: NimbusExperimentQAStatusEnum.SELF_GREEN,
value: NimbusExperimentQAStatusEnum.SELF_GREEN,
description:
QA_STATUS_PROPERTIES[NimbusExperimentQAStatusEnum.SELF_GREEN]
.description,
},
] as const;

const onClickCancel = useCallback(
Expand Down
15 changes: 15 additions & 0 deletions experimenter/experimenter/nimbus-ui/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,21 @@ export const QA_STATUS_PROPERTIES: Record<
description: "❌ QA: Red",
className: "danger",
},
[NimbusExperimentQAStatusEnum.SELF_GREEN]: {
emoji: "✅",
description: "✅ Self QA: Green",
className: "success",
},
[NimbusExperimentQAStatusEnum.SELF_YELLOW]: {
emoji: "⚠️",
description: "⚠️ Self QA: Yellow",
className: "text-dark",
},
[NimbusExperimentQAStatusEnum.SELF_RED]: {
emoji: "❌",
description: "❌ Self QA: Red",
className: "danger",
},
[NimbusExperimentQAStatusEnum.NOT_SET]: {
emoji: "⌛️",
description: "⌛️ QA: Not set",
Expand Down
3 changes: 3 additions & 0 deletions experimenter/experimenter/nimbus-ui/src/types/globalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ export enum NimbusExperimentQAStatusEnum {
GREEN = "GREEN",
NOT_SET = "NOT_SET",
RED = "RED",
SELF_GREEN = "SELF_GREEN",
SELF_RED = "SELF_RED",
SELF_YELLOW = "SELF_YELLOW",
YELLOW = "YELLOW",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4 class="mb-0">Quality Assurance</h4>
<tbody>
<tr>
<th>QA Status</th>
<td colspan="3">{{ experiment.qa_status|format_not_set|title }}</td>
<td colspan="3">{{ experiment.get_qa_status_display }}</td>
</tr>
<tr>
<th>QA Comment</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ <h1 class="modal-title fs-5" id="createModalLabel">
{% endif %}
</th>
<td>
{% if experiment.qa_status == 'NOT SET' %}<i class="fa-regular fa-circle-question"></i>{% endif %}
{% if experiment.qa_status == 'GREEN' %}
<span class="text-success"><i class="fa-regular fa-circle-check"></i></span>
{% endif %}
{% if experiment.qa_status == 'YELLOW' %}
{% if experiment.qa_status == experiment.QAStatus.NOT_SET %}
<i class="fa-regular fa-circle-question"></i>
{% elif experiment.qa_status == experiment.QAStatus.GREEN or experiment.qa_status == experiment.QAStatus.SELF_GREEN %}
<span class="text-success">
<i class="fa-regular fa-circle-check"></i>
</span>
{% elif experiment.qa_status == experiment.QAStatus.YELLOW or experiment.qa_status == experiment.QAStatus.SELF_YELLOW %}
<span class="text-warning"><i class="fa-regular fa-circle-pause"></i></span>
{% endif %}
{% if experiment.qa_status == 'RED' %}
{% elif experiment.qa_status == experiment.QAStatus.RED or experiment.qa_status == experiment.QAStatus.SELF_RED %}
<span class="text-danger"><i class="fa-regular fa-circle-xmark"></i></span>
{% endif %}
</td>
Expand Down

0 comments on commit a34ce06

Please sign in to comment.