Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 | 6 |
| 7 from common import constants | 7 from common import constants |
| 8 from common.waterfall import failure_type | 8 from common.waterfall import failure_type |
| 9 from model.base_build_model import BaseBuildModel | 9 from model.base_build_model import BaseBuildModel |
| 10 from model import analysis_status | 10 from model import analysis_status |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 return True | 75 return True |
| 76 | 76 |
| 77 if self.result_status in ( | 77 if self.result_status in ( |
| 78 result_status.FOUND_INCORRECT, | 78 result_status.FOUND_INCORRECT, |
| 79 result_status.NOT_FOUND_INCORRECT, | 79 result_status.NOT_FOUND_INCORRECT, |
| 80 result_status.FOUND_INCORRECT_DUPLICATE): | 80 result_status.FOUND_INCORRECT_DUPLICATE): |
| 81 return False | 81 return False |
| 82 | 82 |
| 83 return None | 83 return None |
| 84 | 84 |
| 85 @property | |
| 86 def duplicate(self): | |
| 87 """Returns whether the analysis result is a duplicate or not. | |
| 88 | |
| 89 Returns: | |
| 90 True: duplicate | |
| 91 False: not a duplicate | |
| 92 """ | |
| 93 | |
| 94 if self.result_status in ( | |
| 95 result_status.FOUND_CORRECT_DUPLICATE, | |
| 96 result_status.FOUND_INCORRECT_DUPLICATE): | |
| 97 return True | |
| 98 | |
| 99 return False | |
|
chanli
2016/06/24 18:24:20
Nit: you can also use:
return True if self.result
josiahk
2016/06/27 19:33:25
Done.
| |
| 100 | |
| 85 def Reset(self): # pragma: no cover | 101 def Reset(self): # pragma: no cover |
| 86 """Resets to the state as if no analysis is run.""" | 102 """Resets to the state as if no analysis is run.""" |
| 87 self.pipeline_status_path = None | 103 self.pipeline_status_path = None |
| 88 self.status = analysis_status.PENDING | 104 self.status = analysis_status.PENDING |
| 89 self.request_time = None | 105 self.request_time = None |
| 90 self.start_time = None | 106 self.start_time = None |
| 91 self.end_time = None | 107 self.end_time = None |
| 92 | 108 |
| 93 @property | 109 @property |
| 94 def failure_type(self): | 110 def failure_type(self): |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 suspected_cls = ndb.JsonProperty(indexed=False, compressed=True) | 162 suspected_cls = ndb.JsonProperty(indexed=False, compressed=True) |
| 147 # Record the id of try job results of each failure. | 163 # Record the id of try job results of each failure. |
| 148 failure_result_map = ndb.JsonProperty(indexed=False, compressed=True) | 164 failure_result_map = ndb.JsonProperty(indexed=False, compressed=True) |
| 149 | 165 |
| 150 # The actual culprit CLs that are responsible for the failures. | 166 # The actual culprit CLs that are responsible for the failures. |
| 151 culprit_cls = ndb.JsonProperty(indexed=False, compressed=True) | 167 culprit_cls = ndb.JsonProperty(indexed=False, compressed=True) |
| 152 # Conclusion of analysis result for the build failure: 'Found' or 'Not Found'. | 168 # Conclusion of analysis result for the build failure: 'Found' or 'Not Found'. |
| 153 result_status = ndb.IntegerProperty(indexed=True) | 169 result_status = ndb.IntegerProperty(indexed=True) |
| 154 # Record the history of triage. | 170 # Record the history of triage. |
| 155 triage_history = ndb.JsonProperty(indexed=False, compressed=True) | 171 triage_history = ndb.JsonProperty(indexed=False, compressed=True) |
| 172 # An optional reference to the analysis that might have caused this analysis | |
| 173 # to be marked as a duplicate. | |
| 174 # triage_reference_analysis_key = ndb.StringProperty(indexed=False) | |
|
chanli
2016/06/24 18:24:20
If you don't need this anymore, please remove it.
josiahk
2016/06/27 19:33:25
Done.
| |
| 175 triage_reference_analysis_master_name = ndb.StringProperty(indexed=False) | |
| 176 triage_reference_analysis_builder_name = ndb.StringProperty(indexed=False) | |
| 177 triage_reference_analysis_build_number = ndb.IntegerProperty(indexed=False) | |
| OLD | NEW |