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

Unified Diff: dashboard/dashboard/models/try_job.py

Issue 1566013002: Add support for bisect bots to post results to dashboard. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase Created 4 years, 10 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 | « dashboard/dashboard/email_template.py ('k') | dashboard/dashboard/post_bisect_results.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/models/try_job.py
diff --git a/dashboard/dashboard/models/try_job.py b/dashboard/dashboard/models/try_job.py
index eb832c529cd83b7cf0de4e4db156c0dcd04c9017..4914f14c57b086eb19badbb6ea38cdf1d94104ad 100644
--- a/dashboard/dashboard/models/try_job.py
+++ b/dashboard/dashboard/models/try_job.py
@@ -36,7 +36,7 @@ class TryJob(internal_only_model.InternalOnlyModel):
# Bisect run status (e.g., started, failed).
status = ndb.StringProperty(
default=None,
- choices=['started', 'failed'],
+ choices=['started', 'failed', 'staled', 'completed'],
indexed=True)
# Number of times this job has been tried.
@@ -52,6 +52,9 @@ class TryJob(internal_only_model.InternalOnlyModel):
# job_name attribute is used by try jobs of bisect FYI.
job_name = ndb.StringProperty(default=None)
+ # Results data comming from bisect bots.
+ results_data = ndb.JsonProperty(indexed=False)
+
def SetStarted(self):
self.status = 'started'
self.run_count += 1
@@ -67,8 +70,17 @@ class TryJob(internal_only_model.InternalOnlyModel):
bug_data.SetBisectStatus(self.bug_id, 'failed')
bisect_stats.UpdateBisectStats(self.bot, 'failed')
+ def SetStaled(self):
+ self.status = 'staled'
+ self.put()
+ # TODO(chrisphan): Add 'staled' state to bug_data and bisect_stats.
+ if self.bug_id:
+ bug_data.SetBisectStatus(self.bug_id, 'failed')
+ bisect_stats.UpdateBisectStats(self.bot, 'failed')
+
def SetCompleted(self):
- self.key.delete()
+ self.status = 'completed'
+ self.put()
if self.bug_id:
bug_data.SetBisectStatus(self.bug_id, 'completed')
bisect_stats.UpdateBisectStats(self.bot, 'completed')
« no previous file with comments | « dashboard/dashboard/email_template.py ('k') | dashboard/dashboard/post_bisect_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698