-
Notifications
You must be signed in to change notification settings - Fork 24
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
ref: Migrate useBranchCoverageMeasurements to TSQ V5 #3711
ref: Migrate useBranchCoverageMeasurements to TSQ V5 #3711
Conversation
Bundle ReportChanges will decrease total bundle size by 288 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-staging-systemAssets Changed:
Files in
Files in
Files in
view changes for bundle: gazebo-staging-esmAssets Changed:
Files in
Files in
Files in
|
Bundle ReportChanges will decrease total bundle size by 288 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-systemAssets Changed:
Files in
Files in
Files in
view changes for bundle: gazebo-production-esmAssets Changed:
Files in
Files in
Files in
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3711 +/- ##
==========================================
- Coverage 98.84% 98.84% -0.01%
==========================================
Files 826 826
Lines 14865 14862 -3
Branches 4223 4221 -2
==========================================
- Hits 14694 14691 -3
Misses 165 165
Partials 6 6
... and 1 file with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3711 +/- ##
==========================================
- Coverage 98.84% 98.84% -0.01%
==========================================
Files 826 826
Lines 14865 14862 -3
Branches 4223 4229 +6
==========================================
- Hits 14694 14691 -3
Misses 165 165
Partials 6 6
... and 1 file with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
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 #3711 +/- ##
==========================================
- Coverage 98.84% 98.84% -0.01%
==========================================
Files 826 826
Lines 14865 14862 -3
Branches 4231 4229 -2
==========================================
- Hits 14694 14691 -3
Misses 165 165
Partials 6 6
... and 1 file with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3711 +/- ##
==========================================
- Coverage 98.84% 98.84% -0.01%
==========================================
Files 826 826
Lines 14865 14862 -3
Branches 4231 4221 -10
==========================================
- Hits 14694 14691 -3
Misses 165 165
Partials 6 6
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
}), | ||
select: (data) => { | ||
let coverage = [] | ||
if (data.measurements?.[0]?.max === null) { |
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.
The optional chains are kinda throwing me off here because we're doing a hard set on the values in the line below 🤔
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 validating that there is an entry in the array that has a field max
on it that is null
so that we can override the value. You're not able to use optional chaining while assigning a value.
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.
Yep I get that, it's a little unclear bc we're checking for null explicitly whereas if the value doesn't exist at any other point it'd return undefined. Just one of those "gotchas" / "landmines"
src/pages/RepoPage/CoverageTab/OverviewTab/hooks/useRepoCoverageTimeseries.ts
Outdated
Show resolved
Hide resolved
@@ -65,7 +65,7 @@ function CoverageChart() { | |||
) | |||
} | |||
|
|||
if (data?.measurements.length < 1) { | |||
if (!isPending && data?.measurements?.length < 1) { |
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 !isPending here?
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.
Yep, if it's not included then there's a type error
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.
Hrmrm, actually gonna switch this up a little bit.
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.
okay tidied things up
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.
nice! love 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.
lgtm
Description
This PR migrates the
useBranchCoverageMeasurements
toBranchCoverageMeasurementsQueryOpts
TSQ V5 query options API.Ticket: codecov/engineering-team#3165
Notable Changes
useBranchCoverageMeasurements
toBranchCoverageMeasurementsQueryOpts
useRepoCoverageTimeseries
useRepoCoverageTimeseries
inCoverageTrend
andCoverageChart