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: Migrate off isProPlan helper and onto GQL isProPlan #3599

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

Conversation

ajay-sentry
Copy link
Contributor

@ajay-sentry ajay-sentry commented Dec 19, 2024

Description

This PR is a continuation of milestone 2 to remove all the gazebo helpers hardcoding business logic for is____Plan. In particular, this PR focused on isProPlan

Nothing abnormal, though I did see that one of the test suites wasn't actually calling a mock correctly which took a bit to figure out. Otherwise, this follows the pattern of the other migrations in the milestone (PRs linked on individual tickets).

There's another small update which is to clean up useProPlans, which is just a copy of findProPlans

Closes codecov/engineering-team#3003

Screenshots

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 Dec 19, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-production-system 6.0MB 335 bytes (-0.01%) ⬇️
gazebo-production-system-esm 6.05MB 344 bytes (-0.01%) ⬇️

@codecov-staging
Copy link

codecov-staging bot commented Dec 19, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 6.05MB 344 bytes (-0.01%) ⬇️
gazebo-staging-system 6.0MB 335 bytes (-0.01%) ⬇️

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.01%. Comparing base (96d9efe) to head (0964dda).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3599      +/-   ##
==========================================
+ Coverage   99.00%   99.01%   +0.01%     
==========================================
  Files         810      810              
  Lines       14557    14542      -15     
  Branches     4146     4142       -4     
==========================================
- Hits        14412    14399      -13     
+ Misses        138      136       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
...anPage/subRoutes/CancelPlanPage/CancelPlanPage.tsx 100.00% <100.00%> (ø)
...ard/FreePlanCard/PlanUpgradePro/PlanUpgradePro.jsx 100.00% <100.00%> (ø)
...dePlanPage/UpgradeForm/UpdateBlurb/UpdateBlurb.tsx 100.00% <ø> (ø)
src/services/account/usePlanData.ts 100.00% <ø> (ø)
...rs/ProPlanFeedbackBanner/ProPlanFeedbackBanner.tsx 100.00% <100.00%> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (+2.59%) ⬆️
src/shared/utils/upgradeForm.ts 95.23% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.75% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.45% <100.00%> (+0.13%) ⬆️
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 96d9efe...0964dda. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3599      +/-   ##
==========================================
+ Coverage   99.00%   99.01%   +0.01%     
==========================================
  Files         810      810              
  Lines       14557    14542      -15     
  Branches     4146     4135      -11     
==========================================
- Hits        14412    14399      -13     
+ Misses        138      136       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
...anPage/subRoutes/CancelPlanPage/CancelPlanPage.tsx 100.00% <100.00%> (ø)
...ard/FreePlanCard/PlanUpgradePro/PlanUpgradePro.jsx 100.00% <100.00%> (ø)
...dePlanPage/UpgradeForm/UpdateBlurb/UpdateBlurb.tsx 100.00% <ø> (ø)
src/services/account/usePlanData.ts 100.00% <ø> (ø)
...rs/ProPlanFeedbackBanner/ProPlanFeedbackBanner.tsx 100.00% <100.00%> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (+2.59%) ⬆️
src/shared/utils/upgradeForm.ts 95.23% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.75% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.45% <100.00%> (+0.13%) ⬆️
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 96d9efe...0964dda. Read the comment docs.

Copy link

codecov-public-qa bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.01%. Comparing base (96d9efe) to head (0964dda).

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3599      +/-   ##
==========================================
+ Coverage   99.00%   99.01%   +0.01%     
==========================================
  Files         810      810              
  Lines       14557    14542      -15     
  Branches     4139     4135       -4     
==========================================
- Hits        14412    14399      -13     
+ Misses        138      136       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
...anPage/subRoutes/CancelPlanPage/CancelPlanPage.tsx 100.00% <100.00%> (ø)
...ard/FreePlanCard/PlanUpgradePro/PlanUpgradePro.jsx 100.00% <100.00%> (ø)
...dePlanPage/UpgradeForm/UpdateBlurb/UpdateBlurb.tsx 100.00% <ø> (ø)
src/services/account/usePlanData.ts 100.00% <ø> (ø)
...rs/ProPlanFeedbackBanner/ProPlanFeedbackBanner.tsx 100.00% <100.00%> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (+2.59%) ⬆️
src/shared/utils/upgradeForm.ts 95.23% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.75% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.45% <100.00%> (+0.13%) ⬆️
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 96d9efe...0964dda. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.01%. Comparing base (96d9efe) to head (0964dda).

✅ All tests successful. No failed tests found.

@@            Coverage Diff             @@
##             main    #3599      +/-   ##
==========================================
+ Coverage   99.00%   99.01%   +0.01%     
==========================================
  Files         810      810              
  Lines       14557    14542      -15     
  Branches     4139     4142       +3     
==========================================
- Hits        14412    14399      -13     
+ Misses        138      136       -2     
  Partials        7        7              
Files with missing lines Coverage Δ
...anPage/subRoutes/CancelPlanPage/CancelPlanPage.tsx 100.00% <100.00%> (ø)
...ard/FreePlanCard/PlanUpgradePro/PlanUpgradePro.jsx 100.00% <100.00%> (ø)
...dePlanPage/UpgradeForm/UpdateBlurb/UpdateBlurb.tsx 100.00% <ø> (ø)
src/services/account/usePlanData.ts 100.00% <ø> (ø)
...rs/ProPlanFeedbackBanner/ProPlanFeedbackBanner.tsx 100.00% <100.00%> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (+2.59%) ⬆️
src/shared/utils/upgradeForm.ts 95.23% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.75% <100.00%> (ø)
Services 99.36% <ø> (ø)
Shared 99.45% <100.00%> (+0.13%) ⬆️
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 96d9efe...0964dda. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Dec 19, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
cf65b09 Thu, 19 Dec 2024 22:52:36 GMT Expired Expired
0964dda Thu, 19 Dec 2024 22:59:38 GMT Cloud Enterprise

baseUnitPrice: 10,
benefits: [],
billingRate: BillingRate.MONTHLY,
marketingName: 'Users Basic',
monthlyUploadLimit: 250,
value: Plans.USERS_BASIC,
value: Plans.USERS_PR_INAPPM,
Copy link
Contributor

Choose a reason for hiding this comment

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

mmm why did this value change from basic to pro?

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 the original mock for this test was copy pasted from somewhere else, this is what the mock should've been to begin with

I only updated what I needed to tho admittedly

@@ -535,32 +488,3 @@ describe('isTrialPlan', () => {
expect(isTrialPlan(Plans.USERS_BASIC)).toBeFalsy()
})
})

describe('isProPlan', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we adding the logic in these tests somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic now resides in API!

Copy link
Contributor

@adrian-codecov adrian-codecov left a comment

Choose a reason for hiding this comment

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

Left some q's, although would prefer Rola to leave her thoughts as well

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.

Remove isCodecovProPlan in favor of isProPlan on GQL Schema
3 participants