12
12
from sentry .grouping .ingest import (
13
13
_calculate_primary_hash ,
14
14
_calculate_secondary_hash ,
15
- find_existing_grouphash ,
15
+ find_existing_grouphash_legacy ,
16
16
find_existing_grouphash_new ,
17
17
)
18
18
from sentry .models .grouphash import GroupHash
32
32
33
33
@contextmanager
34
34
def patch_grouping_helpers (return_values : dict [str , Any ]):
35
- wrapped_find_existing_grouphash = capture_return_values (find_existing_grouphash , return_values )
35
+ wrapped_find_existing_grouphash_legacy = capture_return_values (
36
+ find_existing_grouphash_legacy , return_values
37
+ )
36
38
wrapped_find_existing_grouphash_new = capture_return_values (
37
39
find_existing_grouphash_new , return_values
38
40
)
@@ -43,9 +45,9 @@ def patch_grouping_helpers(return_values: dict[str, Any]):
43
45
44
46
with (
45
47
mock .patch (
46
- "sentry.event_manager.find_existing_grouphash " ,
47
- wraps = wrapped_find_existing_grouphash ,
48
- ) as find_existing_grouphash_spy ,
48
+ "sentry.event_manager.find_existing_grouphash_legacy " ,
49
+ wraps = wrapped_find_existing_grouphash_legacy ,
50
+ ) as find_existing_grouphash_legacy_spy ,
49
51
mock .patch (
50
52
"sentry.event_manager.find_existing_grouphash_new" ,
51
53
wraps = wrapped_find_existing_grouphash_new ,
@@ -66,7 +68,7 @@ def patch_grouping_helpers(return_values: dict[str, Any]):
66
68
) as create_group_spy ,
67
69
):
68
70
yield {
69
- "find_existing_grouphash " : find_existing_grouphash_spy ,
71
+ "find_existing_grouphash_legacy " : find_existing_grouphash_legacy_spy ,
70
72
"find_existing_grouphash_new" : find_existing_grouphash_new_spy ,
71
73
"_calculate_primary_hash" : calculate_primary_hash_spy ,
72
74
"_calculate_secondary_hash" : calculate_secondary_hash_spy ,
@@ -136,7 +138,7 @@ def get_results_from_saving_event(
136
138
new_logic_enabled : bool = False ,
137
139
):
138
140
find_existing_grouphash_fn = (
139
- "find_existing_grouphash_new" if new_logic_enabled else "find_existing_grouphash "
141
+ "find_existing_grouphash_new" if new_logic_enabled else "find_existing_grouphash_legacy "
140
142
)
141
143
142
144
# Whether or not these are assigned a value depends on the values of `in_transition` and
0 commit comments