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

Unified Diff: appengine/findit/model/build_analysis.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/build.py ('k') | appengine/findit/model/test/base_build_model_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/build_analysis.py
diff --git a/appengine/findit/model/build_analysis.py b/appengine/findit/model/build_analysis.py
new file mode 100644
index 0000000000000000000000000000000000000000..80ab6455aba8d657c52ddd0b71c74ad96b0ea3ed
--- /dev/null
+++ b/appengine/findit/model/build_analysis.py
@@ -0,0 +1,47 @@
+# 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.
+
+from google.appengine.ext import ndb
+
+from model.base_build_model import BaseBuildModel
+from model.build_analysis_status import BuildAnalysisStatus
+
+
+class BuildAnalysis(BaseBuildModel):
+ """Represents an analysis of a build cycle of a builder in a waterfall."""
+
+ @staticmethod
+ def CreateKey(master_name, builder_name, build_number): # pragma: no cover
+ return ndb.Key('BuildAnalysis',
+ BaseBuildModel.CreateBuildId(
+ master_name, builder_name, build_number))
+
+ @staticmethod
+ def CreateBuildAnalysis(
+ master_name, builder_name, build_number): # pragma: no cover
+ return BuildAnalysis(
+ key=BuildAnalysis.CreateKey(master_name, builder_name, build_number))
+
+ @staticmethod
+ def GetBuildAnalysis(
+ master_name, builder_name, build_number): # pragma: no cover
+ return BuildAnalysis.CreateKey(
+ master_name, builder_name, build_number).get()
+
+ def Reset(self): # pragma: no cover
+ """Reset to the state as if no analysis is run."""
+ self.pipeline_url = None
+ self.status = BuildAnalysisStatus.PENDING
+ self.start_time = None
+ self.updated_time = None
+
+ # Information of the analyzed build.
+ build_start_time = ndb.DateTimeProperty(indexed=True)
+
+ # Information of analysis processing.
+ pipeline_url = ndb.StringProperty(indexed=False)
+ status = ndb.IntegerProperty(
+ default=BuildAnalysisStatus.PENDING, indexed=False)
+ start_time = ndb.DateTimeProperty(indexed=False)
+ updated_time = ndb.DateTimeProperty(indexed=False)
« no previous file with comments | « appengine/findit/model/build.py ('k') | appengine/findit/model/test/base_build_model_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698