| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 result_status.FOUND_CORRECT_DUPLICATE, | 98 result_status.FOUND_CORRECT_DUPLICATE, |
| 99 result_status.FOUND_INCORRECT_DUPLICATE) | 99 result_status.FOUND_INCORRECT_DUPLICATE) |
| 100 | 100 |
| 101 def Reset(self): # pragma: no cover | 101 def Reset(self): # pragma: no cover |
| 102 """Resets to the state as if no analysis is run.""" | 102 """Resets to the state as if no analysis is run.""" |
| 103 self.pipeline_status_path = None | 103 self.pipeline_status_path = None |
| 104 self.status = analysis_status.PENDING | 104 self.status = analysis_status.PENDING |
| 105 self.request_time = None | 105 self.request_time = None |
| 106 self.start_time = None | 106 self.start_time = None |
| 107 self.end_time = None | 107 self.end_time = None |
| 108 self.failure_result_map = self.failure_result_map or {} |
| 108 | 109 |
| 109 @property | 110 @property |
| 110 def failure_type(self): | 111 def failure_type(self): |
| 111 if self.build_failure_type is not None: | 112 if self.build_failure_type is not None: |
| 112 return self.build_failure_type | 113 return self.build_failure_type |
| 113 | 114 |
| 114 # Legacy data don't have property ``build_failure_type``. | 115 # Legacy data don't have property ``build_failure_type``. |
| 115 if not self.result: | 116 if not self.result: |
| 116 return failure_type.UNKNOWN | 117 return failure_type.UNKNOWN |
| 117 | 118 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 culprit_cls = ndb.JsonProperty(indexed=False, compressed=True) | 168 culprit_cls = ndb.JsonProperty(indexed=False, compressed=True) |
| 168 # Conclusion of analysis result for the build failure: 'Found' or 'Not Found'. | 169 # Conclusion of analysis result for the build failure: 'Found' or 'Not Found'. |
| 169 result_status = ndb.IntegerProperty(indexed=True) | 170 result_status = ndb.IntegerProperty(indexed=True) |
| 170 # Record the history of triage. | 171 # Record the history of triage. |
| 171 triage_history = ndb.JsonProperty(indexed=False, compressed=True) | 172 triage_history = ndb.JsonProperty(indexed=False, compressed=True) |
| 172 # An optional reference to the analysis that might have caused this analysis | 173 # An optional reference to the analysis that might have caused this analysis |
| 173 # to be marked as a duplicate. | 174 # to be marked as a duplicate. |
| 174 triage_reference_analysis_master_name = ndb.StringProperty(indexed=False) | 175 triage_reference_analysis_master_name = ndb.StringProperty(indexed=False) |
| 175 triage_reference_analysis_builder_name = ndb.StringProperty(indexed=False) | 176 triage_reference_analysis_builder_name = ndb.StringProperty(indexed=False) |
| 176 triage_reference_analysis_build_number = ndb.IntegerProperty(indexed=False) | 177 triage_reference_analysis_build_number = ndb.IntegerProperty(indexed=False) |
| OLD | NEW |