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

fix: Add fallback to owner param if doesn't exist on useTier hook #2820

Merged
merged 2 commits into from
May 16, 2024

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented Apr 30, 2024

Description

fixes: https://github.com/codecov/internal-issues/issues/457

When calling the useTier hook, we're returning an error to the client because no owner is passed in. This could be due to the presence of no owner being in the URL params, which is then passed down to the ReposTable component and then used to call the hook.

One interesting thing I noticed with the useTier hook called in the ReposTable specifically, is this is the only component where we have a fallback for owner set on another hook, useOwner. My thinking here is this could have been a case where we forgot to add it to this one as well, though even going back to old commit history it's hard to see why the fallback was added here specifically. PR reference here: #1650

It am not completely certain if this is the fix, it just seems like a logical breadcrumb and fall-back to have added in the first place

Related logs

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.48%. Comparing base (c1a8e81) to head (1aa74b3).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2820   +/-   ##
=====================================
  Coverage   98.48   98.48           
=====================================
  Files        878     878           
  Lines      13026   13027    +1     
  Branches    3470    3489   +19     
=====================================
+ Hits       12828   12829    +1     
  Misses       194     194           
  Partials       4       4           
Files Coverage Δ
src/shared/ListRepo/ReposTable/ReposTable.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <100.00%> (+<0.01%) ⬆️
UI 94.53% <ø> (ø)

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 c1a8e81...1aa74b3. Read the comment docs.

Copy link

codecov-public-qa bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.48%. Comparing base (c1a8e81) to head (1aa74b3).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2820   +/-   ##
=======================================
  Coverage   98.47%   98.48%           
=======================================
  Files         878      878           
  Lines       13026    13027    +1     
  Branches     3488     3494    +6     
=======================================
+ Hits        12828    12829    +1     
  Misses        194      194           
  Partials        4        4           
Files Coverage Δ
src/shared/ListRepo/ReposTable/ReposTable.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <100.00%> (+<0.01%) ⬆️
UI 94.53% <ø> (ø)

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 c1a8e81...1aa74b3. Read the comment docs.

@codecov-staging
Copy link

codecov-staging bot commented Apr 30, 2024

Bundle Report

Changes will increase total bundle size by 75 bytes ⬆️

Bundle name Size Change
gazebo-staging-array-push 6.61MB 75 bytes ⬆️

Copy link

codecov bot commented Apr 30, 2024

Bundle Report

Changes will increase total bundle size by 75 bytes ⬆️

Bundle name Size Change
gazebo-production-array-push 6.61MB 75 bytes ⬆️

@codecov-qa
Copy link

codecov-qa bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.48%. Comparing base (c1a8e81) to head (1aa74b3).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2820   +/-   ##
=======================================
  Coverage   98.47%   98.48%           
=======================================
  Files         878      878           
  Lines       13026    13027    +1     
  Branches     3488     3489    +1     
=======================================
+ Hits        12828    12829    +1     
  Misses        194      194           
  Partials        4        4           
Files Coverage Δ
src/shared/ListRepo/ReposTable/ReposTable.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <100.00%> (+<0.01%) ⬆️
UI 94.53% <ø> (ø)

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 c1a8e81...1aa74b3. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Apr 30, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Commit Created Cloud Enterprise
a359549 Tue, 30 Apr 2024 18:58:01 GMT Expired Expired
1aa74b3 Thu, 16 May 2024 18:12:01 GMT Expired Expired
1aa74b3 Thu, 16 May 2024 18:12:40 GMT Cloud Enterprise

const { data: tierName } = useTier({ provider, owner })
const { data: tierName } = useTier({
provider,
owner: owner || userData?.user?.username,
Copy link
Contributor

Choose a reason for hiding this comment

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

the fallback is the signed in user and owner is the org being viewed? Shouldn't this always return the org's plan tier and shouldn't ever return the user's plan tier?

@ajay-sentry
Copy link
Contributor Author

Closing PR since this is likely a more systemic issue

@JerrySentry JerrySentry reopened this May 16, 2024
@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    #2820   +/-   ##
=======================================
  Coverage   98.47%   98.48%           
=======================================
  Files         878      878           
  Lines       13026    13027    +1     
  Branches     3425     3426    +1     
=======================================
+ Hits        12828    12829    +1     
  Misses        194      194           
  Partials        4        4           
Files Coverage Δ
src/shared/ListRepo/ReposTable/ReposTable.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.26% <ø> (ø)
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <100.00%> (+<0.01%) ⬆️
UI 94.53% <ø> (ø)

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 c1a8e81...1aa74b3. Read the comment docs.

@JerrySentry JerrySentry added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit 788535a May 16, 2024
60 checks passed
@JerrySentry JerrySentry deleted the Ajay/fall-back-owner-check branch May 16, 2024 18:10
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