Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1006)

Unified Diff: appengine/findit/model/build.py

Issue 820113002: [Findit] Add a sub-pipeline to detect first-known failure. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Address comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/model/base_build_model.py ('k') | appengine/findit/model/build_analysis.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/build.py
diff --git a/appengine/findit/model/build.py b/appengine/findit/model/build.py
index 3dcd47a2c4cd9fe422fb5ccbe06ec990232887f5..8b0398b5399f6f4572f6856ca29f7d93e3ec020a 100644
--- a/appengine/findit/model/build.py
+++ b/appengine/findit/model/build.py
@@ -1,47 +1,32 @@
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
+# Copyright 2014 The Chromium Authors. All rights reserved.
# 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_build_model import BaseBuildModel
-class Build(ndb.Model):
- """Represent a build cycle of a builder in a waterfall."""
+class Build(BaseBuildModel):
+ """Represents a build cycle of a builder in a waterfall."""
@staticmethod
def CreateKey(master_name, builder_name, build_number): # pragma: no cover
- return ndb.Key(
- 'Master', master_name, 'Builder', builder_name, 'Build', build_number)
+ return ndb.Key('Build',
+ BaseBuildModel.CreateBuildId(
+ master_name, builder_name, build_number))
@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)
« no previous file with comments | « appengine/findit/model/base_build_model.py ('k') | appengine/findit/model/build_analysis.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698