-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ 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
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found @@ 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
Continue to review full report in Codecov by Sentry.
|
Bundle ReportChanges will increase total bundle size by 75 bytes ⬆️
|
Bundle ReportChanges will increase total bundle size by 75 bytes ⬆️
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ 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
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
const { data: tierName } = useTier({ provider, owner }) | ||
const { data: tierName } = useTier({ | ||
provider, | ||
owner: owner || userData?.user?.username, |
There was a problem hiding this comment.
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?
Closing PR since this is likely a more systemic issue |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ 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
Continue to review full report in Codecov by Sentry.
|
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.