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

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

Issue 2225723005: [Findit] Add WfSuspectedCL model to save triage results for each suspected CL. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: rebase Created 4 years, 4 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/test/wf_suspected_cl_test.py ('k') | appengine/findit/model/wf_suspected_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/wf_culprit.py
diff --git a/appengine/findit/model/wf_culprit.py b/appengine/findit/model/wf_culprit.py
index 00457aa686bbfa5932d3cb53ed3fcf62e8ea105a..6d8fcd9581dcbc53eb945d1a343a23d9a15c5a89 100644
--- a/appengine/findit/model/wf_culprit.py
+++ b/appengine/findit/model/wf_culprit.py
@@ -5,36 +5,21 @@
from google.appengine.ext import ndb
from model import analysis_status as status
+from model.wf_suspected_cl import WfSuspectedCL
-class WfCulprit(ndb.Model):
+class WfCulprit(WfSuspectedCL):
"""Represents a culprit that causes a group of failures on Chromium waterfall.
'Wf' is short for waterfall.
"""
- # Repo or project name of the culprit, eg: chromium, etc.
- repo_name = ndb.StringProperty(indexed=True)
-
- # The Git hash revision of the culprit.
- revision = ndb.StringProperty(indexed=False)
-
- # The commit position of the culprit. Might not be available for some repo.
- commit_position = ndb.IntegerProperty(indexed=False)
-
# When the code-review of this culprit was notified.
cr_notification_time = ndb.DateTimeProperty(indexed=True)
# The status of code-review notification: None, RUNNING, COMPLETED, ERROR.
cr_notification_status = ndb.IntegerProperty(indexed=True)
- # The list of builds in which the culprit caused some breakage.
- builds = ndb.JsonProperty(indexed=False)
-
- @property
- def project_name(self):
- return self.repo_name
-
@property
def cr_notification_processed(self):
return self.cr_notification_status in (status.COMPLETED, status.RUNNING)
@@ -42,20 +27,3 @@ class WfCulprit(ndb.Model):
@property
def cr_notified(self):
return self.cr_notification_status == status.COMPLETED
-
- @classmethod
- def _CreateKey(cls, repo_name, revision): # pragma: no cover
- return ndb.Key(cls.__name__, '%s/%s' % (repo_name, revision))
-
- @classmethod
- def Create(cls, repo_name, revision, commit_position): # pragma: no cover
- instance = cls(key=cls._CreateKey(repo_name, revision))
- instance.repo_name = repo_name
- instance.revision = revision
- instance.commit_position = commit_position
- instance.builds = []
- return instance
-
- @classmethod
- def Get(cls, repo_name, revision): # pragma: no cover
- return cls._CreateKey(repo_name, revision).get()
« no previous file with comments | « appengine/findit/model/test/wf_suspected_cl_test.py ('k') | appengine/findit/model/wf_suspected_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698