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

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

Issue 2586483003: [Findit] Adding build model for flake try jobs (Closed)
Patch Set: Adding missing files Created 4 years 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
Index: appengine/findit/model/base_try_job.py
diff --git a/appengine/findit/model/base_try_job.py b/appengine/findit/model/base_try_job.py
new file mode 100644
index 0000000000000000000000000000000000000000..66f112465fed04068577a589c391e12e691852de
--- /dev/null
+++ b/appengine/findit/model/base_try_job.py
@@ -0,0 +1,36 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
stgao 2016/12/16 23:41:05 2016
lijeffrey 2016/12/17 02:45:43 Done.
+# 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 import analysis_status
+
+
+class BaseTryJob(BaseBuildModel):
+ """Represents a base try job result."""
+
+ # The status of the try job.
+ status = ndb.IntegerProperty(
+ default=analysis_status.PENDING, indexed=False)
+
+ # A list of try job IDs associated with each try job for collecting metadata.
+ try_job_ids = ndb.JsonProperty(indexed=False, compressed=True)
+
+ @staticmethod
+ def Create(*_): # pragma: no cover
+ raise NotImplementedError('Create should be implemented in the child class')
+
+ @staticmethod
+ def Get(*_): # pragma: no cover
+ raise NotImplementedError('Get should be implemented in the child class')
stgao 2016/12/16 23:41:05 Why these two methods are needed in the base class
lijeffrey 2016/12/17 02:45:43 Removed
+
+ @property
+ def completed(self):
+ return self.status in (
+ analysis_status.COMPLETED, analysis_status.ERROR)
+
+ @property
+ def failed(self):
+ return self.status == analysis_status.ERROR
« no previous file with comments | « no previous file | appengine/findit/model/flake/flake_try_job.py » ('j') | appengine/findit/model/flake/flake_try_job.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698