Skip to content

Commit

Permalink
WIP - add new_failure field to TextLogError and update when we have a…
Browse files Browse the repository at this point in the history
… new failure.
  • Loading branch information
jmaher committed Oct 17, 2024
1 parent d3b59c6 commit 59d76a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions treeherder/etl/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def store_text_log_summary_artifact(job, text_log_summary_artifact):
# classify job as `new failure` - for filtering, etc.
job.failure_classification_id = 6
job.save()
# for every log_errors (TLE object) there is a corresponding bugs/suggestion
# we might be able to avoid the TLE lookup
tle = TextLogError.objects.get(job=job)
tle.new_failure = 1
tle.save()


def store_job_artifacts(artifact_data):
Expand Down
1 change: 1 addition & 0 deletions treeherder/model/error_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def bug_suggestions_line(
"line_number": err.line_number,
"counter": counter,
"failure_new_in_rev": failure_new_in_rev,
"text_log_error_id": err.id,
}, line_cache


Expand Down
1 change: 1 addition & 0 deletions treeherder/model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,7 @@ class TextLogError(models.Model):
job = models.ForeignKey(Job, on_delete=models.CASCADE, related_name="text_log_error", null=True)
line = models.TextField()
line_number = models.PositiveIntegerField()
new_failure = models.BooleanField(default=False)

# TODO delete this field and unique_together once backfill of jobs in TextLogError table has been completed
step = models.ForeignKey(
Expand Down

0 comments on commit 59d76a3

Please sign in to comment.