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: Ensure All Queries Use Object Syntax #2389

Merged

Conversation

nicholas-codecov
Copy link
Contributor

Description

This PR updates a handful of queries to use the object syntax in preparation for the migration to TanStack v5.

Setup work for codecov/engineering-team#678

Notable Changes

  • Update a handful of hooks to object syntax
  • Update MemberTable and how it invalidates queries

Copy link

netlify bot commented Nov 7, 2023

Deploy Preview for gazebo-staging ready!

Name Link
🔨 Latest commit 37c9976
🔍 Latest deploy log https://app.netlify.com/sites/gazebo-staging/deploys/654be3404211ce000804c6aa
😎 Deploy Preview https://deploy-preview-2389--gazebo-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov-staging
Copy link

codecov-staging bot commented Nov 7, 2023

Codecov Report

Merging #2389 (37c9976) into main (38a6095) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2389      +/-   ##
==========================================
- Coverage   96.15%   96.15%   -0.01%     
==========================================
  Files         748      748              
  Lines        9327     9325       -2     
  Branches     2332     2288      -44     
==========================================
- Hits         8968     8966       -2     
- Misses        341      343       +2     
+ Partials       18       16       -2     
Files Coverage Δ
...AdminAccess/AdminAccessTable/useAdminAccessList.js 100.00% <100.00%> (ø)
...inSettings/AdminMembers/MemberList/MemberTable.jsx 100.00% <100.00%> (ø)
src/services/commits/useCommits.js 100.00% <100.00%> (ø)
src/services/commits/useCommitsTeam.tsx 100.00% <ø> (ø)
src/services/pull/usePullTeam.tsx 100.00% <ø> (ø)
src/services/repo/useRepoFlags.js 100.00% <100.00%> (ø)
src/services/repo/useRepoFlagsSelect.js 100.00% <100.00%> (ø)
src/services/repos/useReposTeam.tsx 95.23% <100.00%> (ø)
src/services/selfHosted/useSelfHostedUserList.js 100.00% <100.00%> (ø)
src/services/users/useInfiniteUser.js 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes


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 38a6095...37c9976. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Nov 7, 2023

Codecov Report

Merging #2389 (37c9976) into main (38a6095) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2389      +/-   ##
==========================================
- Coverage   96.15%   96.15%   -0.01%     
==========================================
  Files         748      748              
  Lines        9327     9325       -2     
  Branches     2332     2332              
==========================================
- Hits         8968     8966       -2     
  Misses        341      341              
  Partials       18       18              
Files Coverage Δ
...AdminAccess/AdminAccessTable/useAdminAccessList.js 100.00% <100.00%> (ø)
...inSettings/AdminMembers/MemberList/MemberTable.jsx 100.00% <100.00%> (ø)
src/services/commits/useCommits.js 100.00% <100.00%> (ø)
src/services/commits/useCommitsTeam.tsx 100.00% <ø> (ø)
src/services/pull/usePullTeam.tsx 100.00% <ø> (ø)
src/services/repo/useRepoFlags.js 100.00% <100.00%> (ø)
src/services/repo/useRepoFlagsSelect.js 100.00% <100.00%> (ø)
src/services/repos/useReposTeam.tsx 95.23% <100.00%> (ø)
src/services/selfHosted/useSelfHostedUserList.js 100.00% <100.00%> (ø)
src/services/users/useInfiniteUser.js 100.00% <100.00%> (ø)

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 38a6095...37c9976. Read the comment docs.

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #2389 (37c9976) into main (38a6095) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2389   +/-   ##
=====================================
  Coverage   96.15   96.15           
=====================================
  Files        748     748           
  Lines       9327    9325    -2     
  Branches    2319    2332   +13     
=====================================
- Hits        8968    8966    -2     
- Misses       341     343    +2     
+ Partials      18      16    -2     
Files Coverage Δ
...AdminAccess/AdminAccessTable/useAdminAccessList.js 100.00% <100.00%> (ø)
...inSettings/AdminMembers/MemberList/MemberTable.jsx 100.00% <100.00%> (ø)
src/services/commits/useCommits.js 100.00% <100.00%> (ø)
src/services/commits/useCommitsTeam.tsx 100.00% <ø> (ø)
src/services/pull/usePullTeam.tsx 100.00% <ø> (ø)
src/services/repo/useRepoFlags.js 100.00% <100.00%> (ø)
src/services/repo/useRepoFlagsSelect.js 100.00% <100.00%> (ø)
src/services/repos/useReposTeam.tsx 95.23% <100.00%> (ø)
src/services/selfHosted/useSelfHostedUserList.js 100.00% <100.00%> (ø)
src/services/users/useInfiniteUser.js 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes


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 38a6095...37c9976. Read the comment docs.

params?.search,
params?.isAdmin,
])
queryClient.invalidateQueries(['SelfHostedUserList'])
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need the whole sets of params to invalidate the query right? Like if you had a query key with

['SelfHostedUserList', 'gh']
['SelfHostedUserList', 'gh', 'codecov']
['SelfHostedUserList']

That prompt will invalidate any of them right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe so, they're not 100% explicit, in the docs they say:

The invalidateQueries method can be used to invalidate and refetch single or multiple queries in the cache based on their query keys or any other functionally accessible property/state of the query. By default, all matching queries are immediately marked as invalid and active queries are refetched in the background.

@nicholas-codecov nicholas-codecov merged commit 23d501c into main Nov 8, 2023
@nicholas-codecov nicholas-codecov deleted the gh-eng-678-ensure-all-queries-use-object-notation branch November 8, 2023 19:54
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.

2 participants