Bundle Analysis: dedupe caching processing#1184
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: tasks/bundle_analysis_processor.py
Did you find this useful? React with a 👍 or 👎 |
✅ Sentry found no issues in your recent changes ✅ |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #1184 +/- ##
==========================================
- Coverage 97.72% 97.71% -0.01%
==========================================
Files 455 455
Lines 37157 37202 +45
==========================================
+ Hits 36311 36352 +41
- Misses 846 850 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| upload = db_session.query(Upload).filter_by(id_=upload_id).first() | ||
| else: | ||
| commit_report = report_service.initialize_and_save_report(commit) | ||
| # If the upload is not provided that means this is a processor task for caching |
There was a problem hiding this comment.
# This processor task handles caching for reports. When the 'upload' parameter is missing,
# it indicates this task was triggered by a non-BA upload.
#
# To prevent redundant caching of the same parent report:
# 1. We first check if a BA report already exists for this commit
# 2. We then verify there are uploads associated with it that aren't in an error state
#
# If both conditions are met, we can exit the task early since the caching was likely
# already handled. Otherwise, we need to:
# 1. Create a new BA report and upload
# 2. Proceed with caching data from the parent report
Put this comment into cursor just to clean it up a bit, does it still ring true?
Another attempt at ensuring we don't do BA processor task a bunch of times for each upload that comes in for a commit regardless of the report type. We only need to do cache the bundles one time, all subsequent calls are redundant. In the previous attempt it was directly querying the Upload model for all upload types which is slow, this rework ensures it doesn't directly query Upload and it only makes query if the repo has BA enabled.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.