Skip to content

Commit

Permalink
drop(grouping): Drop hierarchical_grouping feature
Browse files Browse the repository at this point in the history
This partially reverts #23861

A lot more code needs to be removed but this is the minimal removal which passes all tests.
  • Loading branch information
armenzg committed Sep 5, 2024
1 parent 4471021 commit 139676b
Show file tree
Hide file tree
Showing 129 changed files with 4,113 additions and 7,354 deletions.
5 changes: 0 additions & 5 deletions src/sentry/grouping/strategies/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
# newstyle: turns on falling back to exception values when there
# is no stacktrace.
"with_exception_value_fallback": False,
# Whether the strategy should produce special variants that are
# considered for hierarchical grouping (see HIERARCHICAL_VARIANTS
# constant)
"hierarchical_grouping": False,
# Stacktrace is produced in the context of this exception
"exception_data": None,
# Whether to discard filenames of native events for grouping if
Expand Down Expand Up @@ -173,7 +169,6 @@ def register_strategy_config(id: str, **kwargs) -> type[StrategyConfiguration]:
no longer result in different issues.
""",
initial_context={
"hierarchical_grouping": True,
"discard_native_filename": True,
"use_package_fallback": True,
"native_fuzzing": True,
Expand Down
37 changes: 10 additions & 27 deletions src/sentry/grouping/strategies/newstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
call_with_variants,
strategy,
)
from sentry.grouping.strategies.hierarchical import get_stacktrace_hierarchy
from sentry.grouping.strategies.message import normalize_message_for_grouping
from sentry.grouping.strategies.utils import has_url_origin, remove_non_stacktrace_variants
from sentry.grouping.utils import hash_from_values
Expand Down Expand Up @@ -465,20 +464,14 @@ def stacktrace(
) -> ReturnedVariants:
assert context["variant"] is None

if context["hierarchical_grouping"]:
with context:
context["variant"] = "system"
return _single_stacktrace_variant(interface, event=event, context=context, meta=meta)

else:
return call_with_variants(
_single_stacktrace_variant,
["!system", "app"],
interface,
event=event,
context=context,
meta=meta,
)
return call_with_variants(
_single_stacktrace_variant,
["!system", "app"],
interface,
event=event,
context=context,
meta=meta,
)


def _single_stacktrace_variant(
Expand All @@ -496,7 +489,7 @@ def _single_stacktrace_variant(
context["is_recursion"] = is_recursion_v1(frame, prev_frame)
frame_component = context.get_single_grouping_component(frame, event=event, **meta)

if not context["hierarchical_grouping"] and variant == "app" and not frame.in_app:
if variant == "app" and not frame.in_app:
frame_component.update(contributes=False, hint="non app frame")
values.append(frame_component)
frames_for_filtering.append(frame.get_raw_data())
Expand Down Expand Up @@ -526,17 +519,7 @@ def _single_stacktrace_variant(

inverted_hierarchy = bool(inverted_hierarchy)

if not context["hierarchical_grouping"]:
return {variant: main_variant}

all_variants = get_stacktrace_hierarchy(
main_variant, values, frames_for_filtering, inverted_hierarchy
)

# done for backwards compat to find old groups
all_variants["system"] = main_variant

return all_variants
return {variant: main_variant}


@stacktrace.variant_processor
Expand Down
Loading

0 comments on commit 139676b

Please sign in to comment.