Skip to content

feat(billing): Add the ContractService.set_contract_retention endpoint - #427

Draft
dashed wants to merge 2 commits into
mainfrom
aleal/feat/contract-set-retention-endpoint
Draft

dashed wants to merge 2 commits into
mainfrom
aleal/feat/contract-set-retention-endpoint

Conversation

@dashed

@dashed dashed commented Sep 14, 2026

Copy link
Copy Markdown
Member

Adds the endpoint messages behind ContractService.set_contract_retention in getsentry, which getsentry #21135 shipped with temporary request and response dataclasses and a TODO to switch to the endpoint proto. The method replaces a contract's retention overrides in one write. The admin retention endpoint reaches it through the dual write, and the contract migration job uses it to import legacy retention.

One endpoint_set_contract_retention.proto, mirroring MarkInvoicePaid:

  • SetContractRetentionRequest: contract_id plus a RetentionConfig, the same message Contract.retention_config exposes on the read side, so what a caller reads is what it writes back. The request carries the complete override set: an absent field clears, and an empty config removes the override.
  • SetContractRetentionResponse: the RetentionConfig now stored, with no fields set when the request cleared every field.

The getsentry dataclass returns the id of the stored user parameter instead. That is a storage detail of the platform, and nothing in production reads it, so the proto returns the stored override rather than the row id.

The Rust binding is regenerated with make build-rust; Cargo.lock is left to the codegen bot.

dashed and others added 2 commits September 14, 2026 13:01
getsentry's ContractService.set_contract_retention ships with temporary
request and response dataclasses. This adds the endpoint messages so the
method can take the proto: SetContractRetentionRequest carries the contract
id and the complete RetentionConfig to store, and SetContractRetentionResponse
returns the RetentionConfig now stored. Both reuse the message that
Contract.retention_config exposes on the read side.
@github-actions

Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 14, 2026, 5:03 PM

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