Skip to content

Conversation

@calvin-codecov
Copy link
Contributor

@calvin-codecov calvin-codecov commented Dec 19, 2025

FE followup to codecov/umbrella#569 to close https://linear.app/getsentry/issue/CCMRG-1859/billing-display-mismatch to use new GQL fields in the scheduledPhase object for more accurate upcoming bill price calculation if the customer has an upcoming plan that is different.


Note

Compute next bill price using upcoming scheduledPhase fields, with schema/util additions and comprehensive tests.

  • Billing UI:
    • Refactor PaymentCard.jsx to calculate next bill via new helper calculateNextBillPrice, prioritizing accountDetails.scheduleDetail.scheduledPhase (uses billingRate, baseUnitPrice, plan, quantity), with fallback to current plan data.
    • Update useMemo dependencies to include scheduledPhase.
  • Schema/Types:
    • Extend AccountDetailsSchema to include scheduledPhase.billingRate and scheduledPhase.baseUnitPrice.
  • Utils:
    • Add PlanMarketingNames to shared/utils/billing for plan name matching.
  • Tests:
    • Expand PaymentCard.test.jsx with cases covering scheduled phase transitions (Pro → Team, Team → Pro, Team → Sentry Pro) and various plan/billing scenarios (monthly/annual; Pro/Team/Sentry).

Written by Cursor Bugbot for commit 89abd44. This will update automatically on new commits. Configure here.

Some examples
Screenshot 2025-12-19 at 9 57 36 AM
Screenshot 2025-12-19 at 9 56 40 AM
Screenshot 2025-12-19 at 9 53 05 AM

@linear
Copy link

linear bot commented Dec 19, 2025

@sentry
Copy link

sentry bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.73%. Comparing base (acfda0a) to head (89abd44).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3959   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         826      826           
  Lines       14970    14983   +13     
  Branches     4280     4292   +12     
=======================================
+ Hits        14780    14793   +13     
  Misses        182      182           
  Partials        8        8           
Files with missing lines Coverage Δ
...OrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx 100.00% <100.00%> (ø)
src/services/account/useAccountDetails.ts 100.00% <ø> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.34% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (ø)
Shared 99.00% <100.00%> (+<0.01%) ⬆️
UI 99.01% <ø> (ø)

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 acfda0a...89abd44. Read the comment docs.

@sentry
Copy link

sentry bot commented Dec 19, 2025

Bundle Report

Changes will increase total bundle size by 100 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.23MB 155 bytes (0.0%) ⬆️
gazebo-production-esm 6.31MB -55 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 53 bytes 53.25kB 0.1%
assets/index-legacy.*.js 32 bytes 716.83kB 0.0%
assets/useAccountDetails-legacy.*.js 70 bytes 3.42kB 2.09%

Files in assets/index-legacy.*.js:

  • ./src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx → Total Size: 4.2kB

Files in assets/index-legacy.*.js:

  • ./src/shared/utils/billing.ts → Total Size: 3.16kB

Files in assets/useAccountDetails-legacy.*.js:

  • ./src/services/account/useAccountDetails.ts → Total Size: 4.52kB
view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 36 bytes 639.37kB 0.01%
assets/index.*.js -161 bytes 56.78kB -0.28%
assets/useAccountDetails.*.js 70 bytes 3.36kB 2.13%

Files in assets/index.*.js:

  • ./src/shared/utils/billing.ts → Total Size: 3.0kB

Files in assets/index.*.js:

  • ./src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx → Total Size: 4.2kB

Files in assets/useAccountDetails.*.js:

  • ./src/services/account/useAccountDetails.ts → Total Size: 4.52kB

Comment on lines +43 to +47
scheduledPhasePlanName === PlanMarketingNames.PRO
? calculatePriceProPlan
: scheduledPhasePlanName === PlanMarketingNames.TEAM
? calculatePriceTeamPlan
: calculatePriceSentryPlan
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checking against the marketing names here isn't ideal but it's good enough for our intents and situation. Ideally we would be sending plan name like "teamm" too but this would need another umbrella change.

@codecov-notifications
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3959   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         826      826           
  Lines       14970    14983   +13     
  Branches     4285     4287    +2     
=======================================
+ Hits        14780    14793   +13     
  Misses        182      182           
  Partials        8        8           
Files with missing lines Coverage Δ
...OrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx 100.00% <100.00%> (ø)
src/services/account/useAccountDetails.ts 100.00% <ø> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.34% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (ø)
Shared 99.00% <100.00%> (+<0.01%) ⬆️
UI 99.01% <ø> (ø)

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 acfda0a...89abd44. Read the comment docs.

@codecov-public-qa
Copy link

codecov-public-qa bot commented Dec 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (acfda0a) to head (89abd44).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3959   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         826      826           
  Lines       14970    14983   +13     
  Branches     4285     4287    +2     
=======================================
+ Hits        14780    14793   +13     
  Misses        182      182           
  Partials        8        8           
Files with missing lines Coverage Δ
...OrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx 100.00% <100.00%> (ø)
src/services/account/useAccountDetails.ts 100.00% <ø> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.34% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (ø)
Shared 99.00% <100.00%> (+<0.01%) ⬆️
UI 99.01% <ø> (ø)

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 acfda0a...89abd44. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov-releaser
Copy link
Contributor

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
89abd44 Fri, 19 Dec 2025 17:35:03 GMT Cloud Enterprise

@codecov-qa
Copy link

codecov-qa bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.73%. Comparing base (acfda0a) to head (89abd44).
⚠️ Report is 1 commits behind head on main.

@@            Coverage Diff             @@
##             main    #3959      +/-   ##
==========================================
+ Coverage   95.33%   98.73%   +3.39%     
==========================================
  Files         826      826              
  Lines       14970    14983      +13     
  Branches     4285     4292       +7     
==========================================
+ Hits        14272    14793     +521     
+ Misses        618      182     -436     
+ Partials       80        8      -72     
Files with missing lines Coverage Δ
...OrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx 100.00% <100.00%> (ø)
src/services/account/useAccountDetails.ts 100.00% <ø> (ø)
src/shared/utils/billing.ts 100.00% <100.00%> (+2.08%) ⬆️

... and 53 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.34% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (+0.06%) ⬆️
Shared 99.00% <100.00%> (+33.62%) ⬆️
UI 99.01% <ø> (ø)

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 acfda0a...89abd44. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@calvin-codecov calvin-codecov added this pull request to the merge queue Dec 20, 2025
Merged via the queue into main with commit be8596d Dec 20, 2025
65 checks passed
@calvin-codecov calvin-codecov deleted the cy/next_bill_price_use_new_fields branch December 20, 2025 00:36
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.

4 participants