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

chore: Migrate useSelfHostedUserList to TS Query V5 #3575

Merged

Conversation

nicholas-codecov
Copy link
Contributor

Description

This PR migrates the useSelfHostedUserList to the infiniteQueryOptions setup from TS Query V5 to SelfHostedUserListQueryOpts

Ticket: codecov/engineering-team#2961

Notable Changes

  • Migrate useSelfHostedUserList to SelfHostedUserListQueryOpts
  • Update usage in MemberTable

@codecov-staging
Copy link

codecov-staging bot commented Dec 12, 2024

Bundle Report

Changes will increase total bundle size by 431 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 6.05MB 223 bytes (0.0%) ⬆️
gazebo-staging-system 6.0MB 208 bytes (0.0%) ⬆️

Copy link

codecov bot commented Dec 12, 2024

Bundle Report

Changes will increase total bundle size by 431 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.0MB 208 bytes (0.0%) ⬆️
gazebo-production-system-esm 6.05MB 223 bytes (0.0%) ⬆️

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.99%. Comparing base (92c721b) to head (7636bf9).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3575   +/-   ##
=======================================
  Coverage   98.99%   98.99%           
=======================================
  Files         810      810           
  Lines       14567    14569    +2     
  Branches     4157     4149    -8     
=======================================
+ Hits        14420    14422    +2     
  Misses        140      140           
  Partials        7        7           
Files with missing lines Coverage Δ
...inSettings/AdminMembers/MemberList/MemberTable.tsx 100.00% <100.00%> (ø)
...services/selfHosted/SelfHostedUserListQueryOpts.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.73% <100.00%> (+<0.01%) ⬆️
Services 99.36% <100.00%> (-0.01%) ⬇️
Shared 99.32% <ø> (ø)
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 92c721b...7636bf9. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3575   +/-   ##
=======================================
  Coverage   98.99%   98.99%           
=======================================
  Files         810      810           
  Lines       14567    14569    +2     
  Branches     4157     4149    -8     
=======================================
+ Hits        14420    14422    +2     
  Misses        140      140           
  Partials        7        7           
Files with missing lines Coverage Δ
...inSettings/AdminMembers/MemberList/MemberTable.tsx 100.00% <100.00%> (ø)
...services/selfHosted/SelfHostedUserListQueryOpts.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.73% <100.00%> (+<0.01%) ⬆️
Services 99.36% <100.00%> (-0.01%) ⬇️
Shared 99.32% <ø> (ø)
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 92c721b...7636bf9. Read the comment docs.

Copy link

codecov-public-qa bot commented Dec 12, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4169 1 4168 0
View the top 1 failed tests by shortest run time
src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/TeamPlanController/BillingOptions/BillingOptions.test.tsx > BillingOptions > when rendered > planString is set to annual plan > renders annual button as "selected"
Stack Traces | 0.237s run time
Error: expect(element).toHaveClass("bg-ds-primary-base")

Expected the element to have class:
  bg-ds-primary-base
Received:
  flex-1 py-1 px-2 text-sm cursor-pointer whitespace-nowrap disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary rounded-l
 ❯ .../TeamPlanController/BillingOptions/BillingOptions.test.tsx:132:27

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Dec 12, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
5fcab61 Thu, 12 Dec 2024 16:11:01 GMT Expired Expired
522581a Mon, 23 Dec 2024 11:42:34 GMT Expired Expired
7636bf9 Mon, 23 Dec 2024 18:06:18 GMT Cloud Enterprise

@codecov-qa
Copy link

codecov-qa bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.99%. Comparing base (92c721b) to head (7636bf9).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3575   +/-   ##
=======================================
  Coverage   98.99%   98.99%           
=======================================
  Files         810      810           
  Lines       14567    14569    +2     
  Branches     4150     4149    -1     
=======================================
+ Hits        14420    14422    +2     
  Misses        140      140           
  Partials        7        7           
Files with missing lines Coverage Δ
...inSettings/AdminMembers/MemberList/MemberTable.tsx 100.00% <100.00%> (ø)
...services/selfHosted/SelfHostedUserListQueryOpts.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.73% <100.00%> (+<0.01%) ⬆️
Services 99.36% <100.00%> (-0.01%) ⬇️
Shared 99.32% <ø> (ø)
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 92c721b...7636bf9. Read the comment docs.

)

return {
...rest,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any chance we can avoid using ...rest here? Do we really need everything coming back from this query call?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, we can remove it

isAdmin?: boolean
}

const useQueryMembersList = (params: Params) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im also kinda curious why we pulled the memo out of the query and into this new query in the component itself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beforehand the service query was a custom hook so we're okay to use a useMemo in there, whereas now with the queryOptions factory function it is no longer a custom hook, so we're not able to use a hook inside of the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense!

return parsedData.data
})
},
suspense: false,
initialPageParam: '1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not defaulted to 1 already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not, you have to explicitly define it in V5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 small question, approved otherwise

@nicholas-codecov nicholas-codecov force-pushed the gh-eng-2961-chore-migrate-useSelfHostedUserList-to-tsqv5 branch from 522581a to 7636bf9 Compare December 23, 2024 18:00
@nicholas-codecov nicholas-codecov added this pull request to the merge queue Dec 23, 2024
Merged via the queue into main with commit 753f06c Dec 23, 2024
62 checks passed
@nicholas-codecov nicholas-codecov deleted the gh-eng-2961-chore-migrate-useSelfHostedUserList-to-tsqv5 branch December 23, 2024 18:21
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