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

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

Issue 2086113004: [Findit] Show build analysis references in UI for Findit Cross-platform auto-triage (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@build-matching
Patch Set: Rebased on tip of tree Created 4 years, 5 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_analysis_test.py ('k') | appengine/findit/templates/build_failure.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/wf_analysis.py
diff --git a/appengine/findit/model/wf_analysis.py b/appengine/findit/model/wf_analysis.py
index 5cf2bd30c107268c8d99987eb2bb1f01a204ee50..1442057e359e8a9d056dda7b95b0b3ae1ebc290c 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',
@@ -84,6 +85,19 @@ class WfAnalysis(BaseBuildModel):
return None
+ @property
+ def is_duplicate(self):
+ """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
@@ -155,3 +169,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)
« no previous file with comments | « appengine/findit/model/test/wf_analysis_test.py ('k') | appengine/findit/templates/build_failure.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698