Index: appengine/findit/model/build.py |
diff --git a/appengine/findit/model/build.py b/appengine/findit/model/build.py |
index 3dcd47a2c4cd9fe422fb5ccbe06ec990232887f5..5b7b40592f7a2bfd75b3ab10b1825d6a92cfb3b7 100644 |
--- a/appengine/findit/model/build.py |
+++ b/appengine/findit/model/build.py |
@@ -2,15 +2,13 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-import calendar |
- |
from google.appengine.ext import ndb |
-from model.build_analysis_status import BuildAnalysisStatus |
+from model.base_model import BaseModel |
-class Build(ndb.Model): |
- """Represent a build cycle of a builder in a waterfall.""" |
+class Build(BaseModel): |
+ """Represents a build cycle of a builder in a waterfall.""" |
@staticmethod |
def CreateKey(master_name, builder_name, build_number): # pragma: no cover |
@@ -19,29 +17,15 @@ class Build(ndb.Model): |
@staticmethod |
def CreateBuild(master_name, builder_name, build_number): # pragma: no cover |
- """Create a Build instance, but not save it to datastore.""" |
- return Build(key=Build.CreateKey(master_name, builder_name, build_number), |
- master_name=master_name, |
- builder_name=builder_name, |
- build_number=build_number) |
+ return Build(key=Build.CreateKey(master_name, builder_name, build_number)) |
@staticmethod |
def GetBuild(master_name, builder_name, build_number): # pragma: no cover |
return Build.CreateKey(master_name, builder_name, build_number).get() |
- def Reset(self): |
- """Reset to the state as if no analysis is run.""" |
- self.analysis_status = BuildAnalysisStatus.PENDING |
- self.analysis_start_time = None |
- self.analysis_updated_time = None |
- |
- # Information of the build. |
- master_name = ndb.StringProperty(indexed=False) |
- builder_name = ndb.StringProperty(indexed=False) |
- build_number = ndb.IntegerProperty(indexed=False) |
- |
- # Information of analysis processing. |
- analysis_status = ndb.IntegerProperty( |
- default=BuildAnalysisStatus.PENDING, indexed=False) |
- analysis_start_time = ndb.DateTimeProperty(indexed=False) |
- analysis_updated_time = ndb.DateTimeProperty(indexed=False) |
+ data = ndb.JsonProperty(indexed=False, compressed=True) |
+ last_crawled_time = ndb.DateTimeProperty(indexed=False) |
+ |
+ start_time = ndb.DateTimeProperty(indexed=False) |
+ completed = ndb.BooleanProperty(default=False, indexed=False) |
+ result = ndb.IntegerProperty(indexed=False) |