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 useSelfHostedSettings to TS Query V5 #3574

Merged

Conversation

nicholas-codecov
Copy link
Contributor

Description

This PR focuses on updating useSelfHostedSettings to the TS Query V5 queryOptions API version SelfHostedSettingsQueryOpts, as well as some TS refactors.

Ticket: codecov/engineering-team#2961

Notable Changes

  • Migrate useSelfHostedSettings to SelfHostedSettingsQueryOpts
  • Update how useUpdateSlefHostedSettings invalidates SelfHostedSettingsQueryOpts
  • Update usage of new hook, and refactor to TS ActivationInfo
  • Update usage of new hook, and refactor to TS ActivationCount
    • Update usage of new hook, and refactor to TS AutoActivateMembers
    • Update usage of new hook MemberTable

@codecov-staging
Copy link

codecov-staging bot commented Dec 12, 2024

Bundle Report

Changes will increase total bundle size by 1.19kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 6.05MB 544 bytes (0.01%) ⬆️
gazebo-staging-system 6.0MB 648 bytes (0.01%) ⬆️

Copy link

codecov bot commented Dec 12, 2024

Bundle Report

Changes will increase total bundle size by 1.19kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.0MB 648 bytes (0.01%) ⬆️
gazebo-production-system-esm 6.05MB 544 bytes (0.01%) ⬆️

@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    #3574      +/-   ##
==========================================
- Coverage   99.00%   98.99%   -0.02%     
==========================================
  Files         810      810              
  Lines       14563    14567       +4     
  Branches     4157     4157              
==========================================
+ Hits        14418    14420       +2     
- Misses        138      140       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...ActivationInfo/ActivationCount/ActivationCount.tsx 100.00% <100.00%> (ø)
...ngs/AdminMembers/ActivationInfo/ActivationInfo.tsx 100.00% <100.00%> (ø)
...onInfo/AutoActivateMembers/AutoActivateMembers.tsx 81.81% <100.00%> (ø)
...inSettings/AdminMembers/MemberList/MemberTable.tsx 100.00% <100.00%> (ø)
...c/services/account/useUpdateSelfHostedSettings.tsx 95.00% <100.00%> (ø)
...ervices/selfHosted/SelfHostedSettingsQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.73% <100.00%> (-0.03%) ⬇️
Services 99.36% <100.00%> (ø)
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 3c674b5...78f45e8. Read the comment docs.

@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 (3c674b5) to head (78f45e8).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3574      +/-   ##
==========================================
- Coverage   99.00%   98.99%   -0.02%     
==========================================
  Files         810      810              
  Lines       14563    14567       +4     
  Branches     4157     4157              
==========================================
+ Hits        14418    14420       +2     
- Misses        138      140       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...ActivationInfo/ActivationCount/ActivationCount.tsx 100.00% <100.00%> (ø)
...ngs/AdminMembers/ActivationInfo/ActivationInfo.tsx 100.00% <100.00%> (ø)
...onInfo/AutoActivateMembers/AutoActivateMembers.tsx 81.81% <100.00%> (ø)
...inSettings/AdminMembers/MemberList/MemberTable.tsx 100.00% <100.00%> (ø)
...c/services/account/useUpdateSelfHostedSettings.tsx 95.00% <100.00%> (ø)
...ervices/selfHosted/SelfHostedSettingsQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.73% <100.00%> (-0.03%) ⬇️
Services 99.36% <100.00%> (ø)
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 3c674b5...78f45e8. Read the comment docs.

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 (3c674b5) to head (78f45e8).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3574      +/-   ##
==========================================
- Coverage   99.00%   98.99%   -0.02%     
==========================================
  Files         810      810              
  Lines       14563    14567       +4     
  Branches     4150     4150              
==========================================
+ Hits        14418    14420       +2     
- Misses        138      140       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...ActivationInfo/ActivationCount/ActivationCount.tsx 100.00% <100.00%> (ø)
...ngs/AdminMembers/ActivationInfo/ActivationInfo.tsx 100.00% <100.00%> (ø)
...onInfo/AutoActivateMembers/AutoActivateMembers.tsx 81.81% <100.00%> (ø)
...inSettings/AdminMembers/MemberList/MemberTable.tsx 100.00% <100.00%> (ø)
...c/services/account/useUpdateSelfHostedSettings.tsx 95.00% <100.00%> (ø)
...ervices/selfHosted/SelfHostedSettingsQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.73% <100.00%> (-0.03%) ⬇️
Services 99.36% <100.00%> (ø)
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 3c674b5...78f45e8. Read the comment docs.

@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
7ebc2f7 Thu, 12 Dec 2024 13:44:29 GMT Expired Expired
178a5a0 Mon, 23 Dec 2024 11:51:04 GMT Expired Expired
1bb1f80 Mon, 23 Dec 2024 17:14:53 GMT Expired Expired
78f45e8 Mon, 23 Dec 2024 17:50:18 GMT Cloud Enterprise

queryClient.clear()
queryClientV5.clear()
Copy link
Contributor

Choose a reason for hiding this comment

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

I see we've made a deliberate effort in these suites to modify the ordering of the "clear" statements with the server statement being the last to clear -- jw what the intent was behind this change if any

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the typical flow for the vast majority of our tests so I like the consistency as well as the alphabet, there's no technical reason

Copy link
Contributor

Choose a reason for hiding this comment

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

cool cool, thanks for the context ✅

@@ -24,7 +35,7 @@ function AutoActivateMembers() {
<Toggle
dataMarketing="auto-acitvate-members"
label={data?.planAutoActivate ? 'On' : 'Off'}
value={data?.planAutoActivate}
value={!!data?.planAutoActivate}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the boolean cast for a certain reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, we need this here because data?.planAutoActivate is of type boolean | null and value only accepts booleans

Copy link
Contributor

Choose a reason for hiding this comment

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

got it makes sense!

describe('ActivationCount', () => {
function setup() {
function setup({ seatsLimit, seatsUsed }: SetupArgs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

curious why we wanted to refactor this to have setup args when it looks like the args are the same throughout

Copy link
Contributor

Choose a reason for hiding this comment

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

oh nvm I see seatsUsed as 10 in a later test, I dig it ✔️

Copy link

codecov-public-qa bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.99%. Comparing base (8844168) to head (1bb1f80).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3574      +/-   ##
==========================================
- Coverage   99.00%   98.99%   -0.02%     
==========================================
  Files         810      810              
  Lines       14569    14573       +4     
  Branches     4161     4154       -7     
==========================================
+ Hits        14424    14426       +2     
- Misses        138      140       +2     
  Partials        7        7              
Files with missing lines Coverage Δ
...ActivationInfo/ActivationCount/ActivationCount.tsx 100.00% <100.00%> (ø)
...ngs/AdminMembers/ActivationInfo/ActivationInfo.tsx 100.00% <100.00%> (ø)
...onInfo/AutoActivateMembers/AutoActivateMembers.tsx 81.81% <100.00%> (ø)
...inSettings/AdminMembers/MemberList/MemberTable.tsx 100.00% <100.00%> (ø)
...c/services/account/useUpdateSelfHostedSettings.tsx 95.00% <100.00%> (ø)
...ervices/selfHosted/SelfHostedSettingsQueryOpts.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.73% <100.00%> (-0.03%) ⬇️
Services 99.36% <100.00%> (ø)
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 8844168...1bb1f80. Read the comment docs.

@nicholas-codecov nicholas-codecov added this pull request to the merge queue Dec 23, 2024
Merged via the queue into main with commit 92c721b Dec 23, 2024
58 of 62 checks passed
@nicholas-codecov nicholas-codecov deleted the gh-eng-2961-chore-migrate-useSelfHostedSettings-to-tsqv5 branch December 23, 2024 17:55
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