Skip to content

ref: Add contract v2 deleting deprecated fields - #415

Open
noahsmartin wants to merge 2 commits into
mainfrom
contractV2
Open

ref: Add contract v2 deleting deprecated fields#415
noahsmartin wants to merge 2 commits into
mainfrom
contractV2

Conversation

@noahsmartin

@noahsmartin noahsmartin commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Create a new v2 contract proto with deprecated fields removed

https://linear.app/getsentry/issue/REVENG-518/create-contract-proto-v2

@noahsmartin
noahsmartin requested a review from a team as a code owner August 30, 2026 09:19
@github-actions

github-actions Bot commented Aug 30, 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✅ passedSep 11, 2026, 12:22 AM

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 50a7bd0. Configure here.

@noahsmartin
noahsmartin marked this pull request as draft August 30, 2026 09:26
@noahsmartin
noahsmartin marked this pull request as ready for review September 11, 2026 00:21
Comment on lines +7 to +17
message ContractMetadata {
uint64 id = 1;
uint64 organization_id = 2;
// The set of BillingRules that the BillingRulesEngine has to execute for this contract.
string ruleset_version = 3;
// Catch-all for overrides and information not covered above.
sentry_protos.billing.v1.services.contract.v1.MetadataOptions custom_options = 4;
string package_uid = 5;

optional uint64 previous_id = 6;
}

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 new v2 ContractMetadata proto removes the billing_features field, which is an active, non-deprecated field in v1, causing a breaking change.
Severity: HIGH

Suggested Fix

Reinstate the billing_features field in the v2 ContractMetadata proto to maintain backward compatibility. If the removal is intentional, a clear migration path and updated documentation should be provided to explain how consumers can access this feature data through other means.

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/contract/v2/contract_metadata.proto#L7-L17

Potential issue: The v2 `ContractMetadata` proto omits the `billing_features` field.
This field is an active, non-deprecated field in the v1 proto that carries semantically
important data for time-bounded feature configurations. Its removal is a breaking change
that contradicts the stated goal of removing only deprecated fields. Any consumer
migrating from v1 to v2 will silently lose access to this feature flag information,
potentially causing incorrect feature gating in production.

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

@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

REVENG-518

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.

2 participants