-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1825705 - Alerts View - Add bug_due_date field to performance_ale…
…rt_summary table (#7863)
- Loading branch information
1 parent
d9f78f2
commit 2b08e55
Showing
8 changed files
with
148 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
treeherder/perf/migrations/0047_performancealertsummary_triage_due.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
treeherder/perf/migrations/0051_performancealertsummary_bug_due_date.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Generated by Django 4.0.8 on 2023-03-28 09:33 | ||
|
||
from django.db import migrations, models | ||
|
||
from treeherder.perf.utils import calculate_time_to, BUG_DAYS | ||
|
||
|
||
def update_summary_bug_due_date(apps, schema_editor): | ||
PerformanceAlertSummary = apps.get_model('perf', 'PerformanceAlertSummary') | ||
|
||
for row in PerformanceAlertSummary.objects.all(): | ||
row.bug_due_date = calculate_time_to(row.created, due_days=BUG_DAYS) | ||
row.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('perf', '0050_cascade_perf_datum_deletion_replicate'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='performancealertsummary', | ||
name='bug_due_date', | ||
field=models.DateTimeField(default=None, null=True), | ||
), | ||
migrations.RunPython( | ||
update_summary_bug_due_date, | ||
reverse_code=migrations.RunPython.noop, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters