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

[server] Implement EntitlementServiceUBP.hasPaidSubscription #12305

Merged
merged 2 commits into from
Sep 1, 2022

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Aug 23, 2022

Description

  • Implement hasPaidSubscription logic in EntitlementServiceUBP.

Drive-by fix:

  • No longer "force" "more resources" in usage-based billing -- users can choose their resources, so we can deprecate userGetsMoreResources with usage-based billing (but it's still used by Chargebee customers)

Related Issue(s)

Fixes #12169

How to test

  1. Create a team called "Gitpod Something" to enable the Usage-Based flag for your user and team
  2. Don't add a credit card just yet
  3. Try starting multiple workspaces in parallel -- at 4 parallel workspaces, you should start seeing a paywall that prevents you from starting more (until the currently-running workspaces are stopped again)
  4. Once a workspace is running, you should not be able to extend the workspace timeout (i.e. no "clock" button in the IDE bottom bar)
  5. Now, upgrade your team to paid by adding a credit card
  6. Once upgraded, you should now be able to start up to 16 parallel workspaces before seeing a paywall
  7. You should also be able to extend the workspace timeout (using the "clock" button in the IDE bottom bar)

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview
  • /werft with-payment

@jankeromnes jankeromnes force-pushed the jx/ubb-paid branch 3 times, most recently from abb7c71 to f3d8a78 Compare August 29, 2022 12:32
@jankeromnes jankeromnes marked this pull request as ready for review August 29, 2022 15:02
@jankeromnes jankeromnes requested a review from a team August 29, 2022 15:02
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Aug 29, 2022
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 30, 2022

Hmm, I thought we'd be able to test the Usage-Based free tier, but since it's not implemented, we can't (so I crossed out steps 2 and 3 in the test plan):

Screenshot 2022-08-30 at 09 18 04

Also, unrelatedly, while opening several workspaces, I got a few of these error pages too. Looks like this retryAfter mechanism isn't properly supported in CreateWorkspace:

Screenshot 2022-08-30 at 09 19 35

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Aug 30, 2022

Hmm, I wasn't able to extend my workspace timeout (no clock button) 🤔 I guess this isn't quite ready yet & needs more debugging.

EDIT: Hmm, of course, when you add debug logs, then it works 100% fine. 🙄 ✅

@jankeromnes jankeromnes marked this pull request as draft August 30, 2022 07:54
@jankeromnes jankeromnes force-pushed the jx/ubb-paid branch 2 times, most recently from 2092c32 to a3c6053 Compare August 31, 2022 08:39
@jankeromnes jankeromnes marked this pull request as ready for review August 31, 2022 08:40
@jankeromnes jankeromnes requested a review from geropl August 31, 2022 09:03
@AlexTugarev AlexTugarev self-assigned this Sep 1, 2022
Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

👍🏻 to unblock!

Maybe it would be good to simplify the promise races here ;-)

/hold

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Sep 1, 2022

Thanks! Good suggestion -- adjusted the code, and tested again, still works as intended. 🚀

/unblock

@geropl
Copy link
Member

geropl commented Sep 1, 2022

/unhold

I think that's what @jankeromnes wanted to do here.

@roboquat roboquat merged commit b48b8ff into main Sep 1, 2022
@roboquat roboquat deleted the jx/ubb-paid branch September 1, 2022 08:44
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Sep 1, 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-none size/M team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement EntitlementServiceUBP.hasPaidSubscription
4 participants