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

[UBP] Disable subscriptions to old plans after UBP has been enabled #15092

Merged
merged 2 commits into from
Dec 6, 2022

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Dec 1, 2022

Description

Once UBP has been enabled for a user:

  • Disable individual Plan purchases/upgrades (/plans)
  • Disable old-style Team plan purchases/upgrades (/teams)
  • Disable new-style Team plan purchases/upgrades (Team Billing) -- upgrade UI gets entirely removed with UBP

Related Issue(s)

Fixes #14940

How to test

  1. Upgrade to a paid Chargebee plan in https://jx-disable-chargebee.preview.gitpod-dev.com/plans
  2. Buy a legacy Team Plan in https://jx-disable-chargebee.preview.gitpod-dev.com/teams
  3. Once it's active, assign yourself one seat of this Team Plan
  4. Now, create a team called "Gitpod [Something]" to unlock usage-based
  5. If you now go to https://jx-disable-chargebee.preview.gitpod-dev.com/plans, you can no longer upgrade to any Chargebee paid plan -- you can only cancel by going into billing
  6. If you go to https://jx-disable-chargebee.preview.gitpod-dev.com/teams, you can no longer create a new legacy Team Plan -- you can only cancel by going into billing

Release Notes

Disable upgrades of fixed-price monthly plans for individuals and teams who have pay-as-you-go enabled

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-jx-disable-chargebee.1 because the annotations in the pull request description changed
(with .werft/ from main)

@roboquat roboquat added the size/L label Dec 1, 2022
@jankeromnes jankeromnes force-pushed the jx/disable-chargebee branch 3 times, most recently from 5c2609a to 3f02783 Compare December 1, 2022 17:13
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 2, 2022

Working well! 🎉

/plans /teams
BEFORE UBP Screenshot 2022-12-02 at 10 11 51 Can upgrade to individual plans Screenshot 2022-12-02 at 10 12 00 Can create and manage legacy team plans
AFTER UBP Screenshot 2022-12-02 at 10 14 45 Can no longer upgrade to Chargebee plans Screenshot 2022-12-02 at 10 14 55 Can no longer create legacy team plans

But, importantly, by visiting the old /plans or /teams URLs while on UBP and clicking on billing, you can still view/download your old Chargebee invoices 💡:

Screenshot 2022-12-02 at 10 15 08

@jankeromnes jankeromnes marked this pull request as ready for review December 2, 2022 09:40
@jankeromnes jankeromnes requested a review from a team December 2, 2022 09:40
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Dec 2, 2022
@jankeromnes
Copy link
Contributor Author

Hint for reviewers: Reviewing while ignoring indentation changes is easier -- https://github.com/gitpod-io/gitpod/pull/15092/files?w=1

@svenefftinge
Copy link
Member

After UBP GA do we actually want to allow any kind of plan changes other than cancellation?
We might just allow cancelling

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 2, 2022

We might just allow cancelling

This PR disables all individual Plan actions when you're on UBP (i.e. Downgrade, Upgrade). You can still cancel via the Billing interface as usual. I don't think the Billing interface allows any other change than cancel.

EDIT: Ah, I guess you're asking whether we could do this (disable all plan changes) earlier, i.e. when the UBP flag is turned on, and not wait for when you've successfully cancelled all Chargebee plans? That would also make sense to me. 👍

EDIT 2: Done, let's try that.

@jankeromnes
Copy link
Contributor Author

Hmm, my new change doesn't do exactly what I expected. Back to draft.

@jankeromnes jankeromnes marked this pull request as draft December 2, 2022 11:16
@jankeromnes jankeromnes force-pushed the jx/disable-chargebee branch 4 times, most recently from a746f04 to a6793f7 Compare December 2, 2022 14:52
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 2, 2022

Alright -- Chargebee upgrades in /plans and /teams are now disabled as soon as the usage-based billing flag is turned on. 👍

To test:

  1. Go to /plans, upgrade to Chargebee
  2. Go to /teams, buy a new team plan, assign yourself one seat
  3. Create a team called "Gitpod [Something]" to enable usage-based flag
  4. Now, /plans won't allow you to upgrade to new Chargebee plans (you can only click on billing and cancel)
  5. Similarly, /teams won't allow you to buy new team plans or new seats (you can only cancel)

As requested in the issue, I've also added a blue infobox at the top of both pages when usage-based is enabled:

/plans /teams
Screenshot 2022-12-02 at 15 53 11 Screenshot 2022-12-02 at 15 52 49

@jankeromnes jankeromnes marked this pull request as ready for review December 2, 2022 14:56
@jldec
Copy link
Contributor

jldec commented Dec 2, 2022

I tried to downgrade to free after upgrading the UBP while on a personal paid plan.
This seems to be disabled now and the billing link at the top is missing as well (it appeared later, must be a delay)
Downgrading to free == cancelling for individual plans, so we should preserve the ability to downgrade to free

Before (hovering over downgrade to free)
Screenshot 2022-12-02 at 16 48 55


With UBP (hovering over downgrade to free)
Screenshot 2022-12-02 at 16 48 17

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 5, 2022

I tried to downgrade to free after upgrading the UBP while on a personal paid plan.
This seems to be disabled now and the billing link at the top is missing as well (it appeared later, must be a delay)
Downgrading to free == cancelling for individual plans, so we should preserve the ability to downgrade to free

Many thanks for the feedback @jldec!

The billing link part had me quite worried (should not happen and would break the cancellation UX), but if it came back I agree that it might be some delay or React state bug. In any case, a simple page reload should fix this.

Also, I agree that the Free card action should not get disabled, since downgrading to free is similar to cancelling from 'billing'. Will adjust this.

EDIT: Done ✅

@jldec
Copy link
Contributor

jldec commented Dec 5, 2022

@jankeromnes, when I first opened the team plans page, https://jx-disable-chargebee.preview.gitpod-dev.com/teams in the preview env, I got the dialog to create the new plan, and did not see the blue UBP enabled banner.

Refreshing the page, then disabled the green button, and showed the banner

The page now appears to be stuck on "payment in progress". I believe this is due my script blocker preventing the initial Chargebee interaction to create the 2nd plan (it flashed briefly but did not show any error). Normal browsers would have succeeded, and I expect the "payment in progress" message to time out eventually.

Screenshot 2022-12-05 at 10 35 55

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 5, 2022

@jankeromnes, when I first opened the team plans page, https://jx-disable-chargebee.preview.gitpod-dev.com/teams in the preview env, I got the dialog to create the new plan, and did not see the blue UBP enabled banner.

Refreshing the page, then disabled the green button, and showed the banner

Thanks! Then I guess this PR behaves mostly as expected.

The fact that a refresh is needed is likely due to a bug in how the dashboard-side feature flags are implemented (they don't seem to be using a "React dispatch", and they don't seem to be eagerly updated in App.tsx or Menu.tsx). In any case, this problem is out-of-scope for this PR. I guess the most important thing is that, once you have UBP enabled, eventually it's no longer possible to upgrade to new Chargebee plans. This seems to be the case.

and I expect the "payment in progress" message to time out eventually.

It should automatically time out in every browser after a few minutes. If not, that's a but in the Teams page (which is also out of scope here).

@svenefftinge
Copy link
Member

svenefftinge commented Dec 5, 2022

Your account has been enabled for usage-based billing

We should say that the current plan is deprecated and will be cancelled by End of March 2023.
Also, talking about the benefits of the new pricing plans (workspace classes and flexible timeouts) would be good before pointing to "how to switch".

The disabled cards are still showing a hover effect that suggests they are clickable. Maybe we should not show those cards at all? Just have a big 'Cancel' button.

@jankeromnes
Copy link
Contributor Author

Back to Draft to implement the reword / redesign suggestion.

@geropl
Copy link
Member

geropl commented Dec 5, 2022

@jankeromnes Note that we already limit API interactions based on BillingMode. I did not read the whole context on this PR, but wanted to mentioning it because it make sense to keep that in sync with what we do in the UI.

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 5, 2022

We should say that the current plan is deprecated and will be cancelled by End of March 2023.
Also, talking about the benefits of the new pricing plans (workspace classes and flexible timeouts) would be good before pointing to "how to switch".

@svenefftinge Okay, here is my counter-proposal:

Plans Teams
Screenshot 2022-12-05 at 19 17 48 Screenshot 2022-12-05 at 19 18 18

The disabled cards are still showing a hover effect that suggests they are clickable. Maybe we should not show those cards at all? Just have a big 'Cancel' button.

I've removed the hover effect by adding the pointer-events-none class to disabled Plan cards (this removes all hover and click effects, even if you have listeners).

On the other hand, while I like your more radical proposal of only having a big 'Cancel' button (or, even better, having a new UI that takes users through a single flow from Chargebee cancellation to Stripe re-upgrade), I don't think it's trivial to get the UI right in a short time. It might also be confusing to significantly change the Plans page layout, making it unrecognizable and confusing.

Thus, I'd argue that we merge this PR as is now, and figure out whether a better disabled UI is needed or desirable after GA. 😇

@jankeromnes jankeromnes marked this pull request as ready for review December 5, 2022 18:24
Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Left a comment on the copy used in the alert. 🚨

Comment on lines +638 to +647
<Alert type="message" className="mb-4">
Your account has been enabled for usage-based billing. Discover faster workspace classes and
only pay for what you actually use.{" "}
<a className="gp-link" href="https://www.gitpod.io/docs/configure/billing/usage-based-billing">
Learn more
</a>
<br />
<br />
The old monthly plans are deprecated and will be cancelled by End of March 2023.
</Alert>
Copy link
Contributor

@gtsiolis gtsiolis Dec 5, 2022

Choose a reason for hiding this comment

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

Hey @jankeromnes! Some thoughts on the copy used here:

  1. Too verbose, or uses unnecessary empty space.
  2. Focus on the personal account, not team plans or team billing.
  3. Sounds like the user has been part of a closed beta list and not accessing a GA feature on Gitpod.io.
  4. Voice and tone is not direct, using terms like discover.
  5. Lack of clear action. Do we want to provide an action for users or nudge to perform an action?

What do you think of the following copy?

BEFORE AFTER
alert-before alert-after

Copy link
Member

Choose a reason for hiding this comment

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

Let's not call our pricing as a whole "pay-as-you-go". the pay as you go bit is only the mode where you pay later. We have a free plan and a personal plan with a certain amount of credits that is not pay-as-you-go. We'll likely have other ways to prepurchase credits in the future.
"Usage-based" is ok but I'd prefer to generally just talk about (new) pricing.

Copy link
Contributor

Choose a reason for hiding this comment

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

DEAL 🤝

@jldec
Copy link
Contributor

jldec commented Dec 6, 2022

@jankeromnes - The notification copy to use is:

To access large workspaces and pay-as-you-go, first cancel your existing plan.
Existing plans will keep working until the end of March, 2023.

Thanks @gtsiolis and @svenefftinge for your inputs.
🙏

Details behind this wording are in this RFC (internal)

Copy link
Member

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

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

Looks good. I know there is an ongoing discussion about the exact wording, but the current state is good already and we can do the adjustments in even smaller PRs later.

@roboquat roboquat merged commit c98f5f3 into main Dec 6, 2022
@roboquat roboquat deleted the jx/disable-chargebee branch December 6, 2022 07:10
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UBP] Disable subscriptions to old plans after UBP has been enabled
6 participants