From 8187a84e134b7162d7acd1ad5920184c556120c9 Mon Sep 17 00:00:00 2001 From: Brendan Hy Date: Fri, 20 Mar 2026 13:55:10 -0700 Subject: [PATCH 1/3] fix(billing): Credits can apply to multiple SKUs --- Cargo.lock | 2 +- proto/sentry_protos/billing/v1/credit.proto | 7 +++++-- rust/src/sentry_protos.billing.v1.rs | 9 +++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 116d9e7b..4d879270 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.8.6" +version = "0.8.7" dependencies = [ "prost", "prost-types", diff --git a/proto/sentry_protos/billing/v1/credit.proto b/proto/sentry_protos/billing/v1/credit.proto index fdd37a56..122a3fe1 100644 --- a/proto/sentry_protos/billing/v1/credit.proto +++ b/proto/sentry_protos/billing/v1/credit.proto @@ -25,8 +25,11 @@ enum CreditStatus { // allowance (in cents) or a number of units for specific SKUs. message Credit { CreditType type = 1; - // The SKU this credit applies to. - sentry_protos.billing.v1.SKU sku = 2; + // Deprecated: Use `skus` instead. This field only supports a single SKU. + sentry_protos.billing.v1.SKU sku = 2 [deprecated = true]; + // The SKUs this credit applies to. For shared budgets, the credit amount + // is shared across all listed SKUs. + repeated sentry_protos.billing.v1.SKU skus = 7; // Amount in cents (for CENTS credits) or unit count (for UNITS credits). int64 amount = 3; Date start_date = 4; diff --git a/rust/src/sentry_protos.billing.v1.rs b/rust/src/sentry_protos.billing.v1.rs index 3c7c3641..06a0e0f8 100644 --- a/rust/src/sentry_protos.billing.v1.rs +++ b/rust/src/sentry_protos.billing.v1.rs @@ -78,13 +78,18 @@ impl Sku { } /// A credit granted to an organization, representing either a monetary /// allowance (in cents) or a number of units for specific SKUs. -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Credit { #[prost(enumeration = "CreditType", tag = "1")] pub r#type: i32, - /// The SKU this credit applies to. + /// Deprecated: Use `skus` instead. This field only supports a single SKU. + #[deprecated] #[prost(enumeration = "Sku", tag = "2")] pub sku: i32, + /// The SKUs this credit applies to. For shared budgets, the credit amount + /// is shared across all listed SKUs. + #[prost(enumeration = "Sku", repeated, tag = "7")] + pub skus: ::prost::alloc::vec::Vec, /// Amount in cents (for CENTS credits) or unit count (for UNITS credits). #[prost(int64, tag = "3")] pub amount: i64, From 0fedce33dd1e1b878e01be871eb0441ee5c6566a Mon Sep 17 00:00:00 2001 From: Brendan Hy Date: Fri, 20 Mar 2026 13:56:39 -0700 Subject: [PATCH 2/3] reorder --- proto/sentry_protos/billing/v1/credit.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/sentry_protos/billing/v1/credit.proto b/proto/sentry_protos/billing/v1/credit.proto index 122a3fe1..e2be3bb0 100644 --- a/proto/sentry_protos/billing/v1/credit.proto +++ b/proto/sentry_protos/billing/v1/credit.proto @@ -27,12 +27,12 @@ message Credit { CreditType type = 1; // Deprecated: Use `skus` instead. This field only supports a single SKU. sentry_protos.billing.v1.SKU sku = 2 [deprecated = true]; - // The SKUs this credit applies to. For shared budgets, the credit amount - // is shared across all listed SKUs. - repeated sentry_protos.billing.v1.SKU skus = 7; // Amount in cents (for CENTS credits) or unit count (for UNITS credits). int64 amount = 3; Date start_date = 4; Date end_date = 5; CreditStatus status = 6; + // The SKUs this credit applies to. For shared budgets, the credit amount + // is shared across all listed SKUs. + repeated sentry_protos.billing.v1.SKU skus = 7; } From 3298d04ee621e7b04be2ba2aaa809101cb397cd6 Mon Sep 17 00:00:00 2001 From: "getsantry[bot]" <66042841+getsantry[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 20:57:40 +0000 Subject: [PATCH 3/3] chore: Regenerate Rust bindings --- rust/src/sentry_protos.billing.v1.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/src/sentry_protos.billing.v1.rs b/rust/src/sentry_protos.billing.v1.rs index 06a0e0f8..3cad0b39 100644 --- a/rust/src/sentry_protos.billing.v1.rs +++ b/rust/src/sentry_protos.billing.v1.rs @@ -86,10 +86,6 @@ pub struct Credit { #[deprecated] #[prost(enumeration = "Sku", tag = "2")] pub sku: i32, - /// The SKUs this credit applies to. For shared budgets, the credit amount - /// is shared across all listed SKUs. - #[prost(enumeration = "Sku", repeated, tag = "7")] - pub skus: ::prost::alloc::vec::Vec, /// Amount in cents (for CENTS credits) or unit count (for UNITS credits). #[prost(int64, tag = "3")] pub amount: i64, @@ -99,6 +95,10 @@ pub struct Credit { pub end_date: ::core::option::Option, #[prost(enumeration = "CreditStatus", tag = "6")] pub status: i32, + /// The SKUs this credit applies to. For shared budgets, the credit amount + /// is shared across all listed SKUs. + #[prost(enumeration = "Sku", repeated, tag = "7")] + pub skus: ::prost::alloc::vec::Vec, } /// Whether the credit represents a cents allowance or a unit quantity. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]