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 model.base_build_model import BaseBuildModel | 7 from model.base_build_model import BaseBuildModel |
8 from model.build_analysis_status import BuildAnalysisStatus | 8 from model.build_analysis_status import BuildAnalysisStatus |
9 | 9 |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 @property | 32 @property |
33 def completed(self): | 33 def completed(self): |
34 return self.status in ( | 34 return self.status in ( |
35 BuildAnalysisStatus.ANALYZED, BuildAnalysisStatus.ERROR) | 35 BuildAnalysisStatus.ANALYZED, BuildAnalysisStatus.ERROR) |
36 | 36 |
37 @property | 37 @property |
38 def failed(self): | 38 def failed(self): |
39 return self.status == BuildAnalysisStatus.ERROR | 39 return self.status == BuildAnalysisStatus.ERROR |
40 | 40 |
41 def Reset(self): # pragma: no cover | 41 def Reset(self): # pragma: no cover |
42 """Reset to the state as if no analysis is run.""" | 42 """Resets to the state as if no analysis is run.""" |
43 self.pipeline_url = None | 43 self.pipeline_url = None |
44 self.status = BuildAnalysisStatus.PENDING | 44 self.status = BuildAnalysisStatus.PENDING |
45 self.start_time = None | 45 self.start_time = None |
46 | 46 |
47 # Information of the analyzed build. | 47 # Information of the analyzed build. |
48 build_start_time = ndb.DateTimeProperty(indexed=True) | 48 build_start_time = ndb.DateTimeProperty(indexed=True) |
49 | 49 |
50 # Information of analysis processing. | 50 # Information of analysis processing. |
51 pipeline_url = ndb.StringProperty(indexed=False) | 51 pipeline_url = ndb.StringProperty(indexed=False) |
52 status = ndb.IntegerProperty( | 52 status = ndb.IntegerProperty( |
53 default=BuildAnalysisStatus.PENDING, indexed=False) | 53 default=BuildAnalysisStatus.PENDING, indexed=False) |
54 start_time = ndb.DateTimeProperty(indexed=False) | 54 start_time = ndb.DateTimeProperty(indexed=False) |
55 updated_time = ndb.DateTimeProperty(indexed=False, auto_now=True) | 55 updated_time = ndb.DateTimeProperty(indexed=False, auto_now=True) |
| 56 |
| 57 # Analysis result. |
| 58 result = ndb.JsonProperty(indexed=False, compressed=True) |
OLD | NEW |