From 8728daf4716096d07fc709b043aee38e649e7633 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 3 Sep 2026 18:34:52 +0000 Subject: [PATCH 1/2] feat(billing): add EndTrial and OrganizationTrialEnded protos Support ending billing-platform subscription trials early from admin via EngagementService, with a cache-busting trial-ended event. Co-authored-by: Armen Zambrano G. --- .../services/engagement/v1/endpoint_end_trial.proto | 13 +++++++++++++ .../services/events/v1/billing_platform_event.proto | 2 ++ .../events/v1/organization_trial_ended.proto | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 proto/sentry_protos/billing/v1/services/engagement/v1/endpoint_end_trial.proto create mode 100644 proto/sentry_protos/billing/v1/services/events/v1/organization_trial_ended.proto diff --git a/proto/sentry_protos/billing/v1/services/engagement/v1/endpoint_end_trial.proto b/proto/sentry_protos/billing/v1/services/engagement/v1/endpoint_end_trial.proto new file mode 100644 index 00000000..6d1f9088 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/engagement/v1/endpoint_end_trial.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.engagement.v1; + +message EndTrialRequest { + uint64 organization_id = 1; +} + +message EndTrialResponse { + // True when an active subscription trial was ended. TrialService sets this; + // EngagementService may leave it unset. + bool ended = 1; +} diff --git a/proto/sentry_protos/billing/v1/services/events/v1/billing_platform_event.proto b/proto/sentry_protos/billing/v1/services/events/v1/billing_platform_event.proto index 929f239c..f737c436 100644 --- a/proto/sentry_protos/billing/v1/services/events/v1/billing_platform_event.proto +++ b/proto/sentry_protos/billing/v1/services/events/v1/billing_platform_event.proto @@ -6,6 +6,7 @@ import "google/protobuf/timestamp.proto"; import "sentry_protos/billing/v1/services/events/v1/contract_rolled_over.proto"; import "sentry_protos/billing/v1/services/events/v1/organization_over_usage.proto"; import "sentry_protos/billing/v1/services/events/v1/organization_payg_changed.proto"; +import "sentry_protos/billing/v1/services/events/v1/organization_trial_ended.proto"; import "sentry_protos/billing/v1/services/events/v1/organization_trial_started.proto"; import "sentry_protos/billing/v1/services/events/v1/organization_unit_grant_added.proto"; @@ -21,6 +22,7 @@ message EventPayload { sentry_protos.billing.v1.services.events.v1.OrganizationUnitGrantAdded organization_unit_grant_added = 3; sentry_protos.billing.v1.services.events.v1.OrganizationTrialStarted organization_trial_started = 4; sentry_protos.billing.v1.services.events.v1.ContractRolledOver contract_rolled_over = 5; + sentry_protos.billing.v1.services.events.v1.OrganizationTrialEnded organization_trial_ended = 6; } } diff --git a/proto/sentry_protos/billing/v1/services/events/v1/organization_trial_ended.proto b/proto/sentry_protos/billing/v1/services/events/v1/organization_trial_ended.proto new file mode 100644 index 00000000..0ef79326 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/events/v1/organization_trial_ended.proto @@ -0,0 +1,5 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.events.v1; + +message OrganizationTrialEnded {} From 577e797afe9440cf84920260c1942df395093f22 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Thu, 3 Sep 2026 18:36:00 +0000 Subject: [PATCH 2/2] chore: Regenerate Rust bindings --- Cargo.lock | 2 +- ...entry_protos.billing.v1.services.engagement.v1.rs | 12 ++++++++++++ .../sentry_protos.billing.v1.services.events.v1.rs | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0161bb2a..91bf4c97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.64.3" +version = "0.64.5" dependencies = [ "prost", "prost-types", diff --git a/rust/src/sentry_protos.billing.v1.services.engagement.v1.rs b/rust/src/sentry_protos.billing.v1.services.engagement.v1.rs index 4764d165..b15d2da7 100644 --- a/rust/src/sentry_protos.billing.v1.services.engagement.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.engagement.v1.rs @@ -402,6 +402,18 @@ pub struct CreateTrialResponse { #[prost(bool, tag = "1")] pub created: bool, } +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct EndTrialRequest { + #[prost(uint64, tag = "1")] + pub organization_id: u64, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct EndTrialResponse { + /// True when an active subscription trial was ended. TrialService sets this; + /// EngagementService may leave it unset. + #[prost(bool, tag = "1")] + pub ended: bool, +} #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UnitGrant { #[prost(string, tag = "1")] diff --git a/rust/src/sentry_protos.billing.v1.services.events.v1.rs b/rust/src/sentry_protos.billing.v1.services.events.v1.rs index 1a286915..a050635d 100644 --- a/rust/src/sentry_protos.billing.v1.services.events.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.events.v1.rs @@ -8,6 +8,8 @@ pub struct OrganizationOverUsage {} #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct OrganizationPaygChanged {} #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct OrganizationTrialEnded {} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct OrganizationTrialStarted {} #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct OrganizationUnitGrantAdded {} @@ -20,7 +22,7 @@ pub struct EventMeta { } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct EventPayload { - #[prost(oneof = "event_payload::Payload", tags = "1, 2, 3, 4, 5")] + #[prost(oneof = "event_payload::Payload", tags = "1, 2, 3, 4, 5, 6")] pub payload: ::core::option::Option, } /// Nested message and enum types in `EventPayload`. @@ -37,6 +39,8 @@ pub mod event_payload { OrganizationTrialStarted(super::OrganizationTrialStarted), #[prost(message, tag = "5")] ContractRolledOver(super::ContractRolledOver), + #[prost(message, tag = "6")] + OrganizationTrialEnded(super::OrganizationTrialEnded), } } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]