-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(codecov): add query params to test analytics hooks #93473
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(codecov): add query params to test analytics hooks #93473
Conversation
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.
seems legit ✅ Nice work
*/ | ||
function sortValueToSortKey(value: string) { | ||
const word = value.replace(/^[+-]/, '') as SortableTAOptions; | ||
const sign = value.startsWith('-') ? '-' : ''; |
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: I think value[0] === "-" might be marginally faster
queryKey: [ | ||
`/prevent/owner/${integratedOrg}/repository/${repository}/test-results/`, | ||
{}, | ||
{query: {branch, codecovPeriod, signedSortBy}}, |
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.
Does Sentry hold things like a repository's default branch in their DB or nah? Otherwise maybe we'll need to bake it in somewhere eventually 🤔
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'm not sure if they do because not everything is set to a repo/provider. We do have a defaultBranch field or something like that that we could surface, so we can have be the default for sure
...other | ||
}) => { | ||
const isBrokenTest = | ||
totalFailCount === totalPassCount + totalFlakyFailCount + totalSkipCount; | ||
return { | ||
...other, | ||
testName: name, | ||
averageDurationMs: avgDuration, | ||
averageDurationMs: avgDuration * 1000, |
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.
is ms what we want? Looking at the figma and its in seconds, which is also a prop we can pass into the performanceDuration component
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.
You can do either or. If you provide seconds, and you get sub seconds, ill be displayed as 0.43 s, whereas if you supply milliseconds
, it'll show as 43 ms, and on top of that show seconds if over seconds, so it's a nicer UI that way :]
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 cool! Yeah agreed that's a nicer UI
This PR adds query params to the test analytics table and summary components. This PR doesn't include pagination. Notes - - Adds query params for `useInfiniteTestResults` and `useTestResultsAggregates` - Adds `sortValueToSortKey` to help map table column selected values to the values expected by the backend for data sorting and filtering - Types date and sorting variables for type safety - Adds representative mock selector data - Minor data quality adjustments
This PR adds query params to the test analytics table and summary components. This PR doesn't include pagination. Notes - - Adds query params for `useInfiniteTestResults` and `useTestResultsAggregates` - Adds `sortValueToSortKey` to help map table column selected values to the values expected by the backend for data sorting and filtering - Types date and sorting variables for type safety - Adds representative mock selector data - Minor data quality adjustments
This PR adds query params to the test analytics table and summary components. This PR doesn't include pagination.
Notes
useInfiniteTestResults
anduseTestResultsAggregates
sortValueToSortKey
to help map table column selected values to the values expected by the backend for data sorting and filtering