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

Unified Diff: appengine/findit/model/flake/flake_try_job_data.py

Issue 2605153002: [Findit] Adding schedule_flake_try_job_pipeline.py to trigger flake try jobs (Closed)
Patch Set: 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/flake/flake_try_job_data.py
diff --git a/appengine/findit/model/flake/flake_try_job_data.py b/appengine/findit/model/flake/flake_try_job_data.py
new file mode 100644
index 0000000000000000000000000000000000000000..e9823f34e6b54c3459e582914ab575b324473d70
--- /dev/null
+++ b/appengine/findit/model/flake/flake_try_job_data.py
@@ -0,0 +1,46 @@
+# Copyright 2016 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 base64
+
+from google.appengine.ext import ndb
+
+from model.base_try_job_data import BaseTryJobData
+
+
+class FlakeTryJobData(BaseTryJobData):
+ """Represents a tryjob's data for a completed compile or test try job."""
+
+ @property
+ def master_name(self):
+ return self.try_job_key.pairs()[0][1].split('/')[0]
+
+ @property
+ def builder_name(self):
+ return self.try_job_key.pairs()[0][1].split('/')[1]
+
+ @property
+ def step_name(self):
+ return self.try_job_key.pairs()[0][1].split('/')[2]
+
+ @property
+ def test_name(self):
+ return base64.b64decode(self.try_job_key.pairs()[0][1].split('/')[3])
+
+ @property
+ def git_hash(self):
+ return self.try_job_key.pairs()[0][1].split('/')[4]
+
+ @staticmethod
+ def _CreateKey(build_id): # pragma: no cover
+ return ndb.Key('FlakeTryJobData', build_id)
+
+ @staticmethod
+ def Create(build_id): # pragma: no cover
+ return FlakeTryJobData(key=FlakeTryJobData._CreateKey(build_id))
+
+ @staticmethod
+ def Get(build_id): # pragma: no cover
+ return FlakeTryJobData._CreateKey(build_id).get()
+

Powered by Google App Engine
This is Rietveld 408576698