Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: appengine/findit/model/crash/crash_config.py

Issue 1914113002: [Findit] Enable project classifier and component classifier (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Findit for crash (ClusterFuzz & Fracas/Chromecrash) configuration.""" 5 """Findit for crash (ClusterFuzz & Fracas/Chromecrash) configuration."""
6 6
7 import copy
8 import re
9
7 from google.appengine.ext import ndb 10 from google.appengine.ext import ndb
8 11
9 from model.versioned_config import VersionedConfig 12 from model.versioned_config import VersionedConfig
10 13
11 14
12 class CrashConfig(VersionedConfig): 15 class CrashConfig(VersionedConfig):
13 """Global configuration of settings for processing Chrome crashes.""" 16 """Global configuration of settings for processing Chrome crashes."""
14 # Fracas-specific parameters. 17 # Fracas-specific parameters.
15 # { 18 # {
16 # "analysis_result_pubsub_topic": "projects/project-name/topics/name", 19 # "analysis_result_pubsub_topic": "projects/project-name/topics/name",
17 # "supported_platform_list_by_channel": { 20 # "supported_platform_list_by_channel": {
18 # "canary": ["win", "mac"], 21 # "canary": ["win", "mac"],
19 # }, 22 # },
20 # } 23 # }
21 fracas = ndb.JsonProperty(indexed=False, default={}) 24 fracas = ndb.JsonProperty(indexed=False, default={})
25
26 ################## Settings shared by Fracas/Clusterfuzz. ##################
27 # Project classifier settings:
28 # {
29 # 'host_directories': [
30 # 'src/chrome/browser/resources/',
31 # 'src/chrome/test/data/layout_tests/',
32 # 'src/media/',
33 # 'src/sdch/',
34 # 'src/testing/',
35 # 'src/third_party/WebKit/',
36 # 'src/third_party/',
37 # 'src/tools/',
38 # 'src/'
39 # ],
40 # # Where there is no dep_path found, use function and file_path makers to
41 # # map a Result or StackFrame to a project name.
42 # "function_marker_to_project_name": {
43 # "org.chromium": 'chromium',
44 # "com.google.android.apps.chrome": "clank",
45 # "android.": "android_os",
46 # "com.android.": "android_os",
47 # },
48 # "file_path_marker_to_project_name": {
49 # ("https___googleplex-android.googlesource."
50 # "com_a_platform_manifest.git/"): "android_os",
51 # "googleplex-android/": "android_os",
52 # },
53 #
54 # # Number of frames on top to consider when deciding the crashed project.
55 # "top_n": 4,
56 #
57 # # The chromium project should always have the highest rank priority (0).
58 # # This dict assigns rank priorities to non chromium projects.
59 # "non_chromium_project_rank_priority" = {
60 # 'clank': -1,
61 # 'android_os': -2,
62 # 'android_os_java': -2,
63 # 'src_internal': -3,
64 # '': -4,
65 # }
66 # }
67 project_classifier = ndb.JsonProperty(indexed=False, default={})
68
69 # Component classifier settings:
70 # {
71 # # Number of frames on top to consider when deciding the crashed
72 # #component.
73 # "top_n": 4,
74 # "path_function_component": [
75 # (r'src/third_party/WebKit/Source/core/layout', , 'Blink>Layout'),
76 # ...
77 # ]
78 # }
79 component_classifier = ndb.JsonProperty(indexed=False, default={})
80
81 @property
82 def parsed_component_classifier(self):
83 setting = copy.copy(self.component_classifier)
84 setting['top_n'] = int(setting['top_n'])
85
86 path_function_component = []
87 for path, function, component in setting['path_function_component']:
88 path_function_component.append((
89 re.compile(path),
90 re.compile(function) if function else None,
91 component))
92 setting['path_function_component'] = path_function_component
93
94 return setting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698