Chromium Code Reviews| Index: appengine/findit/model/wf_analysis.py |
| diff --git a/appengine/findit/model/wf_analysis.py b/appengine/findit/model/wf_analysis.py |
| index 2838adea93c03ac67cdba4ecd42d05e4cdaf226f..3cd1b2d0f5bbd01af0da929a4f992bfa9115e49a 100644 |
| --- a/appengine/findit/model/wf_analysis.py |
| +++ b/appengine/findit/model/wf_analysis.py |
| @@ -16,6 +16,7 @@ class WfAnalysis(BaseBuildModel): |
| 'Wf' is short for waterfall. |
| """ |
| + |
| @staticmethod |
| def _CreateKey(master_name, builder_name, build_number): # pragma: no cover |
| return ndb.Key('WfAnalysis', |
| @@ -82,6 +83,19 @@ class WfAnalysis(BaseBuildModel): |
| return None |
| + @property |
| + def is_duplicate(self): |
|
lijeffrey
2016/06/27 20:38:22
nit: I would name this just duplicate but this is
|
| + """Returns whether the analysis result is a duplicate or not. |
| + |
| + Returns: |
| + True: duplicate. |
| + False: not a duplicate. |
| + """ |
| + |
| + return self.result_status in ( |
| + result_status.FOUND_CORRECT_DUPLICATE, |
| + result_status.FOUND_INCORRECT_DUPLICATE) |
| + |
| def Reset(self): # pragma: no cover |
| """Resets to the state as if no analysis is run.""" |
| self.pipeline_status_path = None |
| @@ -153,3 +167,8 @@ class WfAnalysis(BaseBuildModel): |
| result_status = ndb.IntegerProperty(indexed=True) |
| # Record the history of triage. |
| triage_history = ndb.JsonProperty(indexed=False, compressed=True) |
| + # An optional reference to the analysis that might have caused this analysis |
| + # to be marked as a duplicate. |
| + triage_reference_analysis_master_name = ndb.StringProperty(indexed=False) |
| + triage_reference_analysis_builder_name = ndb.StringProperty(indexed=False) |
| + triage_reference_analysis_build_number = ndb.IntegerProperty(indexed=False) |