-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: only call commit_update task when commit is newly created #804
Conversation
we have to move the get_or_create call in the commits endpoint to the top level function so we can know if a commit object was newly created we don't want to call the commit update task every time this endpoint is called because it may be the cause of lock contention in the DB for commits
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Changes have been made to critical files, which contain lines commonly executed in production. Learn more ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #804 +/- ##
================================================
+ Coverage 96.14000 96.16000 +0.02000
================================================
Files 812 812
Lines 18486 18730 +244
================================================
+ Hits 17773 18011 +238
- Misses 713 719 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Is this function in the serializer not used anymore?
If that's the case please remove that too.
Originally I wanted to delete PreProcess task completely, but after reviewing certain usage patterns I realized the task is necessary (for `empty-upload` and `static-analysis` for example). So the alternative is to reduce the amount of times it is called, to only be called when we effectively create a new report. Similar to #804
we have to move the get_or_create call in the commits endpoint to the top level function so we can know if a commit object was newly created
we don't want to call the commit update task every time this endpoint is called because it may be the cause of lock contention in the DB for commits