From 084fa55148764354f4851b3f3e659410fd044407 Mon Sep 17 00:00:00 2001 From: octavian-negru <53253211+octavian-negru@users.noreply.github.com> Date: Tue, 22 Oct 2019 09:16:10 +0300 Subject: [PATCH] Bug 1582108 - Completely remove confirming state --- .../webapp/api/test_performance_alerts_api.py | 2 +- .../0019_remove_confirming_state.py | 25 +++++++++++++++++++ treeherder/perf/models.py | 13 +++------- 3 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 treeherder/perf/migrations/0019_remove_confirming_state.py diff --git a/tests/webapp/api/test_performance_alerts_api.py b/tests/webapp/api/test_performance_alerts_api.py index 28870445d..3d2a20193 100644 --- a/tests/webapp/api/test_performance_alerts_api.py +++ b/tests/webapp/api/test_performance_alerts_api.py @@ -530,7 +530,7 @@ def test_alert_timestamps_via_endpoint(authorized_sheriff_client, test_sheriff, # keeps first_triaged the same authorized_sheriff_client.force_authenticate(user=test_sheriff) resp = authorized_sheriff_client.put(reverse('performance-alerts-list') + '1/', - {'status': PerformanceAlert.CONFIRMING}) + {'status': PerformanceAlert.ACKNOWLEDGED}) assert resp.status_code == 200 test_perf_alert.refresh_from_db() diff --git a/treeherder/perf/migrations/0019_remove_confirming_state.py b/treeherder/perf/migrations/0019_remove_confirming_state.py new file mode 100644 index 000000000..daa557582 --- /dev/null +++ b/treeherder/perf/migrations/0019_remove_confirming_state.py @@ -0,0 +1,25 @@ +# Generated by Django 2.2.6 on 2019-10-14 14:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('perf', '0018_add_measurement_units'), + ] + + operations = [ + migrations.AlterField( + model_name='performancealert', + name='status', + field=models.IntegerField( + choices=[(0, 'Untriaged'), (1, 'Downstream'), (2, 'Reassigned'), (3, 'Invalid'), (4, 'Acknowledged')], + default=0), + ), + migrations.AlterField( + model_name='performancealertsummary', + name='status', + field=models.IntegerField(choices=[(0, 'Untriaged'), (1, 'Downstream'), (2, 'Reassigned'), (3, 'Invalid'), (4, 'Improvement'), (5, 'Investigating'), (6, "Won't fix"), (7, 'Fixed'), (8, 'Backed out')], default=0), + ), + ] diff --git a/treeherder/perf/models.py b/treeherder/perf/models.py index 89ea4b6d0..929c93787 100644 --- a/treeherder/perf/models.py +++ b/treeherder/perf/models.py @@ -278,7 +278,6 @@ class PerformanceAlertSummary(models.Model): WONTFIX = 6 FIXED = 7 BACKED_OUT = 8 - CONFIRMING = 9 STATUSES = ((UNTRIAGED, 'Untriaged'), (DOWNSTREAM, 'Downstream'), @@ -288,8 +287,7 @@ class PerformanceAlertSummary(models.Model): (INVESTIGATING, 'Investigating'), (WONTFIX, 'Won\'t fix'), (FIXED, 'Fixed'), - (BACKED_OUT, 'Backed out'), - (CONFIRMING, 'Confirming')) + (BACKED_OUT, 'Backed out')) status = models.IntegerField(choices=STATUSES, default=UNTRIAGED) @@ -330,9 +328,6 @@ class PerformanceAlertSummary(models.Model): if any(alert.status == PerformanceAlert.UNTRIAGED for alert in alerts): return PerformanceAlertSummary.UNTRIAGED - if any(alert.status == PerformanceAlert.CONFIRMING for alert in alerts): - return PerformanceAlertSummary.CONFIRMING - # if all invalid, then set to invalid if all(alert.status == PerformanceAlert.INVALID for alert in alerts): return PerformanceAlertSummary.INVALID @@ -417,20 +412,18 @@ class PerformanceAlert(models.Model): REASSIGNED = 2 INVALID = 3 ACKNOWLEDGED = 4 - CONFIRMING = 5 # statuses where we relate this alert to another summary RELATIONAL_STATUS_IDS = (DOWNSTREAM, REASSIGNED) # statuses where this alert is related only to the summary it was # originally assigned to - UNRELATIONAL_STATUS_IDS = (UNTRIAGED, INVALID, ACKNOWLEDGED, CONFIRMING) + UNRELATIONAL_STATUS_IDS = (UNTRIAGED, INVALID, ACKNOWLEDGED) STATUSES = ((UNTRIAGED, 'Untriaged'), (DOWNSTREAM, 'Downstream'), (REASSIGNED, 'Reassigned'), (INVALID, 'Invalid'), - (ACKNOWLEDGED, 'Acknowledged'), - (CONFIRMING, 'Confirming')) + (ACKNOWLEDGED, 'Acknowledged')) status = models.IntegerField(choices=STATUSES, default=UNTRIAGED)