Skip to content

feat(billing): Add GetContractIdsWithUsageSnapshot to the contract usage snapshot service - #561

Draft
dashed wants to merge 1 commit into
mainfrom
aleal/billing-contract-ids-with-usage-snapshot
Draft

dashed wants to merge 1 commit into
mainfrom
aleal/billing-contract-ids-with-usage-snapshot

Conversation

@dashed

@dashed dashed commented Dec 1, 2026

Copy link
Copy Markdown
Member

Bottom line: This PR adds GetContractIdsWithUsageSnapshot to the contract usage snapshot service (billing.v1.services.contract_usage_snapshot.v1). It takes contract ids and returns the ids that have a usage snapshot. It adds only new messages, so it breaks no client.

  • Why: getsentry PR 23659 must know which closed contracts have a usage snapshot, for many receipts in one request. It added a service method with no protobuf input or output. The billing platform rules in getsentry (getsentry/billing/platform/AGENTS.md, rules 2 and 3) require protobuf input and output and @service_method.
  • Shape: the same as contract.v1.GetOrganizationsAwaitingPayment: a list of ids goes in, and the subset comes out, in no particular order. The method reads no snapshot. It does not filter by organization, so the caller passes only its own contract ids.
  • Consumer: getsentry PR 23659 calls it after the release and the sentry-protos update in sentry.

Checks: buf lint, buf format and buf breaking against main; make build-rust (the bindings and the Cargo.lock version line are in this PR); cargo check and cargo clippy; 64 Python tests.

…age snapshot service

The endpoint takes contract ids and returns the ids that have a usage
snapshot. It reads no snapshot, so a caller can check many contracts in
one call. It has the same shape as GetOrganizationsAwaitingPayment.

getsentry needs it to find, for a page of receipts, which closed
contracts have a usage snapshot, with protobuf input and output.

The Rust bindings and the Cargo.lock version line come from
`make build-rust`.
@github-actions

github-actions Bot commented Dec 1, 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✅ passedDec 1, 2026, 11:58 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