Skip to content
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

chore(grouping): Stop calling _save_aggregate #77838

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions src/sentry/event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,20 +1323,11 @@ def get_culprit(data: Mapping[str, Any]) -> str:

@sentry_sdk.tracing.trace
def assign_event_to_group(event: Event, job: Job, metric_tags: MutableTags) -> GroupInfo | None:
if job["optimized_grouping"]:
group_info = _save_aggregate_new(
event=event,
job=job,
metric_tags=metric_tags,
)
else:
group_info = _save_aggregate(
event=event,
job=job,
release=job["release"],
received_timestamp=job["received_timestamp"],
metric_tags=metric_tags,
)
group_info = _save_aggregate_new(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we renamed it as part of this?

event=event,
job=job,
metric_tags=metric_tags,
)

if group_info:
event.group = group_info.group
Expand Down
15 changes: 3 additions & 12 deletions tests/sentry/event_manager/grouping/test_assign_to_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ def test_existing_group_no_new_hash(
)
@pytest.mark.parametrize(
"new_logic_enabled",
(True, False),
ids=(" new_logic_enabled: True ", " new_logic_enabled: False "),
(True,),
ids=(" new_logic_enabled: True ",),
)
@pytest.mark.parametrize(
"secondary_hash_exists",
Expand Down Expand Up @@ -506,13 +506,4 @@ def test_uses_regular_or_optimized_grouping_as_appropriate(
{"message": "Dogs are great!"}, project, DEFAULT_GROUPING_CONFIG
)

if killswitch_enabled:
assert mock_save_aggregate.call_count == 1
elif flag_on:
assert mock_save_aggregate_new.call_count == 1
elif in_transition:
assert mock_save_aggregate_new.call_count == 1
elif id_qualifies:
assert mock_save_aggregate_new.call_count == 1
else:
assert mock_save_aggregate.call_count == 1
assert mock_save_aggregate_new.call_count == 1
Loading