Chromium Code Reviews| Index: appengine/findit/model/crash/crash_config.py |
| diff --git a/appengine/findit/model/crash/crash_config.py b/appengine/findit/model/crash/crash_config.py |
| index 20e6c7a3558caa0a51d6cc4b5ecb29c9276b9ca7..4e66285a8b6c063a1a64022ec656bfe6c1122b74 100644 |
| --- a/appengine/findit/model/crash/crash_config.py |
| +++ b/appengine/findit/model/crash/crash_config.py |
| @@ -4,6 +4,8 @@ |
| """Findit for crash (ClusterFuzz & Fracas/Chromecrash) configuration.""" |
| +import re |
| + |
| from google.appengine.ext import ndb |
| from model.versioned_config import VersionedConfig |
| @@ -19,3 +21,83 @@ class CrashConfig(VersionedConfig): |
| # }, |
| # } |
| fracas = ndb.JsonProperty(indexed=False, default={}) |
| + |
| + ################## Settings shared by Fracas/Clusterfuzz. ################## |
| + # Project classifier settings: |
| + # { |
| + # "host_directories": [ |
| + # "src/chrome/browser/resources/", |
| + # "src/chrome/test/data/layout_tests/", |
| + # "src/media/", |
| + # "src/sdch/", |
| + # "src/testing/", |
| + # "src/third_party/WebKit/", |
| + # "src/third_party/", |
| + # "src/tools/", |
| + # "src/" |
| + # ], |
| + # # Where there is no dep_path found, use function and file_path makers to |
| + # # map a Result or StackFrame to a project name. |
| + # "function_marker_to_project_name": { |
| + # "org.chromium": "chromium", |
| + # "com.google.android.apps.chrome": "clank", |
| + # "android.": "android_os", |
| + # "com.android.": "android_os", |
| + # }, |
| + # "file_path_marker_to_project_name": { |
| + # ("https___googleplex-android.googlesource." |
| + # "com_a_platform_manifest.git/"): "android_os", |
| + # "googleplex-android/": "android_os", |
| + # }, |
| + # |
| + # # Number of frames on top to consider when deciding the crashed project. |
| + # "top_n": 4, |
| + # |
| + # # The chromium project should always have the highest rank priority (0). |
| + # # This dict assigns rank priorities to non chromium projects. |
| + # "non_chromium_project_rank_priority" = { |
| + # "clank": -1, |
| + # "android_os": -2, |
| + # "android_os_java": -2, |
| + # "src_internal": -3, |
| + # "others": -4, |
| + # } |
| + # } |
| + project_classifier = ndb.JsonProperty(indexed=False, default={}) |
| + |
| + # Component classifier settings: |
| + # { |
| + # # Number of frames on top to consider when deciding the crashed |
| + # #component. |
| + # "top_n": 4, |
| + # "path_function_component": [ |
| + # [r"src/third_party/WebKit/Source/core/layout", , "Blink>Layout"], |
| + # ... |
| + # ] |
| + # } |
| + component_classifier = ndb.JsonProperty(indexed=False, default={}, |
| + compressed=True) |
| + |
| + # cached component classifer with all re patterns compiled. |
| + cached_component_classifier = ndb.PickleProperty(indexed=False, default=None, |
|
stgao
2016/05/24 00:10:58
Do we plan to save this in NDB? If not, let's not
Sharu Jiang
2016/05/24 22:22:44
Done.
|
| + compressed=True) |
| + |
| + def ClearCache(self): |
| + self.cached_component_classifier = None |
| + |
| + @property |
| + def compiled_component_classifier(self): |
| + """Returns the component classifier with all re patterns compiled.""" |
| + if self.cached_component_classifier is None: |
| + compiled_path_function_component = [] |
| + for path, function, component in self.component_classifier[ |
| + 'path_function_component']: |
| + compiled_path_function_component.append( |
| + [re.compile(path), re.compile(function), component]) |
| + |
| + self.cached_component_classifier = { |
| + 'top_n': self.component_classifier['top_n'], |
| + 'path_function_component': compiled_path_function_component |
| + } |
| + |
| + return self.cached_component_classifier |