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

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

Issue 2124973003: These are the database objects used while finding the regression range. 1/3 (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 5 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
Index: appengine/findit/model/base_flake_model.py
diff --git a/appengine/findit/model/base_build_model.py b/appengine/findit/model/base_flake_model.py
similarity index 69%
copy from appengine/findit/model/base_build_model.py
copy to appengine/findit/model/base_flake_model.py
index 73a9f84dd1741ac77df461882f852899f943be6f..afba53ff2d7fe46dbb95b941821b73b0435b5105 100644
--- a/appengine/findit/model/base_build_model.py
+++ b/appengine/findit/model/base_flake_model.py
@@ -5,7 +5,7 @@
from google.appengine.ext import ndb
-class BaseBuildModel(ndb.Model): # pragma: no cover
+class BaseFlakeModel(ndb.Model): # pragma: no cover
"""A base class to provide computed properties from the key.
The computed properties are master name, builder name, and build number.
chanli 2016/07/07 23:38:27 Please change the docstring here: step_name is als
@@ -16,8 +16,8 @@ class BaseBuildModel(ndb.Model): # pragma: no cover
"""
@staticmethod
- def CreateBuildId(master_name, builder_name, build_number):
- return '%s/%s/%s' % (master_name, builder_name, build_number)
+ def CreateFlakeId(master_name, builder_name, step_name, build_number):
chanli 2016/07/07 23:38:28 I would have the argument list as : master_name, b
caiw 2016/07/14 00:59:39 Done.
+ return '%s/%s/%s/%s' % (master_name, builder_name, step_name, build_number)
chanli 2016/07/07 23:38:28 Is there a reason why you want to organize the key
caiw 2016/07/14 00:59:39 Done.
@ndb.ComputedProperty
def master_name(self):
stgao 2016/07/08 22:51:26 Per discussion, we will use the BaseBuildModel dir
caiw 2016/07/14 00:59:39 Done.
@@ -28,5 +28,10 @@ class BaseBuildModel(ndb.Model): # pragma: no cover
return self.key.pairs()[0][1].split('/')[1]
@ndb.ComputedProperty
+ def step_name(self):
+ return self.key.pairs()[0][1].split('/')[2]
+
+ @ndb.ComputedProperty
def build_number(self):
- return int(self.key.pairs()[0][1].split('/')[2])
+ return int(self.key.pairs()[0][1].split('/')[3]
+)
« no previous file with comments | « no previous file | appengine/findit/model/base_swarming_task.py » ('j') | appengine/findit/model/base_swarming_task.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698