55)
66
77
8- # The classes of grouping algorithms
9- CLASSES = []
10-
118# The full mapping of all known configurations.
129CONFIGURATIONS = {}
1310
11+ # The implied base strategy *every* strategy inherits from if no
12+ # base is defined.
13+ BASE_STRATEGY = create_strategy_configuration (
14+ None ,
15+ strategies = [
16+ "expect-ct:v1" ,
17+ "expect-staple:v1" ,
18+ "hpkp:v1" ,
19+ "csp:v1" ,
20+ "threads:v1" ,
21+ "stacktrace:v1" ,
22+ "chained-exception:v1" ,
23+ "template:v1" ,
24+ "message:v1" ,
25+ ],
26+ delegates = ["frame:v1" , "stacktrace:v1" , "single-exception:v1" ],
27+ initial_context = {
28+ # This key in the context tells the system which variant should
29+ # be produced. TODO: phase this out.
30+ "variant" : None ,
31+ # This is a flag that can be used by any delegate to respond to
32+ # a detected recursion. This is currently used by the frame
33+ # strategy to disable itself. Recursion is detected by the outer
34+ # strategy.
35+ "is_recursion" : False ,
36+ # This turns on the automatic message trimming by the message
37+ # strategy.
38+ "trim_message" : False ,
39+ # newstyle: enables the legacy function logic. This is only used
40+ # by the newstyle:2019-04-05 strategy. Once this is no longer used
41+ # this can go away entirely.
42+ "legacy_function_logic" : False ,
43+ # newstyle: turns on some javascript fuzzing features.
44+ "javascript_fuzzing" : False ,
45+ # newstyle: platforms for which context line should be taken into
46+ # account when grouping.
47+ "contextline_platforms" : (),
48+ # newstyle: this detects anonymous classes in PHP code.
49+ "php_detect_anonymous_classes" : False ,
50+ # newstyle: turns on a bug that was present in some variants
51+ "with_context_line_file_origin_bug" : False ,
52+ # newstyle: turns on falling back to exception values when there
53+ # is no stacktrace.
54+ "with_exception_value_fallback" : False ,
55+ },
56+ )
57+
1458
1559def register_strategy_config (id , ** kwargs ):
1660 if kwargs .get ("base" ) is not None :
1761 kwargs ["base" ] = CONFIGURATIONS [kwargs ["base" ]]
62+ else :
63+ kwargs ["base" ] = BASE_STRATEGY
1864 rv = create_strategy_configuration (id , ** kwargs )
19- if rv .config_class not in CLASSES :
20- CLASSES .append (rv .config_class )
2165 CONFIGURATIONS [rv .id ] = rv
2266 return rv
2367
@@ -30,15 +74,9 @@ def register_strategy_config(id, **kwargs):
3074register_strategy_config (
3175 id = "legacy:2019-03-12" ,
3276 strategies = [
33- "expect-ct:v1" ,
34- "expect-staple:v1" ,
35- "hpkp:v1" ,
36- "csp:v1" ,
3777 "threads:legacy" ,
3878 "stacktrace:legacy" ,
3979 "chained-exception:legacy" ,
40- "template:v1" ,
41- "message:v1" ,
4280 ],
4381 delegates = ["frame:legacy" , "stacktrace:legacy" , "single-exception:legacy" ],
4482 changelog = """
@@ -58,19 +96,7 @@ def register_strategy_config(id, **kwargs):
5896
5997register_strategy_config (
6098 id = "newstyle:2019-05-08" ,
61- strategies = [
62- "expect-ct:v1" ,
63- "expect-staple:v1" ,
64- "hpkp:v1" ,
65- "csp:v1" ,
66- "threads:v1" ,
67- "stacktrace:v1" ,
68- "chained-exception:v1" ,
69- "template:v1" ,
70- "message:v1" ,
71- ],
7299 risk = RISK_LEVEL_HIGH ,
73- delegates = ["frame:v1" , "stacktrace:v1" , "single-exception:v1" ],
74100 changelog = """
75101 * Uses source code information all platforms with reliable sources
76102 for grouping (JavaScript, Python, PHP and Ruby) and function
@@ -84,10 +110,8 @@ def register_strategy_config(id, **kwargs):
84110 * C/C++ and other native stacktraces are more reliably grouped.
85111 """ ,
86112 initial_context = {
87- "legacy_function_logic" : False ,
88113 "javascript_fuzzing" : True ,
89114 "contextline_platforms" : ("javascript" , "node" , "python" , "php" , "ruby" ),
90- "php_detect_anonymous_classes" : False ,
91115 "with_context_line_file_origin_bug" : True ,
92116 "trim_message" : True ,
93117 "with_exception_value_fallback" : True ,
@@ -97,7 +121,6 @@ def register_strategy_config(id, **kwargs):
97121register_strategy_config (
98122 id = "newstyle:2019-10-29" ,
99123 base = "newstyle:2019-05-08" ,
100- delegates = ["frame:v1" ],
101124 risk = RISK_LEVEL_MEDIUM ,
102125 changelog = """
103126 * Better rules for when to take context lines into account for
@@ -118,39 +141,19 @@ def register_strategy_config(id, **kwargs):
118141
119142register_strategy_config (
120143 id = "newstyle:2019-04-05" ,
121- strategies = [
122- "expect-ct:v1" ,
123- "expect-staple:v1" ,
124- "hpkp:v1" ,
125- "csp:v1" ,
126- "threads:v1" ,
127- "stacktrace:v1" ,
128- "chained-exception:v1" ,
129- "template:v1" ,
130- "message:v1" ,
131- ],
132- delegates = ["frame:v1" , "stacktrace:v1" , "single-exception:v1" ],
133144 risk = RISK_LEVEL_HIGH ,
134145 changelog = """
135146 * Experimental grouping algorithm (should not be used)
136147 """ ,
137148 hidden = True ,
138149 initial_context = {
139150 "legacy_function_logic" : True ,
140- "javascript_fuzzing" : False ,
141- "contextline_platforms" : (),
142- "php_detect_anonymous_classes" : False ,
143- "with_context_line_file_origin_bug" : False ,
144- "trim_message" : False ,
145- "with_exception_value_fallback" : False ,
146151 },
147152)
148153
149154register_strategy_config (
150155 id = "newstyle:2019-04-17" ,
151156 base = "newstyle:2019-04-05" ,
152- strategies = ["message:v1" ],
153- delegates = ["frame:v1" , "single-exception:v1" ],
154157 risk = RISK_LEVEL_HIGH ,
155158 changelog = """
156159 * Experimental grouping algorithm (should not be used)
0 commit comments