Skip to content

fix(eap): allow flexible vcc types#189

Open
xurui-c wants to merge 2 commits intomainfrom
rachel/vcc
Open

fix(eap): allow flexible vcc types#189
xurui-c wants to merge 2 commits intomainfrom
rachel/vcc

Conversation

@xurui-c
Copy link
Member

@xurui-c xurui-c commented Mar 19, 2026

EAP-462

@xurui-c xurui-c requested a review from a team as a code owner March 19, 2026 21:17
Copilot AI review requested due to automatic review settings March 19, 2026 21:17
@github-actions
Copy link

github-actions bot commented Mar 19, 2026

The latest Buf updates on your PR. Results from workflow ci / buf-checks (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedMar 19, 2026, 9:18 PM

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an explicit source-column type to VirtualColumnContext in the Snuba v1 trace item attribute proto to support more flexible virtual column mappings (EAP-462).

Changes:

  • Introduces from_column_type (AttributeKey.Type) on VirtualColumnContext.
  • Adds a brief comment describing the design alternative considered.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

map<string, string> value_map = 3;
string default_value = 4;
// Alternatively, I could just use AttributeKey and deprecate from_column_name, but it might be confusing for the caller
AttributeKey.Type from_column_type = 5;
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

In proto3, a non-optional enum field has no presence tracking; when unset it will be read as TYPE_UNSPECIFIED (0). If TYPE_UNSPECIFIED is not a valid/meaningful value here, consider making from_column_type optional and/or explicitly documenting the default behavior when it is omitted.

Suggested change
AttributeKey.Type from_column_type = 5;
optional AttributeKey.Type from_column_type = 5;

Copilot uses AI. Check for mistakes.
map<string, string> value_map = 3;
string default_value = 4;
// Alternatively, I could just use AttributeKey and deprecate from_column_name, but it might be confusing for the caller
AttributeKey.Type from_column_type = 5;
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

This repo checks in generated Rust bindings (e.g. rust/src/sentry_protos.snuba.v1.rs currently defines VirtualColumnContext without from_column_type). Please regenerate/update the checked-in generated code (at least rust/src/sentry_protos.snuba.v1.rs) so Rust consumers can access the new field and CI/codegen stays consistent.

Copilot uses AI. Check for mistakes.
string to_column_name = 2;
map<string, string> value_map = 3;
string default_value = 4;
// Alternatively, I could just use AttributeKey and deprecate from_column_name, but it might be confusing for the caller
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

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

The inline comment is written in first person and describes an implementation alternative rather than documenting the API contract. Please replace it with a caller-focused comment that explains when/why to set from_column_type and how it interacts with from_column_name (and remove the editorial note).

Suggested change
// Alternatively, I could just use AttributeKey and deprecate from_column_name, but it might be confusing for the caller
// Optional explicit type of the source column referenced by from_column_name.
// Set this when the type of from_column_name cannot be inferred or needs to be
// specified for correct interpretation of value_map entries. Together,
// from_column_name and from_column_type describe the source values that are
// mapped to the virtual column identified by to_column_name.

Copilot uses AI. Check for mistakes.
@MeredithAnya
Copy link
Member

@xurui-c maybe i don't have a great understanding here but why do we not want to update NORMALIZED_COLUMNS_EAP_ITEMS in https://github.com/getsentry/snuba/blob/8d3bb1c9fabe2b9e1137c3beb681b5d7abe221a1/snuba/protos/common.py#L31

@xurui-c
Copy link
Member Author

xurui-c commented Mar 19, 2026

what if vcc wants to support a column that isn't a normalized column? i wouldn't want to add it every time. But, let me know if vcc is intended to only work with normalized columns @MeredithAnya

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.

3 participants