3
3
from typing import Any
4
4
5
5
from sentry .eventstore .models import Event
6
- from sentry .grouping .component import GroupingComponent
6
+ from sentry .grouping .component import BaseGroupingComponent
7
7
from sentry .grouping .strategies .base import (
8
8
GroupingContext ,
9
9
ReturnedVariants ,
@@ -164,17 +164,17 @@ def single_exception_legacy(
164
164
interface : SingleException , event : Event , context : GroupingContext , ** meta : Any
165
165
) -> ReturnedVariants :
166
166
167
- type_component = GroupingComponent (
167
+ type_component = BaseGroupingComponent (
168
168
id = "type" ,
169
169
values = [interface .type ] if interface .type else [],
170
170
contributes = False ,
171
171
)
172
- value_component = GroupingComponent (
172
+ value_component = BaseGroupingComponent (
173
173
id = "value" ,
174
174
values = [interface .value ] if interface .value else [],
175
175
contributes = False ,
176
176
)
177
- stacktrace_component = GroupingComponent (id = "stacktrace" )
177
+ stacktrace_component = BaseGroupingComponent (id = "stacktrace" )
178
178
179
179
if interface .stacktrace is not None :
180
180
stacktrace_component = context .get_single_grouping_component (
@@ -195,7 +195,7 @@ def single_exception_legacy(
195
195
value_component .update (contributes = True )
196
196
197
197
return {
198
- context ["variant" ]: GroupingComponent (
198
+ context ["variant" ]: BaseGroupingComponent (
199
199
id = "exception" , values = [stacktrace_component , type_component , value_component ]
200
200
)
201
201
}
@@ -231,7 +231,7 @@ def chained_exception_legacy(
231
231
if stacktrace_component is None or not stacktrace_component .contributes :
232
232
value .update (contributes = False , hint = "exception has no stacktrace" )
233
233
234
- return {context ["variant" ]: GroupingComponent (id = "chained-exception" , values = values )}
234
+ return {context ["variant" ]: BaseGroupingComponent (id = "chained-exception" , values = values )}
235
235
236
236
237
237
@chained_exception_legacy .variant_processor
@@ -262,7 +262,7 @@ def frame_legacy(
262
262
# Safari throws [native code] frames in for calls like ``forEach``
263
263
# whereas Chrome ignores these. Let's remove it from the hashing algo
264
264
# so that they're more likely to group together
265
- filename_component = GroupingComponent (id = "filename" )
265
+ filename_component = BaseGroupingComponent (id = "filename" )
266
266
if interface .filename == "<anonymous>" :
267
267
filename_component .update (
268
268
contributes = False , values = [interface .filename ], hint = "anonymous filename discarded"
@@ -293,12 +293,12 @@ def frame_legacy(
293
293
# if we have a module we use that for grouping. This will always
294
294
# take precedence over the filename, even if the module is
295
295
# considered unhashable.
296
- module_component = GroupingComponent (id = "module" )
296
+ module_component = BaseGroupingComponent (id = "module" )
297
297
if interface .module :
298
298
if is_unhashable_module_legacy (interface , platform ):
299
299
module_component .update (
300
300
values = [
301
- GroupingComponent (
301
+ BaseGroupingComponent (
302
302
id = "salt" , values = ["<module>" ], hint = "normalized generated module name"
303
303
)
304
304
],
@@ -313,7 +313,7 @@ def frame_legacy(
313
313
)
314
314
315
315
# Context line when available is the primary contributor
316
- context_line_component = GroupingComponent (id = "context-line" )
316
+ context_line_component = BaseGroupingComponent (id = "context-line" )
317
317
if interface .context_line is not None :
318
318
if len (interface .context_line ) > 120 :
319
319
context_line_component .update (hint = "discarded because line too long" )
@@ -322,9 +322,9 @@ def frame_legacy(
322
322
else :
323
323
context_line_component .update (values = [interface .context_line ])
324
324
325
- symbol_component = GroupingComponent (id = "symbol" )
326
- function_component = GroupingComponent (id = "function" )
327
- lineno_component = GroupingComponent (id = "lineno" )
325
+ symbol_component = BaseGroupingComponent (id = "symbol" )
326
+ function_component = BaseGroupingComponent (id = "function" )
327
+ lineno_component = BaseGroupingComponent (id = "lineno" )
328
328
329
329
# The context line grouping information is the most reliable one.
330
330
# If we did not manage to find some information there, we want to
@@ -347,7 +347,7 @@ def frame_legacy(
347
347
if is_unhashable_function_legacy (func ):
348
348
function_component .update (
349
349
values = [
350
- GroupingComponent (
350
+ BaseGroupingComponent (
351
351
id = "salt" , values = ["<function>" ], hint = "normalized lambda function name"
352
352
)
353
353
]
@@ -380,7 +380,7 @@ def frame_legacy(
380
380
)
381
381
382
382
return {
383
- context ["variant" ]: GroupingComponent (
383
+ context ["variant" ]: BaseGroupingComponent (
384
384
id = "frame" ,
385
385
values = [
386
386
module_component ,
@@ -461,7 +461,7 @@ def threads_legacy(
461
461
thread_count = len (interface .values )
462
462
if thread_count != 1 :
463
463
return {
464
- context ["variant" ]: GroupingComponent (
464
+ context ["variant" ]: BaseGroupingComponent (
465
465
id = "threads" ,
466
466
contributes = False ,
467
467
hint = "ignored because contains %d threads" % thread_count ,
@@ -471,13 +471,13 @@ def threads_legacy(
471
471
stacktrace = interface .values [0 ].get ("stacktrace" )
472
472
if not stacktrace :
473
473
return {
474
- context ["variant" ]: GroupingComponent (
474
+ context ["variant" ]: BaseGroupingComponent (
475
475
id = "threads" , contributes = False , hint = "thread has no stacktrace"
476
476
)
477
477
}
478
478
479
479
return {
480
- context ["variant" ]: GroupingComponent (
480
+ context ["variant" ]: BaseGroupingComponent (
481
481
id = "threads" ,
482
482
values = [context .get_single_grouping_component (stacktrace , event = event , ** meta )],
483
483
)
0 commit comments