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: Remove tier name, use isTeamPlan #3666

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

Conversation

RulaKhaled
Copy link
Contributor

Description

There's no need to fetch the tier name anymore; we should unify the queries to use isTeamPlan, as it's consistently used throughout the codebase.

Notable Changes

  • Refactored useTiers -> useIsTeamPlan
  • Updated components and tests to align with the new hook structure.

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.

@codecov-notifications
Copy link

codecov-notifications bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3666      +/-   ##
==========================================
- Coverage   98.91%   98.91%   -0.01%     
==========================================
  Files         817      817              
  Lines       14720    14714       -6     
  Branches     4165     4171       +6     
==========================================
- Hits        14561    14555       -6     
  Misses        152      152              
  Partials        7        7              
Files with missing lines Coverage Δ
src/pages/AnalyticsPage/Chart/useCoverage.ts 100.00% <100.00%> (ø)
...es/AnalyticsPage/ChartSelectors/ChartSelectors.jsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...Coverage/CommitCoverageTabs/CommitCoverageTabs.jsx 100.00% <100.00%> (ø)
...ommitCoverage/UploadsCard/useUploads/useUploads.ts 100.00% <100.00%> (ø)
...overage/routes/FilesChangedTab/FilesChangedTab.tsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/Header/Header.tsx 100.00% <100.00%> (ø)
...mitDetailPage/Header/ToggleHeader/ToggleHeader.tsx 100.00% <100.00%> (ø)
...TeamPlanSpecialOffer/TeamPlanCard/TeamPlanCard.tsx 100.00% <ø> (ø)
...d/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx 100.00% <ø> (ø)
... and 23 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.62% <100.00%> (-0.01%) ⬇️
Services 99.28% <100.00%> (-0.01%) ⬇️
Shared 99.37% <100.00%> (-0.01%) ⬇️
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 162b8ca...9b36f3c. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.91%. Comparing base (162b8ca) to head (9b36f3c).

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3666      +/-   ##
==========================================
- Coverage   98.91%   98.91%   -0.01%     
==========================================
  Files         817      817              
  Lines       14720    14714       -6     
  Branches     4165     4171       +6     
==========================================
- Hits        14561    14555       -6     
  Misses        152      152              
  Partials        7        7              
Files with missing lines Coverage Δ
src/pages/AnalyticsPage/Chart/useCoverage.ts 100.00% <100.00%> (ø)
...es/AnalyticsPage/ChartSelectors/ChartSelectors.jsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...Coverage/CommitCoverageTabs/CommitCoverageTabs.jsx 100.00% <100.00%> (ø)
...ommitCoverage/UploadsCard/useUploads/useUploads.ts 100.00% <100.00%> (ø)
...overage/routes/FilesChangedTab/FilesChangedTab.tsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/Header/Header.tsx 100.00% <100.00%> (ø)
...mitDetailPage/Header/ToggleHeader/ToggleHeader.tsx 100.00% <100.00%> (ø)
...TeamPlanSpecialOffer/TeamPlanCard/TeamPlanCard.tsx 100.00% <ø> (ø)
...d/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx 100.00% <ø> (ø)
... and 23 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.62% <100.00%> (-0.01%) ⬇️
Services 99.28% <100.00%> (-0.01%) ⬇️
Shared 99.37% <100.00%> (-0.01%) ⬇️
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 162b8ca...9b36f3c. Read the comment docs.

Copy link

codecov-public-qa bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.91%. Comparing base (162b8ca) to head (9b36f3c).

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3666      +/-   ##
==========================================
- Coverage   98.91%   98.91%   -0.01%     
==========================================
  Files         817      817              
  Lines       14720    14714       -6     
  Branches     4165     4163       -2     
==========================================
- Hits        14561    14555       -6     
  Misses        152      152              
  Partials        7        7              
Files with missing lines Coverage Δ
src/pages/AnalyticsPage/Chart/useCoverage.ts 100.00% <100.00%> (ø)
...es/AnalyticsPage/ChartSelectors/ChartSelectors.jsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...Coverage/CommitCoverageTabs/CommitCoverageTabs.jsx 100.00% <100.00%> (ø)
...ommitCoverage/UploadsCard/useUploads/useUploads.ts 100.00% <100.00%> (ø)
...overage/routes/FilesChangedTab/FilesChangedTab.tsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/Header/Header.tsx 100.00% <100.00%> (ø)
...mitDetailPage/Header/ToggleHeader/ToggleHeader.tsx 100.00% <100.00%> (ø)
...TeamPlanSpecialOffer/TeamPlanCard/TeamPlanCard.tsx 100.00% <ø> (ø)
...d/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx 100.00% <ø> (ø)
... and 23 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.62% <100.00%> (-0.01%) ⬇️
Services 99.28% <100.00%> (-0.01%) ⬇️
Shared 99.37% <100.00%> (-0.01%) ⬇️
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 162b8ca...9b36f3c. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Jan 17, 2025

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
3cf3a2a Fri, 17 Jan 2025 15:57:51 GMT Expired Expired
9b36f3c Fri, 17 Jan 2025 17:13:00 GMT Cloud Enterprise

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.91%. Comparing base (162b8ca) to head (9b36f3c).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3666      +/-   ##
==========================================
- Coverage   98.91%   98.91%   -0.01%     
==========================================
  Files         817      817              
  Lines       14720    14714       -6     
  Branches     4173     4171       -2     
==========================================
- Hits        14561    14555       -6     
  Misses        152      152              
  Partials        7        7              
Files with missing lines Coverage Δ
src/pages/AnalyticsPage/Chart/useCoverage.ts 100.00% <100.00%> (ø)
...es/AnalyticsPage/ChartSelectors/ChartSelectors.jsx 100.00% <100.00%> (ø)
...CommitDetailPage/CommitCoverage/CommitCoverage.jsx 100.00% <100.00%> (ø)
...Coverage/CommitCoverageTabs/CommitCoverageTabs.jsx 100.00% <100.00%> (ø)
...ommitCoverage/UploadsCard/useUploads/useUploads.ts 100.00% <100.00%> (ø)
...overage/routes/FilesChangedTab/FilesChangedTab.tsx 100.00% <100.00%> (ø)
src/pages/CommitDetailPage/Header/Header.tsx 100.00% <100.00%> (ø)
...mitDetailPage/Header/ToggleHeader/ToggleHeader.tsx 100.00% <100.00%> (ø)
...TeamPlanSpecialOffer/TeamPlanCard/TeamPlanCard.tsx 100.00% <ø> (ø)
...d/FreePlanCard/PlanUpgradeTeam/PlanUpgradeTeam.jsx 100.00% <ø> (ø)
... and 23 more
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.62% <100.00%> (-0.01%) ⬇️
Services 99.28% <100.00%> (-0.01%) ⬇️
Shared 99.37% <100.00%> (-0.01%) ⬇️
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 162b8ca...9b36f3c. Read the comment docs.

Copy link

codecov bot commented Jan 17, 2025

Bundle Report

Changes will decrease total bundle size by 773 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.05MB 419 bytes (-0.01%) ⬇️
gazebo-production-esm 6.1MB 354 bytes (-0.01%) ⬇️

}),
})

export const TierNames = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move this const over to billing.ts to be with the other consts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call

provider: string
owner: string
}

const query = `
query OwnerTier($owner: String!) {
query OwnerPlan($owner: String!) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this query be called OwnerPlan or isTeamPlan?

The former implies this query does more than return isTeamPlan imo

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 think IsTeamPlan would make more sense yah

setup({ tierValue, privateRepo })
isTeamPlan | privateRepo
${false} | ${true}
${false} | ${false}
Copy link
Contributor

Choose a reason for hiding this comment

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

2 of these cases are the same now I believe

@@ -149,3 +149,10 @@ export function lastTwoDigits(value: number | string) {
}
return null
}

export const TierNames = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can we move these to the top of the file with the other consts? 😅

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