Skip to content

chore(billing-platform): Add trial limits to package line items#325

Open
brendanhsentry wants to merge 2 commits into
mainfrom
brendan/subscription-trials-in-packages
Open

chore(billing-platform): Add trial limits to package line items#325
brendanhsentry wants to merge 2 commits into
mainfrom
brendan/subscription-trials-in-packages

Conversation

@brendanhsentry

@brendanhsentry brendanhsentry commented Jun 23, 2026

Copy link
Copy Markdown
Member

Define trial config amounts in packages. This will be used by the Engagement service to validate that a package is eligible to be used for subscription trials and to provide TrialConfigs to the create_trial API.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 23, 2026, 8:26 PM

@brendanhsentry brendanhsentry marked this pull request as ready for review June 23, 2026 20:26
@brendanhsentry brendanhsentry requested a review from a team as a code owner June 23, 2026 20:26
Comment on lines +29 to +35

// How many units are available for a PackageConfig during a subscription trial? For packages that are not eligible for trials,
// this field will be unset for all line items.
oneof trial_units {
bool is_unlimited_trial = 10;
uint64 num_trial_units = 11;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we really need this? I think it would be a positive change to allow trials for any line item. Why would we want to restrict it and also have the package know about trials?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i'll let brendan confirm but i think the intention is to store the exact amount of units an org gets when they trial a specific package, that needs to be limited to a specific amount based on the package. we need to store this info(the reserved quotas per category for a trial of a specific package) somewhere, not sure what the best place is

@brendanhsentry brendanhsentry Jun 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it would be a positive change to allow trials for any line item.

Subscription trials have limited amounts of reserved quantity for each line item that users do not control. So when a subscription trial begins they get pre-determined reserved quantities for all line items. I needed a way to encode those specific limits in the code.

One option was to define these limits in the Engagement service, but that just felt like an extra file we'd need to update when launching a new line item. Defining it in the package proto also gives us the benefit of being able to enforce the fact that users can only trial specific plans (ie am3_business or am3_business_ent).

I'm ok with defining these trial limits as a constant in the engagement service for now and we can revisit later.

have the package know about trials?

From my perspective, the user is trialing a specific package (including its features, which we'll need to take into account at some point in the future) so it felt natural to include that as part of the package config.

sentry_protos.billing.v1.common.v1.TieredPricingRate uncapped_rate = 9;

// How many units are available for a PackageConfig during a subscription trial? For packages that are not eligible for trials,
// this field will be unset for all line items.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i'm wondering if these fields now mean we cannot effectively inherit from dev to team to business packages, since we will need different trial units for team and business packages, and therefore have to redefine all line item configs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure I follow. Can we leave trial units empty on developer and just overwrite the values in business plans?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this works fine as long as we only allow subscription trials for business, i thought we offer them for team plans as well which means we would need to define trial units differently for team/business packages.

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.

3 participants