Skip to content

feat(billing): Add protobuf definitions for the seats service - #414

Open
volokluev wants to merge 4 commits into
mainfrom
billing/seats-service-protos
Open

feat(billing): Add protobuf definitions for the seats service#414
volokluev wants to merge 4 commits into
mainfrom
billing/seats-service-protos

Conversation

@volokluev

Copy link
Copy Markdown
Member

Summary

  • Adds protobuf message definitions for the billing platform seats service under proto/sentry_protos/billing/v1/services/seats/v1/
  • Defines SeatObject, request/response messages for all seat service endpoints, and enums (SeatOutcome, ExternalProductSeatStatus)
  • Replaces the dataclass prototypes currently in getsentry with proper protobuf types

Proto files

  • seat_object.proto — shared SeatObject message
  • endpoint_check_assign_seats.protoCheckAssignSeatsRequest/Response, SeatOutcome enum
  • endpoint_assign_seat.protoAssignSeatRequest/Response
  • endpoint_disable_seat.protoDisableSeatRequest
  • endpoint_remove_seat.protoRemoveSeatRequest
  • endpoint_update_seat_identifier.protoUpdateSeatIdentifierRequest
  • endpoint_get_seat_status.protoGetSeatStatusForExternalProductRequest/Response, ExternalProductSeatStatus enum
  • endpoint_get_daily_seat_usage_by_project.protoGetDailySeatUsageByProjectResponse, ProjectSeatUsage
  • endpoint_rollover_seats.protoRolloverSeatsToNewContractRequest

Companion PR

  • getsentry consumer PR: (will link once created)

Test plan

  • Proto files compile successfully with make build-py
  • Generated Python classes import and instantiate correctly
  • getsentry test suite passes with editable install of these protos

Define proto messages for the billing platform seats service endpoints:
- SeatObject: shared seat entity message
- CheckAssignSeats: request/response with SeatOutcome enum
- AssignSeat: request/response
- DisableSeat, RemoveSeat, UpdateSeatIdentifier: request messages
- GetSeatStatusForExternalProduct: request/response with ExternalProductSeatStatus enum
- GetDailySeatUsageByProject: response with ProjectSeatUsage
- RolloverSeatsToNewContract: request message
@volokluev
volokluev requested a review from a team as a code owner August 28, 2026 22:29
@github-actions

github-actions Bot commented Aug 28, 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✅ passedAug 28, 2026, 10:52 PM

@volokluev

Copy link
Copy Markdown
Member Author

Companion getsentry PR: https://github.com/getsentry/getsentry/pull/21710

Comment on lines +11 to +14
}

message GetDailySeatUsageByProjectResponse {
repeated ProjectSeatUsage projects = 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The endpoint_get_daily_seat_usage_by_project.proto file defines a response message but is missing the corresponding request message, making the endpoint unusable.
Severity: HIGH

Suggested Fix

Define a GetDailySeatUsageByProjectRequest message within endpoint_get_daily_seat_usage_by_project.proto. This message should include necessary parameters for the query, similar to other request messages in the service, such as organization_id and date range fields.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
proto/sentry_protos/billing/v1/services/seats/v1/endpoint_get_daily_seat_usage_by_project.proto#L11-L14

Potential issue: The protobuf definition for the `GetDailySeatUsageByProject` endpoint
in `endpoint_get_daily_seat_usage_by_project.proto` includes a
`GetDailySeatUsageByProjectResponse` message but omits the corresponding
`GetDailySeatUsageByProjectRequest` message. Other query endpoints in the billing
service, such as `GetUsageByProject`, define both request and response messages. Without
a defined request message, clients have no contract for how to call this new endpoint,
rendering it unusable.

Did we get this right? 👍 / 👎 to inform future reviews.

volokluev and others added 2 commits August 28, 2026 22:51
Move SeatObject from services/seats/v1/ to billing/v1/ since it is a
shared type used across multiple service boundaries. Update all service
protos to import from the new location.
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