-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(grouping): Simplify handling of variant name and exception data #97458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9d128b1
20cca95
beb7610
5995af5
e69742a
e56f7bb
51c9950
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,15 +72,17 @@ def normalize_message_for_grouping(message: str, event: Event) -> str: | |
def message_v1( | ||
interface: Message, event: Event, context: GroupingContext, **kwargs: Any | ||
) -> ReturnedVariants: | ||
variant_name = context["variant_name"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know the code previously didnt, but should we not asserting for existence here as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The (To be more precise, the decorator calls |
||
|
||
# This is true for all but our test config | ||
if context["normalize_message"]: | ||
raw_message = interface.message or interface.formatted or "" | ||
normalized = normalize_message_for_grouping(raw_message, event) | ||
hint = "stripped event-specific values" if raw_message != normalized else None | ||
return {context["variant_name"]: MessageGroupingComponent(values=[normalized], hint=hint)} | ||
return {variant_name: MessageGroupingComponent(values=[normalized], hint=hint)} | ||
else: | ||
return { | ||
context["variant_name"]: MessageGroupingComponent( | ||
variant_name: MessageGroupingComponent( | ||
values=[interface.message or interface.formatted or ""], | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah the joy of removing a 4 year old TODO in code :)