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

Side by Side Diff: appengine/findit/crash/culprit.py

Issue 2432203003: [Predator] Run predator. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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
« no previous file with comments | « appengine/findit/crash/crash_pipeline.py ('k') | appengine/findit/crash/findit.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 from collections import namedtuple 5 from collections import namedtuple
6 6
7 7
8 class Culprit(namedtuple('Culprit', 8 class Culprit(namedtuple('Culprit',
9 ['project', 'components', 'cls', 'regression_range', 'algorithm'])): 9 ['project', 'components', 'cls', 'regression_range', 'algorithm'])):
10 """The result of successfully identifying the culprit of a crash report. 10 """The result of successfully identifying the culprit of a crash report.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 """ 91 """
92 # TODO(wrengr): will this auto-dropping of unnecessary fields cause 92 # TODO(wrengr): will this auto-dropping of unnecessary fields cause
93 # any issues for JSON serialization? 93 # any issues for JSON serialization?
94 result = {} 94 result = {}
95 result['found'] = ( 95 result['found'] = (
96 bool(self.project) or 96 bool(self.project) or
97 bool(self.components) or 97 bool(self.components) or
98 bool(self.cls) or 98 bool(self.cls) or
99 bool(self.regression_range)) 99 bool(self.regression_range))
100 if self.regression_range: 100 if self.regression_range:
101 assert isinstance(self.regression_range, list)
102 result['regression_range'] = self.regression_range 101 result['regression_range'] = self.regression_range
103 if self.project: 102 if self.project:
104 result['suspected_project'] = self.project 103 result['suspected_project'] = self.project
105 if self.components: 104 if self.components:
106 result['suspected_components'] = self.components 105 result['suspected_components'] = self.components
107 if self.cls: 106 if self.cls:
108 result['suspected_cls'] = [cl.ToDict() for cl in self.cls] 107 result['suspected_cls'] = [cl.ToDict() for cl in self.cls]
109 108
110 tags = { 109 tags = {
111 'found_suspects': bool(self.cls), 110 'found_suspects': bool(self.cls),
112 'has_regression_range': bool(self.regression_range), 111 'has_regression_range': bool(self.regression_range),
113 'found_project': bool(self.project), 112 'found_project': bool(self.project),
114 'found_components': bool(self.components), 113 'found_components': bool(self.components),
115 'solution': self.algorithm, 114 'solution': self.algorithm,
116 } 115 }
117 116
118 return result, tags 117 return result, tags
OLDNEW
« no previous file with comments | « appengine/findit/crash/crash_pipeline.py ('k') | appengine/findit/crash/findit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698