File tree Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 54
54
find_existing_grouphash_new ,
55
55
get_hash_values ,
56
56
record_new_group_metrics ,
57
+ should_use_new_assignment_logic ,
57
58
update_grouping_config_if_needed ,
58
59
)
59
60
from sentry .ingest .inbound_filters import FilterStatKeys
@@ -1362,20 +1363,8 @@ def get_culprit(data: Mapping[str, Any]) -> str:
1362
1363
1363
1364
1364
1365
def assign_event_to_group (event : Event , job : Job , metric_tags : MutableTags ) -> GroupInfo | None :
1365
- project = event .project
1366
-
1367
- primary_grouping_config = project .get_option ("sentry:grouping_config" )
1368
- secondary_grouping_config = project .get_option ("sentry:secondary_grouping_config" )
1369
- has_mobile_config = "mobile:2021-02-12" in [primary_grouping_config , secondary_grouping_config ]
1370
-
1371
1366
# TODO Once this feature is GA-ed, all of the logic from `_save_aggregate_new` can just be pulled into this shim
1372
- if (
1373
- features .has (
1374
- "organizations:grouping-suppress-unnecessary-secondary-hash" ,
1375
- project .organization ,
1376
- )
1377
- and not has_mobile_config
1378
- ):
1367
+ if should_use_new_assignment_logic (event .project ):
1379
1368
group_info = _save_aggregate_new (
1380
1369
event = event ,
1381
1370
job = job ,
Original file line number Diff line number Diff line change 11
11
from django .conf import settings
12
12
from django .core .cache import cache
13
13
14
- from sentry import options
14
+ from sentry import features , options
15
15
from sentry .exceptions import HashDiscarded
16
16
from sentry .grouping .api import (
17
17
BackgroundGroupingConfigLoader ,
@@ -229,6 +229,20 @@ def _calculate_primary_hash(
229
229
return _calculate_event_grouping (project , job ["event" ], grouping_config )
230
230
231
231
232
+ def should_use_new_assignment_logic (project : Project ) -> bool :
233
+ primary_grouping_config = project .get_option ("sentry:grouping_config" )
234
+ secondary_grouping_config = project .get_option ("sentry:secondary_grouping_config" )
235
+ has_mobile_config = "mobile:2021-02-12" in [primary_grouping_config , secondary_grouping_config ]
236
+
237
+ return (
238
+ features .has (
239
+ "organizations:grouping-suppress-unnecessary-secondary-hash" ,
240
+ project .organization ,
241
+ )
242
+ and not has_mobile_config
243
+ )
244
+
245
+
232
246
def find_existing_grouphash_legacy (
233
247
project : Project ,
234
248
flat_grouphashes : Sequence [GroupHash ],
You can’t perform that action at this time.
0 commit comments