Skip to content

ConfigCat: forward property for PAID tier (Chargebee or Stripe) #12840

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
geropl opened this issue Sep 9, 2022 · 8 comments · Fixed by #13138
Closed

ConfigCat: forward property for PAID tier (Chargebee or Stripe) #12840

geropl opened this issue Sep 9, 2022 · 8 comments · Fixed by #13138
Assignees
Labels
size/XS team: webapp Issue belongs to the WebApp team

Comments

@geropl
Copy link
Member

geropl commented Sep 9, 2022

@kylos101 Made a case that it would be nice to filter on paid/free tier in some cases (internal Slack).

We should look into if and how we can implement this with little effort. E.g. maybe by using EntitlementService.hasPaidSubscription or so, and offer that to Team Workspace.

@kylos101
Copy link
Contributor

@geropl it looks like this is part of week 37! 🥳 Is that official? I ask because the issue has no status (is not Scheduled). 🙏

@geropl
Copy link
Member Author

geropl commented Sep 12, 2022

@kylos101 We're experimenting with a new process. Let's see how it works out. Currently, "no status" = no guarantee 😉

@geropl geropl moved this to Scheduled in 🍎 WebApp Team Sep 12, 2022
@easyCZ
Copy link
Member

easyCZ commented Sep 12, 2022

A couple of notes for this issue:

  • Because ConfigCat is declarative, the best we can do is have a property in ConfigCat which is tier and we can match on some enum values (or bool).
  • The enum value for a given user can only be determined at runtime and during evaluation of the feature flag - in other words the client that performs the evaluation has to know the value of tier for the given user/workspace etc.
  • When using the tier in conjunction with TeamID or other Identifiers, use the confidential text comparators to mask the actual values.

@easyCZ
Copy link
Member

easyCZ commented Sep 22, 2022

Just exploring this issue further to make it implementable.

I'm assuming the goal here is to add a new property to the attributes we can specify in the JS/TS wrapper for ConfigCat.

I'm also assuming we want the property to be something like:
tier = stripe | chargebee or not set when the user is not on a paid subscription.

In ConfigCat, it's not possible to match against multiple properties simultaneously, that is we cannot do teamID = 123 AND tier = stripe. Hence, I'm assuming that the targeting model in ConfigCat will look like the following:

IF teamID = 123 then TRUE
IF tier = stripe then TRUE
IF teamID = 999 then FALSE.

@easyCZ
Copy link
Member

easyCZ commented Sep 22, 2022

Similarly, you cannot specify the rule for % based rollout with another matching condition.

The following is NOT supported by ConfigCat
IF tier = stripe
    THEN 30% = false 70% true

@easyCZ
Copy link
Member

easyCZ commented Sep 22, 2022

On the code level, implementing this should boil down to calling to the BillingMode service.

I believe we need to go through the service, because there is additional logic to determine the billing which is not self-contained elsewhere. This also introduces a dependency on another feature flag - isUsageBasedBillingEnabled and also introduces a dependency on Stripe (and may introduce dependency on Stripe's rate limit).

@geropl
Copy link
Member Author

geropl commented Sep 23, 2022

BTW here is a first attempt: #13138

@geropl
Copy link
Member Author

geropl commented Sep 23, 2022

Citing from the PR:

Instead of drilling this into BillingMode I opted for extending EntitlementService because it's a separate concern.
Still not super happy with the overhead we're creating, but want to unblock PVC.

We should really think about throwing it away afterwards. broom

@geropl geropl self-assigned this Sep 26, 2022
@geropl geropl moved this from Scheduled to In Progress in 🍎 WebApp Team Sep 26, 2022
Repository owner moved this from In Progress to Done in 🍎 WebApp Team Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS team: webapp Issue belongs to the WebApp team
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants