-
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
feat: add methods to query + insert coverage measurements #425
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
==========================================
- Coverage 95.94% 95.94% -0.01%
==========================================
Files 641 641
Lines 16938 16954 +16
==========================================
+ Hits 16252 16267 +15
- Misses 686 687 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Codecov ReportAttention:
@@ Coverage Diff @@
## main #425 +/- ##
==========================================
- Coverage 95.94% 95.94% -0.01%
==========================================
Files 641 641
Lines 16938 16954 +16
==========================================
+ Hits 16252 16267 +15
- Misses 686 687 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
=======================================
+ Coverage 95.66 95.80 +0.14
=======================================
Files 763 762 -1
Lines 17524 17469 -55
=======================================
- Hits 16764 16735 -29
+ Misses 760 734 -26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -80,3 +84,43 @@ def query_uploads_used(plan_service, limit, owner): | |||
) | |||
|
|||
return queryset[:limit].count() | |||
|
|||
|
|||
def query_monthly_coverage_measurements(plan_service: PlanService) -> int: |
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.
How will this be used? How come it only does private repo?
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.
This is currently not in use but will replace the query_uploads_used
fn. It's mimicking the logic there, excluding the uploaded
filter (there's 2 types so far, uploaded and carriedforward; this new user_measurements table will only insert uploaded entries, so no need for it anymore) and the ...timedelta(days=60)
as that was a stab at performance, which this whole approach will take care of now
queryset = queryset.filter( | ||
Q(created_at__gte=plan_service.trial_end_date) | ||
| Q(created_at__lte=plan_service.trial_start_date) | ||
) |
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 need to filter out ONGOING
rows?
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.
When you're ongoing, you're in the users-trial
plan, so there's no monthly_limit associated with it, so it automatically takes care of this
Purpose/Motivation
We're adding a partitioned with the UserMeasurements models. We want to add some functions to add/query for monthly uploads. This PR adds those + tests
Links to relevant tickets
codecov/engineering-team#1174
What does this PR do?
Notes to Reviewer
Anything to note to the team? Any tips on how to review, or where to start?
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.