Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicholas-codecov
Copy link
Contributor

Description

This PR migrates the useRepoConfigurationStatus to the TS Query queryOptions version RepoConfigurationStatusQueryOpts.

Ticket: codecov/engineering-team#2967

Notable Changes

  • Migrate useRepoConfigurationStatus to RepoConfigurationStatusQueryOpts.
  • Update usage in ConfigurationManager
  • Update tests

@codecov-staging
Copy link

codecov-staging bot commented Dec 31, 2024

Bundle Report

Changes will decrease total bundle size by 4 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 6.06MB 1 bytes (-0.0%) ⬇️
gazebo-staging-system 6.0MB 3 bytes (-0.0%) ⬇️

Copy link

codecov bot commented Dec 31, 2024

Bundle Report

Changes will decrease total bundle size by 4 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.0MB 3 bytes (-0.0%) ⬇️
gazebo-production-system-esm 6.06MB 1 bytes (-0.0%) ⬇️

@codecov-qa
Copy link

codecov-qa bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.98%. Comparing base (a1e07ef) to head (6e69b21).

✅ 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           
Files with missing lines Coverage Δ
...tabs/ConfigurationManager/ConfigurationManager.tsx 100.00% <100.00%> (ø)
...urationStatus/RepoConfigurationStatusQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.72% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.37% <ø> (ø)
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1e07ef...6e69b21. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 31, 2024

Codecov Report

All 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           
Files with missing lines Coverage Δ
...tabs/ConfigurationManager/ConfigurationManager.tsx 100.00% <100.00%> (ø)
...urationStatus/RepoConfigurationStatusQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.72% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.37% <ø> (ø)
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1e07ef...6e69b21. Read the comment docs.

Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.98%. Comparing base (a1e07ef) to head (6e69b21).

✅ 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           
Files with missing lines Coverage Δ
...tabs/ConfigurationManager/ConfigurationManager.tsx 100.00% <100.00%> (ø)
...urationStatus/RepoConfigurationStatusQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.72% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.37% <ø> (ø)
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1e07ef...6e69b21. Read the comment docs.

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.98%. Comparing base (a1e07ef) to head (6e69b21).

✅ 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           
Files with missing lines Coverage Δ
...tabs/ConfigurationManager/ConfigurationManager.tsx 100.00% <100.00%> (ø)
...urationStatus/RepoConfigurationStatusQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.72% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.37% <ø> (ø)
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1e07ef...6e69b21. Read the comment docs.

@codecov-releaser
Copy link
Contributor

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
6e69b21 Tue, 31 Dec 2024 18:48:39 GMT Cloud Enterprise

@aj-codecov
Copy link
Contributor

@codecov-ai-reviewer review

Comment on lines +66 to +72
<QueryClientProviderV5 client={queryClientV5}>
<QueryClientProvider client={queryClient}>
<MemoryRouter initialEntries={['/gh/codecov/cool-repo/config']}>
<Route path="/:provider/:owner/:repo/config">{children}</Route>
</MemoryRouter>
</QueryClientProvider>
</QueryClientProviderV5>
Copy link

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.

Suggested change
<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>
);

Comment on lines +21 to +27
const { data: repoConfiguration } = useSuspenseQueryV5(
RepoConfigurationStatusQueryOpts({
provider,
owner,
repo,
})
)
Copy link

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.

Suggested change
const { data: repoConfiguration } = useSuspenseQueryV5(
RepoConfigurationStatusQueryOpts({
provider,
owner,
repo,
})
)
const { data: repoConfiguration } = useSuspenseQueryV5(['name', { provider, owner, repo }]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants