-
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
bundle analysis: compute measurements for unknown asset types #885
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 ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #885 +/- ##
=======================================
Coverage 96.31% 96.32%
=======================================
Files 823 823
Lines 19084 19110 +26
=======================================
+ Hits 18381 18407 +26
Misses 703 703
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time. ❌ Failed Test Results:Completed 2682 tests with View the full list of failed testspytest
|
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
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.
approved this! had some questions for my own learning mostly
__typename | ||
... on BundleAnalysisReport { | ||
bundle(name: "super") { | ||
bundleAnalysisReport { |
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.
May need to pull in main
to pick up @calvin-codecov 's update for the graphql nesting proj
@@ -81,7 +81,7 @@ class BundleAnalysisMeasurementData(object): | |||
def __init__( | |||
self, | |||
raw_measurements: List[dict], | |||
asset_type: BundleAnalysisMeasurementsAssetType, | |||
asset_type: Union[BundleAnalysisMeasurementsAssetType, str], |
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.
Out of curiosity, why do we choose to use a union instead of adding to the existing enum?
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.
Yeah I was looking to add an entry to that, but once I started making the changes I realized too many things (a lot of it on the ingestion side) would need to be updated. So I thought this would be the least disruptive way of doing it.
@@ -36,6 +39,35 @@ def _find_index_by_cursor(assets: List, cursor: str) -> int: | |||
return -1 | |||
|
|||
|
|||
def _compute_unknown_asset_size_raw_measurements(fetched_data: dict) -> List[dict]: |
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.
nit: are these the types?
input Dict[BundleAnalysisMeasurementsAssetType, List[BundleAnalysisMeasurementData]]
output List[BundleAnalysisMeasurementData]
return [] | ||
unknown_raw_measurements[i]["min"] -= raw_measurements[i]["min"] | ||
unknown_raw_measurements[i]["max"] -= raw_measurements[i]["max"] | ||
unknown_raw_measurements[i]["avg"] -= raw_measurements[i]["avg"] |
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 see we're using min
, max
, avg
fields to represent "total bundle size" basically (and the 3 fields have equal values), so doing this subtraction exercise makes sense. If we ever change this to being things other than the "total", we may need to change the math to take the min of everything for min and max of everything for max, etc. .. Guessing we don't expect that any time soon?
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.
Yeah true it would suck if the math becomes harder in the future, especially percentage type values.. We might need to rethink an approach to do unknown asset types in the future if it comes to it.
Computes the trends measurements for asset types with unknown types, do this buy subtracting all the known bundle type sizes from the total bundle size for each time interval of the measurements data.
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.