| Index: appengine/findit/crash/azalea.py
|
| diff --git a/appengine/findit/crash/azalea.py b/appengine/findit/crash/azalea.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..234c0348b5416e4727322d4dfec018eb6b19f41d
|
| --- /dev/null
|
| +++ b/appengine/findit/crash/azalea.py
|
| @@ -0,0 +1,31 @@
|
| +# Copyright 2016 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +from crash.culprit import Culprit
|
| +
|
| +# TODO(http://crbug.com/659346): write coverage tests.
|
| +class Azalea(object): # pragma: no cover
|
| + """The Main entry point into the Azalea library."""
|
| +
|
| + def __init__(self, cl_classifier, component_classifier, project_classifier):
|
| + self.cl_classifier = cl_classifier
|
| + self.component_classifier = component_classifier
|
| + self.project_classifier = project_classifier
|
| +
|
| + def FindCulprit(self, report):
|
| + """Given a CrashReport, return a Culprit."""
|
| + suspected_cls = self.cl_classifier(report)
|
| +
|
| + suspected_project = self.project_classifier.Classify(
|
| + suspected_cls, report.stacktrace.crash_stack)
|
| +
|
| + suspected_components = self.component_classifier.Classify(
|
| + suspected_cls, report.stacktrace.crash_stack)
|
| +
|
| + return Culprit(
|
| + project = suspected_project,
|
| + components = suspected_components,
|
| + cls = suspected_cls,
|
| + regression_range = report.regression_range,
|
| + algorithm = 'core_algorithm')
|
|
|