| OLD | NEW |
| 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 import copy | 5 import copy |
| 6 import json | 6 import json |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 # FinditForFracas-specific, wrengr moved them to findit_for_chromecrash_test.py. | 21 # FinditForFracas-specific, wrengr moved them to findit_for_chromecrash_test.py. |
| 22 # However, now we're missing coverage for most of this file (due to the | 22 # However, now we're missing coverage for most of this file (due to the |
| 23 # buggy way coverage is computed). Need to add a bunch of new unittests | 23 # buggy way coverage is computed). Need to add a bunch of new unittests |
| 24 # to get coverage back up. | 24 # to get coverage back up. |
| 25 | 25 |
| 26 # TODO: this class depends on ndb stuff, and should therefore move to | 26 # TODO: this class depends on ndb stuff, and should therefore move to |
| 27 # cr-culprit-finder/service/predator as part of the big reorganization. | 27 # cr-culprit-finder/service/predator as part of the big reorganization. |
| 28 # This class should be renamed to avoid confustion between Findit and Predator. | 28 # This class should be renamed to avoid confustion between Findit and Predator. |
| 29 # Think of a good name (e.g.'PredatorApp') for this class. | 29 # Think of a good name (e.g.'PredatorApp') for this class. |
| 30 class Findit(object): | 30 class Findit(object): |
| 31 |
| 31 def __init__(self, get_repository): | 32 def __init__(self, get_repository): |
| 32 """ | 33 """ |
| 33 Args: | 34 Args: |
| 34 get_repository (callable): a function from DEP urls to ``Repository`` | 35 get_repository (callable): a function from DEP urls to ``Repository`` |
| 35 objects, so we can get changelogs and blame for each dep. Notably, | 36 objects, so we can get changelogs and blame for each dep. Notably, |
| 36 to keep the code here generic, we make no assumptions about | 37 to keep the code here generic, we make no assumptions about |
| 37 which subclass of ``Repository`` this function returns. Thus, | 38 which subclass of ``Repository`` this function returns. Thus, |
| 38 it is up to the caller to decide what class to return and handle | 39 it is up to the caller to decide what class to return and handle |
| 39 any other arguments that class may require (e.g., an http client | 40 any other arguments that class may require (e.g., an http client |
| 40 for ``GitilesRepository``). | 41 for ``GitilesRepository``). |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 stacktrace = self.ParseStacktrace(model) | 272 stacktrace = self.ParseStacktrace(model) |
| 272 if stacktrace is None: | 273 if stacktrace is None: |
| 273 return None | 274 return None |
| 274 | 275 |
| 275 return self._predator.FindCulprit(CrashReport( | 276 return self._predator.FindCulprit(CrashReport( |
| 276 crashed_version = model.crashed_version, | 277 crashed_version = model.crashed_version, |
| 277 signature = model.signature, | 278 signature = model.signature, |
| 278 platform = model.platform, | 279 platform = model.platform, |
| 279 stacktrace = stacktrace, | 280 stacktrace = stacktrace, |
| 280 regression_range = model.regression_range)) | 281 regression_range = model.regression_range)) |
| OLD | NEW |