-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add new_failure field to TextLogError and update when we have a… #8254
Conversation
46547a8
to
9bae67c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8254 +/- ##
==========================================
+ Coverage 77.16% 77.18% +0.01%
==========================================
Files 550 551 +1
Lines 27104 27123 +19
Branches 3361 3361
==========================================
+ Hits 20915 20935 +20
+ Misses 6028 6027 -1
Partials 161 161 ☔ View full report in Codecov by Sentry. |
4fa2180
to
5d075df
Compare
@@ -30,6 +30,9 @@ def store_text_log_summary_artifact(job, text_log_summary_artifact): | |||
ignore_conflicts=True, | |||
) | |||
|
|||
# Bulk create doesn't return .id field, so query to get them. | |||
log_errors = TextLogError.objects.filter(job=job) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note, this could be a perf impact, we could reconsider this specific approach, maybe only do this if we have a need to update, or convert bulk_create -> save() in a loop
for tle in log_errors: | ||
if tle.line_number == suggestion["line_number"]: | ||
tle.new_failure = True | ||
tle.save(update_fields=["new_failure"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using update_fields is a perf win, so I get a little bit of a win here for the existing code :)
… new failure.
need to do: