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

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

Issue 2299883005: [Findit] Add findit_for_client to do analysis based on client_id (Closed)
Patch Set: Rebase. Created 4 years, 3 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 re 7 import re
8 8
9 from google.appengine.ext import ndb 9 from google.appengine.ext import ndb
10 10
11 from crash.type_enums import CrashClient
11 from model.versioned_config import VersionedConfig 12 from model.versioned_config import VersionedConfig
12 13
13 14
14 class CrashConfig(VersionedConfig): 15 class CrashConfig(VersionedConfig):
15 """Global configuration of settings for processing Chrome crashes.""" 16 """Global configuration of settings for processing Chrome crashes."""
16 17
17 def __init__(self, *args, **kargs): 18 def __init__(self, *args, **kargs):
18 super(CrashConfig, self).__init__(*args, **kargs) 19 super(CrashConfig, self).__init__(*args, **kargs)
19 self.cached_component_classifier = None 20 self.cached_component_classifier = None
20 21
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 [re.compile(path), 98 [re.compile(path),
98 re.compile(function) if function else None, 99 re.compile(function) if function else None,
99 component]) 100 component])
100 101
101 self.cached_component_classifier = { 102 self.cached_component_classifier = {
102 'top_n': self.component_classifier['top_n'], 103 'top_n': self.component_classifier['top_n'],
103 'path_function_component': compiled_path_function_component 104 'path_function_component': compiled_path_function_component
104 } 105 }
105 106
106 return self.cached_component_classifier 107 return self.cached_component_classifier
108
109 def GetClientConfig(self, client_id):
110 """Gets client specific config using client_id."""
111 if client_id == CrashClient.FRACAS:
112 return self.fracas
113 elif client_id == CrashClient.CRACAS: # pragma: no cover.
114 # TODO(katesonia): Add crash config of cracas.
115 return None
116 elif client_id == CrashClient.CLUSTERFUZZ: # pragma: no cover.
117 # TODO(katesonia): Add crash config of clusterfuzz.
118 return None
119
120 return None
OLDNEW
« no previous file with comments | « appengine/findit/handlers/crash/test/crash_handler_test.py ('k') | appengine/findit/model/crash/test/crash_config_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698