Skip to content

Commit f1c9f8b

Browse files
committed
s/find_existing_grouphash/find_existing_grouphash_legacy
1 parent 5e1f8be commit f1c9f8b

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/sentry/event_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
add_group_id_to_grouphashes,
5151
check_for_category_mismatch,
5252
check_for_group_creation_load_shed,
53-
find_existing_grouphash,
53+
find_existing_grouphash_legacy,
5454
find_existing_grouphash_new,
5555
get_hash_values,
5656
record_new_group_metrics,
@@ -1438,7 +1438,7 @@ def _save_aggregate_legacy(
14381438
# this for select_for_update mostly provides sufficient synchronization
14391439
# when groups are created and also relieves contention by locking a more
14401440
# specific hash than `hierarchical_hashes[0]`.
1441-
existing_grouphash, root_hierarchical_hash = find_existing_grouphash(
1441+
existing_grouphash, root_hierarchical_hash = find_existing_grouphash_legacy(
14421442
project, flat_grouphashes, hashes.hierarchical_hashes
14431443
)
14441444

@@ -1500,7 +1500,7 @@ def _save_aggregate_legacy(
15001500

15011501
flat_grouphashes = [gh for gh in all_grouphashes if gh.hash in hashes.hashes]
15021502

1503-
existing_grouphash, root_hierarchical_hash = find_existing_grouphash(
1503+
existing_grouphash, root_hierarchical_hash = find_existing_grouphash_legacy(
15041504
project, flat_grouphashes, hashes.hierarchical_hashes
15051505
)
15061506

src/sentry/grouping/ingest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def _calculate_primary_hash(
229229
return _calculate_event_grouping(project, job["event"], grouping_config)
230230

231231

232-
def find_existing_grouphash(
232+
def find_existing_grouphash_legacy(
233233
project: Project,
234234
flat_grouphashes: Sequence[GroupHash],
235235
hierarchical_hashes: Sequence[str] | None,

tests/sentry/event_manager/grouping/test_assign_to_group.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from sentry.grouping.ingest import (
1313
_calculate_primary_hash,
1414
_calculate_secondary_hash,
15-
find_existing_grouphash,
15+
find_existing_grouphash_legacy,
1616
find_existing_grouphash_new,
1717
)
1818
from sentry.models.grouphash import GroupHash
@@ -32,7 +32,9 @@
3232

3333
@contextmanager
3434
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+
)
3638
wrapped_find_existing_grouphash_new = capture_return_values(
3739
find_existing_grouphash_new, return_values
3840
)
@@ -43,9 +45,9 @@ def patch_grouping_helpers(return_values: dict[str, Any]):
4345

4446
with (
4547
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,
4951
mock.patch(
5052
"sentry.event_manager.find_existing_grouphash_new",
5153
wraps=wrapped_find_existing_grouphash_new,
@@ -66,7 +68,7 @@ def patch_grouping_helpers(return_values: dict[str, Any]):
6668
) as create_group_spy,
6769
):
6870
yield {
69-
"find_existing_grouphash": find_existing_grouphash_spy,
71+
"find_existing_grouphash_legacy": find_existing_grouphash_legacy_spy,
7072
"find_existing_grouphash_new": find_existing_grouphash_new_spy,
7173
"_calculate_primary_hash": calculate_primary_hash_spy,
7274
"_calculate_secondary_hash": calculate_secondary_hash_spy,
@@ -136,7 +138,7 @@ def get_results_from_saving_event(
136138
new_logic_enabled: bool = False,
137139
):
138140
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"
140142
)
141143

142144
# Whether or not these are assigned a value depends on the values of `in_transition` and

0 commit comments

Comments
 (0)