-
Notifications
You must be signed in to change notification settings - Fork 22
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 useRepoConfigurationStatus to TS Query V5 #3618
base: main
Are you sure you want to change the base?
ref: Migrate useRepoConfigurationStatus to TS Query V5 #3618
Conversation
Bundle ReportChanges will decrease total bundle size by 4 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Bundle ReportChanges will decrease total bundle size by 4 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3618 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 810 810
Lines 14553 14553
Branches 4143 4143
=======================================
Hits 14406 14406
Misses 140 140
Partials 7 7
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 #3618 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 810 810
Lines 14553 14553
Branches 4143 4143
=======================================
Hits 14406 14406
Misses 140 140
Partials 7 7
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 #3618 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 810 810
Lines 14553 14553
Branches 4136 4136
=======================================
Hits 14406 14406
Misses 140 140
Partials 7 7
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 #3618 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 810 810
Lines 14553 14553
Branches 4143 4143
=======================================
Hits 14406 14406
Misses 140 140
Partials 7 7
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
@codecov-ai-reviewer review |
<QueryClientProviderV5 client={queryClientV5}> | ||
<QueryClientProvider client={queryClient}> | ||
<MemoryRouter initialEntries={['/gh/codecov/cool-repo/config']}> | ||
<Route path="/:provider/:owner/:repo/config">{children}</Route> | ||
</MemoryRouter> | ||
</QueryClientProvider> | ||
</QueryClientProviderV5> |
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 nested QueryClientProvider
components can be simplified to avoid redundancy and improve readability.
<QueryClientProviderV5 client={queryClientV5}> | |
<QueryClientProvider client={queryClient}> | |
<MemoryRouter initialEntries={['/gh/codecov/cool-repo/config']}> | |
<Route path="/:provider/:owner/:repo/config">{children}</Route> | |
</MemoryRouter> | |
</QueryClientProvider> | |
</QueryClientProviderV5> | |
const wrapper: React.FC<React.PropsWithChildren> = ({ children }) => ( | |
<QueryClientProviderV5 client={queryClientV5}> | |
<QueryClientProvider client={queryClient}> | |
<MemoryRouter initialEntries={'/gh/codecov/cool-repo/config'}> | |
<Route path="/:provider/:owner:/repo?extra=children]> | |
{children} | |
</Route> | |
</MemoryRouter> | |
</QueryClientProvider> | |
</QueryClientProviderV5> | |
); | |
const { data: repoConfiguration } = useSuspenseQueryV5( | ||
RepoConfigurationStatusQueryOpts({ | ||
provider, | ||
owner, | ||
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.
The useSuspenseQueryV5
call can be simplified by directly passing the arguments instead of wrapping them in RepoConfigurationStatusQueryOpts
.
const { data: repoConfiguration } = useSuspenseQueryV5( | |
RepoConfigurationStatusQueryOpts({ | |
provider, | |
owner, | |
repo, | |
}) | |
) | |
const { data: repoConfiguration } = useSuspenseQueryV5(['name', { provider, owner, repo }]); | |
Description
This PR migrates the
useRepoConfigurationStatus
to the TS QueryqueryOptions
versionRepoConfigurationStatusQueryOpts
.Ticket: codecov/engineering-team#2967
Notable Changes
useRepoConfigurationStatus
toRepoConfigurationStatusQueryOpts
.ConfigurationManager