-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bundle analysis: create timeseries dataset upon upload #601
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #601 +/- ##
=======================================
Coverage 91.49% 91.49%
=======================================
Files 615 615
Lines 16371 16379 +8
=======================================
+ Hits 14978 14986 +8
Misses 1393 1393
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
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 ✅
✅ All tests successful. No failed tests found @@ Coverage Diff @@
## main #601 +/- ##
=======================================
Coverage 91.49% 91.49%
=======================================
Files 615 615
Lines 16371 16379 +8
=======================================
+ Hits 14978 14986 +8
Misses 1393 1393
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 ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #601 +/- ##
================================================
+ Coverage 95.92000 95.93000 +0.01000
================================================
Files 793 793
Lines 17689 17697 +8
================================================
+ Hits 16969 16977 +8
Misses 720 720
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -142,4 +144,29 @@ def post(self, request): | |||
is_shelter_request=self.is_shelter_request(), | |||
), | |||
) | |||
|
|||
if settings.TIMESERIES_ENABLED: |
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 want to jump right to creating or do we want to create if it doesn't already exist / isn't backfilled? the latter is what is done for coverage i think
codecov-api/timeseries/helpers.py
Lines 341 to 348 in 66ec9fa
dataset = Dataset.objects.filter( | |
name=MeasurementName.COVERAGE.value, | |
repository_id=repository.pk, | |
).first() | |
if settings.TIMESERIES_ENABLED and dataset and dataset.is_backfilled(): | |
# timeseries data is ready | |
return coverage_measurements( |
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.
I think its better to create it as soon as possible then it is to create it when we fetch the measurements, that way we don't miss out on a datapoint in the general flow of upload->process->query since the process step is when we insert the measurement datapoints which relies on the presence of the dataset rows being inserted.
With the coverage measurements its ok because when querying and not having dataset created it can still compute and return measurements on the fly and then do a backfill. Also with BA we don't plan on doing backfills because the previous bundle schemas don't support it.
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.
oh on second read the code is get_or_create()
, i thought it was just create()
. my concern was that you would create multiple Dataset
s with the same type/repoID which sounded wrong. but this is all good
|
||
|
||
@pytest.mark.django_db(databases={"default", "timeseries"}) | ||
def test_upload_bundle_analysis_measurement_datasets_created( |
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.
jw, is it possible to parametrize this and the other test with the pytest.mark.parametrize() decorator?
@pytest.mark.parametrize("using_integration", [True, False]) |
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
@@ -142,4 +144,29 @@ def post(self, request): | |||
is_shelter_request=self.is_shelter_request(), | |||
), | |||
) | |||
|
|||
if settings.TIMESERIES_ENABLED: |
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.
oh on second read the code is get_or_create()
, i thought it was just create()
. my concern was that you would create multiple Dataset
s with the same type/repoID which sounded wrong. but this is all good
When the upload bundle stat file is called, we will create the supported datasets for trend data. When there's values in Dataset model, measurements will be able to start populating during processing of the stat file (this will be implemented next in the worker repo). This means that for BA there will not be a opt-in feature similar to flags/component trends, all users will be automatically opted in for this. Additionally there will not be a "backfilling" process for past bundle stats.
closes codecov/engineering-team#1771
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.