Skip to content

[UBP] Free tier Balance Used and Usage page do not show correct credits used #14363

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

Closed
jldec opened this issue Nov 2, 2022 · 5 comments · Fixed by #14485
Closed

[UBP] Free tier Balance Used and Usage page do not show correct credits used #14363

jldec opened this issue Nov 2, 2022 · 5 comments · Fixed by #14485
Assignees
Labels
feature: billing team: webapp Issue belongs to the WebApp team type: bug Something isn't working

Comments

@jldec
Copy link
Contributor

jldec commented Nov 2, 2022

The personal and team billing pages both show a progress indicator for "Balance Used" with actual usage against the usage limit.

The usage detail page (for individuals and teams) both show a similar total credits used for the current period.

These indicators should derive their "credits used" value from credits used since the last invoice/reset, instead of assuming a calendar billing cycle.

The calculation should mirror the logic used to compute "credits used" to show the usage limit 80% or limit exceeded notifications and prevent workspace starts.

@jldec
Copy link
Contributor Author

jldec commented Nov 2, 2022

Related to #14367

@geropl geropl self-assigned this Nov 3, 2022
@geropl
Copy link
Member

geropl commented Nov 3, 2022

I think the idea here was instead of retrieving the limit value, make sure that the selected time range matches what we expect from the Billing page. 🤔

@geropl
Copy link
Member

geropl commented Nov 3, 2022

Steps to tackle this:

  • fix "usage bar"
    • extend the GetStripeSubscriptionResponse to also contain billingPeriod information
    • make that available via JSON RPC
    • use those values in the BillingConfig view to set/calculate period start&end here (which will fix the display in the usage bar because we now select correctly)
  • make "Usage view" select arbitrary dates
    • add parameters for date selection, e.g.: https://gitpod.io/t/gitpod/usage?start=...&end=...
    • if set, use those here
  • make the "Usage View" link on the BillingConfig page set the start/end parameters based on the actual BillingCycle

@jldec
Copy link
Contributor Author

jldec commented Nov 4, 2022

Reported again today by early-access user here (interna) and by Gitpodder here (internal).

@jldec jldec unassigned geropl Nov 7, 2022
@jldec jldec changed the title [UBP] Personal and Team usage "balance used" indicators should not assume calendar month billing cycles [UBP] Free tier Balance Used and Usage page do not show correct credits used Nov 7, 2022
@easyCZ
Copy link
Member

easyCZ commented Nov 7, 2022

fix "usage bar"
extend the GetStripeSubscriptionResponse to also contain billingPeriod information

The StripeSubscription will only contain details if there's a Stripe subscription - free tier doesn't have a subscription. It seems like we need the CostCenter for this. However, currently Stripe doens't set the NextBillingTime for that. We could have it set the NextBillingTime

@jankeromnes jankeromnes moved this from Scheduled to In Progress in 🍎 WebApp Team Nov 7, 2022
Repository owner moved this from In Progress to In Validation in 🍎 WebApp Team Nov 11, 2022
@jankeromnes jankeromnes moved this from In Validation to Done in 🍎 WebApp Team Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: billing team: webapp Issue belongs to the WebApp team type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants