Skip to content

ref(billing): PreviewNextInvoiceRequest gains cancel + partner hints#367

Open
armcknight wants to merge 2 commits into
mainfrom
andrewmcknight/preview-next-invoice-hints
Open

ref(billing): PreviewNextInvoiceRequest gains cancel + partner hints#367
armcknight wants to merge 2 commits into
mainfrom
andrewmcknight/preview-next-invoice-hints

Conversation

@armcknight

@armcknight armcknight commented Jul 17, 2026

Copy link
Copy Markdown
Member

Some bot comments pointed out that the original changes in https://github.com/getsentry/getsentry/pull/20791 didn't account for these data. Local validation showed that twiddling the cancel bit changed the value in the next bill box. Claude is telling me there's no good way to test the partner data, although I could probably mock it but haven't tested it yet; maybe it can be removed from here.

There are some pieces of data used in the legacy next bill preview that weren't yet transmitted in the RPC message we're using, and these still aren't represented in platform models so need to currently be derived from Subscriptions.

It looks like maybe the renew data would be done as part of https://linear.app/getsentry/issue/REVENG-266/add-platform-plan-change-compute-service-preview-apply and the self serve partner data from https://linear.app/getsentry/issue/REVENG-228/expand-billing-platform-supportsondemand-to-cover-self-serve-partners.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@armcknight
armcknight requested a review from a team as a code owner July 17, 2026 01:32
@github-actions

github-actions Bot commented Jul 17, 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✅ passedJul 17, 2026, 1:34 AM

@brendanhsentry brendanhsentry left a comment

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 don't think we need this.

Isn't the better long term solution to find a way to represent these concepts in the Contract? Even after we add these parameters to the request, we'd need to the derive their values from the legacy Subscription model right?

@armcknight

Copy link
Copy Markdown
Member Author

@brendanhsentry It does sound like that's the long term plan, but I deemed that out of scope for the current work. We could do this now to keep it working, and move the rest over afterwards, right? Even if we derive these values from Contract, wouldn't it still be able to be transmitted as part of this message?

@linear-code

linear-code Bot commented Jul 17, 2026

Copy link
Copy Markdown

REVENG-266

@brendanhsentry

Copy link
Copy Markdown
Member

Even if we derive these values from Contract, wouldn't it still be able to be transmitted as part of this message?

I don't think so. If a contract should be canceled at the end of the period, then we should (depends on change contract implementation) have a PlatformPendingChange record that will generate the correct subscription invoice items. Similarly for self serve partners, the tax calculation function should know if a contract is eligible to be taxes.

But yeah I guess it's ok to pass for now and leave a TODO.

@noahsmartin noahsmartin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's also not clear to me why we'd need this. The invoicer should be able to read this from the contract_id. What extra information would be necessary from these two fields. Aren't they just derived from the contract_id?

I think for this change it would be good to see the getsentry version (how you plan to use these fields) before we merge the protos version

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