| 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..6df6187ba6f4c0bdde50fbe82106f1bc78669009 100644
|
| --- a/appengine/findit/model/wf_suspected_cl.py
|
| +++ b/appengine/findit/model/wf_suspected_cl.py
|
| @@ -4,42 +4,78 @@
|
|
|
| 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.
|
| - builds = ndb.JsonProperty(indexed=False)
|
| + # 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,
|
| + # 'approaches': [HEURISTIC, TRY_JOB],
|
| + # 'top_score': 5,
|
| + # 'Confidence': 97.9
|
| + # }
|
| + # ],
|
| + # 'm2/b2/234': [
|
| + # {
|
| + # 'failure_type': 'test',
|
| + # 'failures': {
|
| + # 's1': ['t1', 't2']
|
| + # },
|
| + # 'status': CORRECT,
|
| + # 'approachES': [HEURISTIC, TRY_JOB],
|
| + # 'top_score': None,
|
| + # 'Confidence': 80.0
|
| + # },
|
| + # {
|
| + # 'failure_type': 'test',
|
| + # 'failures': {
|
| + # 's1': ['t3']
|
| + # },
|
| + # 'status': INCORRECT,
|
| + # 'approaches': [HEURISTIC],
|
| + # 'top_score': 2,
|
| + # 'Confidence': 50.5
|
| + # },
|
| + # {
|
| + # 'failure_type': 'test',
|
| + # 'failures': {
|
| + # 's2': []
|
| + # },
|
| + # 'status': INCORRECT,
|
| + # 'approaches': [HEURISTIC],
|
| + # 'top_score': 1,
|
| + # 'Confidence': 30.7
|
| + # }
|
| + # ]
|
| + # }
|
| + builds = ndb.JsonProperty(indexed=False, compressed=True)
|
|
|
| # Is the suspected CL the culprit or not.
|
| - is_culprit = ndb.BooleanProperty(indexed=True, default=None)
|
| -
|
| - # From which approach do we get this suspected CL: HEURISTIC, TRY_JOB or BOTH.
|
| - approach = ndb.IntegerProperty(indexed=True)
|
| + # 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)
|
|
|
| - # Failure type: failure_type.COMPILE or failure_type.TEST.
|
| - failure_type = ndb.IntegerProperty(indexed=True)
|
| + # From which approach do we get this suspected CL:
|
| + # analysis_approach_type.HEURISTIC, analysis_approach_type.TRY_JOB or both.
|
| + approaches = ndb.IntegerProperty(indexed=True, repeated=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))
|
| + # Failure type: failure_type.COMPILE, failure_type.TEST,
|
| + # and if a CL caused a compile failure and another test failure,
|
| + # the failure_type would be both.
|
| + failure_type = ndb.IntegerProperty(indexed=True, repeated=True)
|
|
|
| @classmethod
|
| def Create(cls, repo_name, revision, commit_position): # pragma: no cover
|
| @@ -47,9 +83,5 @@ class WfSuspectedCL(ndb.Model):
|
| 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()
|
|
|