Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto/sentry_protos/snuba/v1/request_common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ enum TraceItemType {
TRACE_ITEM_TYPE_PREPROD = 11;
TRACE_ITEM_TYPE_USER_SESSION = 12;
TRACE_ITEM_TYPE_PROCESSING_ERROR = 13;
TRACE_ITEM_TYPE_AI_CONVERSATION = 14;
}

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 auto-generated Rust code in rust/src/sentry_protos.snuba.v1.rs is out of sync with the updated protobuf definition, missing the new TRACE_ITEM_TYPE_AI_CONVERSATION enum variant.
Severity: CRITICAL

Suggested Fix

Run the code generation script to update the auto-generated Rust files. Based on the CI configuration, this can be done by running make build-rust locally. Commit the updated rust/src/sentry_protos.snuba.v1.rs file to ensure the Rust code is synchronized with the protobuf definition before merging.

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/snuba/v1/request_common.proto#L80

Potential issue: The protobuf definition in `request_common.proto` was updated to
include `TRACE_ITEM_TYPE_AI_CONVERSATION`, but the corresponding auto-generated Rust
code in `rust/src/sentry_protos.snuba.v1.rs` was not regenerated. As a result, the Rust
`TraceItemType` enum is missing the `AiConversation` variant. This will cause
deserialization failures when any Rust service attempts to process a protobuf message
containing `trace_item_type = 14`. The value may be incorrectly interpreted as
`Unspecified` or cause a runtime error, preventing the new feature from working in
Rust-based consumers.

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

message TraceItemFilterWithType {
Expand Down
3 changes: 3 additions & 0 deletions rust/src/sentry_protos.snuba.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ pub enum TraceItemType {
Preprod = 11,
UserSession = 12,
ProcessingError = 13,
AiConversation = 14,
}
impl TraceItemType {
/// String value of the enum field names used in the ProtoBuf definition.
Expand All @@ -1000,6 +1001,7 @@ impl TraceItemType {
Self::Preprod => "TRACE_ITEM_TYPE_PREPROD",
Self::UserSession => "TRACE_ITEM_TYPE_USER_SESSION",
Self::ProcessingError => "TRACE_ITEM_TYPE_PROCESSING_ERROR",
Self::AiConversation => "TRACE_ITEM_TYPE_AI_CONVERSATION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand All @@ -1019,6 +1021,7 @@ impl TraceItemType {
"TRACE_ITEM_TYPE_PREPROD" => Some(Self::Preprod),
"TRACE_ITEM_TYPE_USER_SESSION" => Some(Self::UserSession),
"TRACE_ITEM_TYPE_PROCESSING_ERROR" => Some(Self::ProcessingError),
"TRACE_ITEM_TYPE_AI_CONVERSATION" => Some(Self::AiConversation),
_ => None,
}
}
Expand Down
Loading