-
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
Update Bundle analysis Schema and add GQL cleanup step #408
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #408 +/- ##
=======================================
Coverage 96.08% 96.08%
=======================================
Files 637 637
Lines 16686 16709 +23
=======================================
+ Hits 16032 16055 +23
Misses 654 654
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #408 +/- ##
=======================================
Coverage 96.08% 96.08%
=======================================
Files 637 637
Lines 16686 16709 +23
=======================================
+ Hits 16032 16055 +23
Misses 654 654
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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 Additional details and impacted files@@ Coverage Diff @@
## main #408 +/- ##
======================================
Coverage 95.80 95.80
======================================
Files 757 757
Lines 17252 17390 +138
======================================
+ Hits 16527 16659 +132
- Misses 725 731 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -109,8 +109,8 @@ def __init__(self, report: SharedBundleAnalysisReport): | |||
self.cleanup() | |||
|
|||
def cleanup(self) -> None: |
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.
Don't do the full cleanup
since that will delete the DB temp file prematurely.
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.
Do we still need the cleanup at this level? I feel having a cleanup here might be more confusing than not, since all connection related stuff should be done at the parent (shared) level
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.
We still need this for now, but you're right it shouldn't have to do this on this level. Reason being on the shared.BundleAnalysisReport
it is still relying on the implementation of manually closing connections. I didn't want to touch that in the current shared PR because BundleAnalysisReport
is too intertwined with worker as well. But yeah next step I need to make some changes to BundleAnalysisReport
class
@@ -50,7 +93,8 @@ async def post(self, request, *args, **kwargs): | |||
log.info("GraphQL Request", extra=log_data) | |||
|
|||
# request.user = await get_user(request) or AnonymousUser() | |||
return await super().post(request, *args, **kwargs) | |||
with RequestFinalizer(): | |||
return await super().post(request, *args, **kwargs) |
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.
What's a way for us to see/measure a connection being closed through this code?
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.
What do you mean? All requests comes to this code.
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.
Like how do we know this code indeed closed a connection after the fact, is there a utility or metric that shows live connection before, during and after?
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.
LGTM
Purpose/Motivation
Make a teardown step for GQL request to clean up
/tmp
directory. This is needed for BA because we load the SQLite file (used as a storage for bundle stats) from GCS into the containers file system in the/tmp
dir, we need to delete that file at the end when the entire GQL request is resolved.Note: Update Shared commit once that is push codecov/shared#129
Relevant ticket: codecov/engineering-team#1068
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.