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

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

Issue 2320153003: [Findit] Datamodel change for triaging at CL level. (Closed)
Patch Set: . Created 4 years, 3 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/wf_suspected_cl.py
diff --git a/appengine/findit/model/wf_suspected_cl.py b/appengine/findit/model/wf_suspected_cl.py
index 4c4caac1f1d715c584f5a98b7dec0722bcb02340..219b024af5610592c751986c699de83c9ca6179b 100644
--- a/appengine/findit/model/wf_suspected_cl.py
+++ b/appengine/findit/model/wf_suspected_cl.py
@@ -4,52 +4,83 @@
from google.appengine.ext import ndb
+from model.base_suspected_cl import BaseSuspectedCL
-class WfSuspectedCL(ndb.Model):
+
+class WfSuspectedCL(BaseSuspectedCL):
"""Represents suspected cl that causes failures on Chromium waterfall builds.
'Wf' is short for waterfall.
"""
- # Repo or project name of the suspected CL, eg: chromium, etc.
- repo_name = ndb.StringProperty(indexed=True)
-
- # The Git hash revision of the suspected CL.
- revision = ndb.StringProperty(indexed=False)
-
- # The commit position of the suspected CL.
- # Might not be available for some repo.
- commit_position = ndb.IntegerProperty(indexed=False)
-
- # The list of builds in which the suspected CL caused some breakage.
+ # The dict of builds in which the suspected CL caused some breakage.
+ # The dict will look like:
+ # {
+ # 'm1/b1/123': [
+ # {
+ # 'failure_type': 'compile',
+ # 'failures': None,
+ # 'status': CORRECT,
+ # 'approach': BOTH,
+ # 'top_score': 5,
+ # 'Confidence': 97.9
+ # }
+ # ],
+ # 'm2/b2/234': [
+ # {
+ # 'failure_type': 'test',
+ # 'failures': {
+ # 's1': ['t1', 't2']
+ # },
+ # 'status': CORRECT,
+ # 'approach': BOTH,
+ # 'top_score': None,
+ # 'Confidence': 80.0
+ # },
+ # {
+ # 'failure_type': 'test',
+ # 'failures': {
+ # 's1': ['t3']
+ # },
+ # 'status': INCORRECT,
+ # 'approach': HEURISTIC,
+ # 'top_score': 2,
+ # 'Confidence': 50.5
+ # },
+ # {
+ # 'failure_type': 'test',
+ # 'failures': {
+ # 's2': []
+ # },
+ # 'status': INCORRECT,
+ # 'approach': HEURISTIC,
+ # 'top_score': 1,
+ # 'Confidence': 30.7
+ # }
+ # ]
+ # }
builds = ndb.JsonProperty(indexed=False)
stgao 2016/09/13 17:23:27 Do use compressed=True here. This will grow big.
chanli 2016/09/13 18:06:30 Done.
# Is the suspected CL the culprit or not.
- is_culprit = ndb.BooleanProperty(indexed=True, default=None)
+ # If not triaged, the status would be None.
+ # Other possible status are: suspected_cl_status.CORRECT,
+ # suspected_cl_status.INCORRECT, suspected_cl_status.PARTIALLY_CORRECT and
+ # suspected_cl_status.PARTIALLY_TRIAGED.
+ status = ndb.IntegerProperty(indexed=True, default=None)
- # From which approach do we get this suspected CL: HEURISTIC, TRY_JOB or BOTH.
+ # From which approach do we get this suspected CL:
+ # analysis_approach_type.HEURISTIC, analysis_approach_type.TRY_JOB or
+ # analysis_approach_type.BOTH.
approach = ndb.IntegerProperty(indexed=True)
- # Failure type: failure_type.COMPILE or failure_type.TEST.
+ # Failure type: failure_type.COMPILE, failure_type.TEST or failure_type.BOTH.
stgao 2016/09/13 17:23:27 Worth a comment to say a CL could cause compile an
chanli 2016/09/13 18:06:30 Done.
failure_type = ndb.IntegerProperty(indexed=True)
- @property
- def project_name(self):
- return self.repo_name
-
- @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 = []
+ instance.builds = {}
return instance
-
- @classmethod
- def Get(cls, repo_name, revision): # pragma: no cover
- return cls._CreateKey(repo_name, revision).get()
« appengine/findit/model/base_suspected_cl.py ('K') | « appengine/findit/model/wf_culprit.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698