Skip to content

Commit f304aff

Browse files
authored
ref(grouping): Add grouping config name constants (#103183)
This adds a constant for the name of the current default grouping config to `server.py` and moves the corresponding constant for the new grouping config to live alongside it, then uses those constants when defining the configs. This lets us separate out the idea of "the `newstyle:2023-01-11` config" from the idea of "the default config," so that we can still refer easily to the former even once the latter has changed.
1 parent 70949f1 commit f304aff

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/sentry/conf/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2696,7 +2696,9 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]:
26962696
# Similarity-v1: uses hardcoded set of event properties for diffing
26972697
SENTRY_SIMILARITY_INDEX_REDIS_CLUSTER = "default"
26982698

2699-
DEFAULT_GROUPING_CONFIG = "newstyle:2023-01-11"
2699+
WINTER_2023_GROUPING_CONFIG = "newstyle:2023-01-11"
2700+
FALL_2025_GROUPING_CONFIG = "newstyle:2025-11-21"
2701+
DEFAULT_GROUPING_CONFIG = WINTER_2023_GROUPING_CONFIG
27002702
BETA_GROUPING_CONFIG = ""
27012703

27022704
# How long the migration phase for grouping lasts

src/sentry/grouping/strategies/configurations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from sentry.conf.server import FALL_2025_GROUPING_CONFIG, WINTER_2023_GROUPING_CONFIG
12
from sentry.grouping.strategies.base import (
23
StrategyConfiguration,
34
create_strategy_configuration_class,
@@ -52,7 +53,7 @@ def register_grouping_config(id: str, **kwargs) -> type[StrategyConfiguration]:
5253

5354
# This is the current default config
5455
register_grouping_config(
55-
id="newstyle:2023-01-11",
56+
id=WINTER_2023_GROUPING_CONFIG,
5657
# There's no `base` argument here because this config is based on `BASE_STRATEGY`. To base a
5758
# config on a previous config, include its `id` value as the value for `base` here.
5859
initial_context={
@@ -63,10 +64,9 @@ def register_grouping_config(id: str, **kwargs) -> type[StrategyConfiguration]:
6364
fingerprinting_bases=["javascript@2024-02-02"],
6465
)
6566

66-
FALL_2025_GROUPING_CONFIG = "newstyle:2025-11-21"
6767
register_grouping_config(
6868
id=FALL_2025_GROUPING_CONFIG,
69-
base="newstyle:2023-01-11",
69+
base=WINTER_2023_GROUPING_CONFIG,
7070
initial_context={
7171
"use_legacy_exception_subcomponent_order": False,
7272
},

tests/sentry/grouping/test_components.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import pytest
55

6-
from sentry.conf.server import DEFAULT_GROUPING_CONFIG
6+
from sentry.conf.server import FALL_2025_GROUPING_CONFIG, WINTER_2023_GROUPING_CONFIG
77
from sentry.grouping.component import (
88
BaseGroupingComponent,
99
ChainedExceptionGroupingComponent,
@@ -13,7 +13,6 @@
1313
StacktraceGroupingComponent,
1414
ThreadsGroupingComponent,
1515
)
16-
from sentry.grouping.strategies.configurations import FALL_2025_GROUPING_CONFIG
1716
from sentry.services.eventstore.models import Event
1817
from sentry.testutils.cases import TestCase
1918

@@ -387,7 +386,7 @@ def test_get_subcomponent(self) -> None:
387386
def test_configs_put_exception_subcomponents_in_expected_order(self) -> None:
388387
self.event.data["exception"]["values"][0]["stacktrace"] = {"frames": []}
389388

390-
self.project.update_option("sentry:grouping_config", DEFAULT_GROUPING_CONFIG)
389+
self.project.update_option("sentry:grouping_config", WINTER_2023_GROUPING_CONFIG)
391390
variants = self.event.get_grouping_variants()
392391
exception_component = variants["app"].root_component.values[0]
393392
assert isinstance(exception_component, ExceptionGroupingComponent)

0 commit comments

Comments
 (0)