-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add computed column for infrastructure errors
Instead of manually filtering these out in metabase, this introduces a DB computed column that will handle that logic.
- Loading branch information
1 parent
4244e71
commit 5e6004c
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
analytics/analytics/core/migrations/0002_jobdatadimension_infrastructure_error.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,49 @@ | ||
# Generated by Django 5.1.4 on 2025-01-03 16:02 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="jobdatadimension", | ||
name="infrastructure_error", | ||
field=models.GeneratedField( | ||
db_persist=True, | ||
expression=models.Case( | ||
models.When( | ||
models.Q( | ||
models.Q( | ||
("status", "failed"), | ||
models.Q( | ||
( | ||
"error_taxonomy__in", | ||
[ | ||
"spack_error", | ||
"build_error", | ||
"concretization_error", | ||
"module_not_found", | ||
], | ||
), | ||
models.Q( | ||
("error_taxonomy", "failed_to_get_specs"), | ||
("job_type", "rebuild-index"), | ||
), | ||
_connector="OR", | ||
), | ||
) | ||
), | ||
then=models.Value(True), | ||
), | ||
default=models.Value(False), | ||
output_field=models.BooleanField(), | ||
), | ||
help_text='Whether or not this job is an "infrastructure error", or a legitimate CI failure.', | ||
output_field=models.BooleanField(), | ||
), | ||
), | ||
] |
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