feat(billing-platform): Add bare-minimum Grant proto for Engagement Service#238
Merged
Conversation
|
The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).
|
495ae9c to
153c151
Compare
dashed
added a commit
that referenced
this pull request
May 8, 2026
Address PR #238 review feedback ("start small, build over time"): - Replace `optional SKU sku` with `repeated string line_item_uids` to match the billing platform's string UID convention - Remove grant_source.proto (deferred to P2) - Remove trial.proto (deferred to P4) - Remove reserved field blocks, audit fields, revocation fields - Remove GRANT_STATUS_PENDING (deferred) - Simplify comments; remove internal references - Regenerate Rust bindings
8f2af0a to
2e39922
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2e39922. Configure here.
brendanhsentry
approved these changes
May 20, 2026
krithikravi
reviewed
May 20, 2026
| // Consumable now; within [start_date, end_date]. | ||
| GRANT_STATUS_ACTIVE = 1; | ||
| // Manually deactivated (admin revoke, customer opt-out, etc.). | ||
| GRANT_STATUS_INACTIVE = 2; |
Member
There was a problem hiding this comment.
why do we differentiate between inactive and expired?
Member
Author
There was a problem hiding this comment.
@krithikravi grants can be naturally expired via time or manually revoked by a human/user. based on this, it'll be better to have two explicit statuses for why a grant is not active.
Add the `services/engagement/v1/` proto namespace with the three core message files for the new Engagement Service: - `grant_source.proto` — GrantSource enum (10 values covering trial, promo, recurring, gift, partner, and committed-spend sources) - `grant.proto` — Grant message, GrantType enum (UNITS, with CENTS reserved for Phase 3), GrantStatus enum (ACTIVE, INACTIVE, PENDING, EXPIRED), and server-side invariants (N1–N4, N6, N7) - `trial.proto` — Trial message, TrialType enum (PLAN, PRODUCT, SUBSCRIPTION, ENTERPRISE), TrialStatus, TrialSource with N5 concurrency invariant Grant replaces the legacy `billing.v1.Credit` message (renamed to resolve the 11-site naming collision with dollar-credit paths). Phase 3 reserved fields (14–20, 24–25) accommodate CENTS absorption and multi-period caps without wire-format changes. Also adds a CODEOWNERS entry for the engagement package.
Replace "Phase 2" / "Phase 3" references with self-contained language
("currently", "future", "not yet active") so proto comments are
understandable without access to internal planning docs.
The INVARIANTS block (N1-N8) describes service-layer behavioral contracts that reference endpoint protos and RPCs not yet defined. These belong with the endpoint protos or service implementation, not the bare message definitions.
Address PR #238 review feedback ("start small, build over time"): - Replace `optional SKU sku` with `repeated string line_item_uids` to match the billing platform's string UID convention - Remove grant_source.proto (deferred to P2) - Remove trial.proto (deferred to P4) - Remove reserved field blocks, audit fields, revocation fields - Remove GRANT_STATUS_PENDING (deferred) - Simplify comments; remove internal references - Regenerate Rust bindings
2e39922 to
d6396d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Establishes the
services/engagement/v1/proto namespace with a bare-minimumGrantmessage — the single entity UsagePricer needs to consume grants.What's in this PR
grant.proto— one message, two enums, 38 lines:repeated string line_item_uidsto match the platform's string UID convention (LineItemDetails.uid,LineItemUsageSummary.line_item_uid)GRANT_TYPE_CENTSincluded as a real enum value (no breaking-change concern since the enum is new)Other changes:
CODEOWNERS—/proto/sentry_protos/billing→@getsentry/revenueReview feedback addressed
Grant.sku→ string UIDsrepeated string line_item_uids = 4Trial.plan→package_uidTrial.sku→line_item_uidTRIAL_SOURCE_DEFAULT→SELF_SERVEWhat's next
Each follow-up PR adds the minimum needed for the next implementation step:
grant_source.proto+ source field on Grantendpoint_get_active_grantstrial.proto(Trial + enums)endpoint_get_active_triallist_trials+ revocation audit fieldscredit.proto+endpoint_get_trials.protoTest plan
buf lintpassesbuf formatpassesbuf breaking --against mainpasses (all changes additive)make build-pygenerates Python stubsmake build-rustgenerates Rust bindings