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

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

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.22kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 5.72MB 560 bytes (0.01%) ⬆️
gazebo-staging-system 5.67MB 660 bytes (0.01%) ⬆️

Copy link

codecov bot commented Dec 12, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 5.67MB 660 bytes (0.01%) ⬆️
gazebo-production-system-esm 5.72MB 560 bytes (0.01%) ⬆️

@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3574      +/-   ##
==========================================
- Coverage   98.90%   98.89%   -0.02%     
==========================================
  Files         806      806              
  Lines       14485    14489       +4     
  Branches     4116     4116              
==========================================
+ Hits        14327    14329       +2     
- Misses        151      153       +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.57% <100.00%> (-0.03%) ⬇️
Services 99.33% <100.00%> (ø)
Shared 99.33% <ø> (ø)
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 617411d...7ebc2f7. 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.89%. Comparing base (617411d) to head (7ebc2f7).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3574      +/-   ##
==========================================
- Coverage   98.90%   98.89%   -0.02%     
==========================================
  Files         806      806              
  Lines       14485    14489       +4     
  Branches     4116     4116              
==========================================
+ Hits        14327    14329       +2     
- Misses        151      153       +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.57% <100.00%> (-0.03%) ⬇️
Services 99.33% <100.00%> (ø)
Shared 99.33% <ø> (ø)
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 617411d...7ebc2f7. 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.89%. Comparing base (617411d) to head (7ebc2f7).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3574      +/-   ##
==========================================
- Coverage   98.90%   98.89%   -0.02%     
==========================================
  Files         806      806              
  Lines       14485    14489       +4     
  Branches     4116     4109       -7     
==========================================
+ Hits        14327    14329       +2     
- Misses        151      153       +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.57% <100.00%> (-0.03%) ⬇️
Services 99.33% <100.00%> (ø)
Shared 99.33% <ø> (ø)
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 617411d...7ebc2f7. 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
7ebc2f7 Thu, 12 Dec 2024 13:44:29 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

@@ -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?

@@ -9,10 +12,18 @@ const Loader = () => (
</div>
)

interface URLParams {
provider: string
Copy link
Contributor

Choose a reason for hiding this comment

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

I think throughout we can retype Provider to be the Provider type now

export type Provider = AllProviders[number]
instead of string

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 ✔️

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