Skip to content

feat(billing): Add can_admin_product_trial to package line items - #528

Draft
dashed wants to merge 2 commits into
mainfrom
aleal/billing-can-admin-product-trial
Draft

dashed wants to merge 2 commits into
mainfrom
aleal/billing-can-admin-product-trial

Conversation

@dashed

@dashed dashed commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Bottom line: Adds can_admin_product_trial to LineItemConfig (field 14) and SharedLineItemPool (field 12). It marks a product that staff can trial from the admin page but customers cannot, such as Size Analysis. Nothing reads the field yet. A getsentry follow-up starts to use it.

  • Why it matters now: getsentry/getsentry#23112 lets staff start product trials that the self-serve rules refuse. To find the staff-only products, it reads LineItemDetails.line_item_category. That field is deprecated, and new code must not read it. The new field puts the rule in the package config, next to can_product_trial.
  • What it does not do: it does not change can_product_trial or what customers can start.
  • Decisions to review:
    • A package config field, not a LineItemTag. Packages already set who can trial a product. Tags tell what a product is.
    • Two booleans, not one enum. An enum prevents the redundant row below, but it replaces can_product_trial and all its readers. Instead, the field comments say to set at most one of the two fields.

How the two fields work together

Customers check only can_product_trial. Staff can start a trial when either field is set.

can_product_trial can_admin_product_trial Customers can start a trial Staff can start a trial Example
unset unset No No Errors, Attachments, Cron Monitors, Uptime
set unset Yes, if the self-serve rules allow it Yes Replays, Spans, Logs, Seer
unset set No Yes Size Analysis
set set Same as row 2 Same as row 2 None. Do not set both.

The self-serve rules refuse a trial when the organization did not finish a subscription trial, or when its sponsorship does not allow trials. Staff skip these rules (getsentry/getsentry#23112). Customers and staff both get one trial per product.

No pool needs the new field today. It is on pools too, so the two trial fields are on the same messages.

Compatibility

New fields only. The default is false, so no package changes.

  • buf lint, buf format, buf breaking, cargo check, cargo clippy and the Python tests pass.
  • The Rust bindings are regenerated. Cargo.lock moves to 0.120.0, as make build-rust does after each release.

Consumer

getsentry/getsentry#23211, a follow-up to getsentry/getsentry#23112, uses the field. It needs a release with this change. It:

  • sets the field on Size Analysis, in the base package that every package with Size Analysis builds on,
  • removes the hardcoded _ADMIN_ONLY_PRODUCT_TRIAL_CATEGORIES,
  • tests that only staff can start a Size Analysis trial on each package, and that no package sets both fields.

Refs REVENG-719

Mark a line item or shared pool that staff can trial from the admin
page, though customers cannot (Size Analysis). getsentry then reads it
from the package config instead of the deprecated line_item_category.
@linear-code

linear-code Bot commented Nov 13, 2026

Copy link
Copy Markdown

REVENG-719

@github-actions

github-actions Bot commented Nov 13, 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✅ passedNov 13, 2026, 12:38 AM

This branch has not been deployed

No deployments
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.

1 participant