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

Side by Side 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from google.appengine.ext import ndb 5 from google.appengine.ext import ndb
6 6
7 from common import constants 7 from common import constants
8 from common.waterfall import failure_type 8 from common.waterfall import failure_type
9 from model.base_build_model import BaseBuildModel 9 from model.base_build_model import BaseBuildModel
10 from model import analysis_status 10 from model import analysis_status
11 from model import result_status 11 from model import result_status
12 12
13 13
14 class WfAnalysis(BaseBuildModel): 14 class WfAnalysis(BaseBuildModel):
15 """Represents an analysis of a build of a builder in a Chromium waterfall. 15 """Represents an analysis of a build of a builder in a Chromium waterfall.
16 16
17 'Wf' is short for waterfall. 17 'Wf' is short for waterfall.
18 """ 18 """
19
19 @staticmethod 20 @staticmethod
20 def _CreateKey(master_name, builder_name, build_number): # pragma: no cover 21 def _CreateKey(master_name, builder_name, build_number): # pragma: no cover
21 return ndb.Key('WfAnalysis', 22 return ndb.Key('WfAnalysis',
22 BaseBuildModel.CreateBuildId( 23 BaseBuildModel.CreateBuildId(
23 master_name, builder_name, build_number)) 24 master_name, builder_name, build_number))
24 25
25 @staticmethod 26 @staticmethod
26 def Create(master_name, builder_name, build_number): # pragma: no cover 27 def Create(master_name, builder_name, build_number): # pragma: no cover
27 analysis = WfAnalysis( 28 analysis = WfAnalysis(
28 key=WfAnalysis._CreateKey(master_name, builder_name, build_number)) 29 key=WfAnalysis._CreateKey(master_name, builder_name, build_number))
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return True 78 return True
78 79
79 if self.result_status in ( 80 if self.result_status in (
80 result_status.FOUND_INCORRECT, 81 result_status.FOUND_INCORRECT,
81 result_status.NOT_FOUND_INCORRECT, 82 result_status.NOT_FOUND_INCORRECT,
82 result_status.FOUND_INCORRECT_DUPLICATE): 83 result_status.FOUND_INCORRECT_DUPLICATE):
83 return False 84 return False
84 85
85 return None 86 return None
86 87
88 @property
89 def is_duplicate(self):
90 """Returns whether the analysis result is a duplicate or not.
91
92 Returns:
93 True: duplicate.
94 False: not a duplicate.
95 """
96
97 return self.result_status in (
98 result_status.FOUND_CORRECT_DUPLICATE,
99 result_status.FOUND_INCORRECT_DUPLICATE)
100
87 def Reset(self): # pragma: no cover 101 def Reset(self): # pragma: no cover
88 """Resets to the state as if no analysis is run.""" 102 """Resets to the state as if no analysis is run."""
89 self.pipeline_status_path = None 103 self.pipeline_status_path = None
90 self.status = analysis_status.PENDING 104 self.status = analysis_status.PENDING
91 self.request_time = None 105 self.request_time = None
92 self.start_time = None 106 self.start_time = None
93 self.end_time = None 107 self.end_time = None
94 108
95 @property 109 @property
96 def failure_type(self): 110 def failure_type(self):
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 suspected_cls = ndb.JsonProperty(indexed=False, compressed=True) 162 suspected_cls = ndb.JsonProperty(indexed=False, compressed=True)
149 # Record the id of try job results of each failure. 163 # Record the id of try job results of each failure.
150 failure_result_map = ndb.JsonProperty(indexed=False, compressed=True) 164 failure_result_map = ndb.JsonProperty(indexed=False, compressed=True)
151 165
152 # The actual culprit CLs that are responsible for the failures. 166 # The actual culprit CLs that are responsible for the failures.
153 culprit_cls = ndb.JsonProperty(indexed=False, compressed=True) 167 culprit_cls = ndb.JsonProperty(indexed=False, compressed=True)
154 # Conclusion of analysis result for the build failure: 'Found' or 'Not Found'. 168 # Conclusion of analysis result for the build failure: 'Found' or 'Not Found'.
155 result_status = ndb.IntegerProperty(indexed=True) 169 result_status = ndb.IntegerProperty(indexed=True)
156 # Record the history of triage. 170 # Record the history of triage.
157 triage_history = ndb.JsonProperty(indexed=False, compressed=True) 171 triage_history = ndb.JsonProperty(indexed=False, compressed=True)
172 # An optional reference to the analysis that might have caused this analysis
173 # to be marked as a duplicate.
174 triage_reference_analysis_master_name = ndb.StringProperty(indexed=False)
175 triage_reference_analysis_builder_name = ndb.StringProperty(indexed=False)
176 triage_reference_analysis_build_number = ndb.IntegerProperty(indexed=False)
OLDNEW
« 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