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

Side by Side Diff: appengine/findit/model/flake/master_flake_analysis.py

Issue 2435013005: [Findit] Updating flakiness dashboard to be able to triage results (Closed)
Patch Set: Fixing nit Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 import base64 5 import base64
6 6
7 from google.appengine.ext import ndb 7 from google.appengine.ext import ndb
8 8
9 from model import result_status
10 from model import triage_status
9 from model.base_analysis import BaseAnalysis 11 from model.base_analysis import BaseAnalysis
10 from model.base_build_model import BaseBuildModel 12 from model.base_build_model import BaseBuildModel
11 from model.flake.flake_swarming_task import FlakeSwarmingTaskData 13 from model.flake.flake_swarming_task import FlakeSwarmingTaskData
12 from model.versioned_model import VersionedModel 14 from model.versioned_model import VersionedModel
13 from model.base_triaged_model import TriagedModel 15 from model.base_triaged_model import TriagedModel
14 16
15 17
16 class DataPoint(ndb.Model): 18 class DataPoint(ndb.Model):
17 build_number = ndb.IntegerProperty(indexed=False) 19 build_number = ndb.IntegerProperty(indexed=False)
18 pass_rate = ndb.FloatProperty(indexed=False) 20 pass_rate = ndb.FloatProperty(indexed=False)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 61
60 # Arguments number differs from overridden method - pylint: disable=W0221 62 # Arguments number differs from overridden method - pylint: disable=W0221
61 @classmethod 63 @classmethod
62 def GetVersion(cls, master_name, builder_name, build_number, step_name, 64 def GetVersion(cls, master_name, builder_name, build_number, step_name,
63 test_name, version=None): # pragma: no cover. 65 test_name, version=None): # pragma: no cover.
64 return super(MasterFlakeAnalysis, cls).GetVersion( 66 return super(MasterFlakeAnalysis, cls).GetVersion(
65 key=MasterFlakeAnalysis._CreateAnalysisId( 67 key=MasterFlakeAnalysis._CreateAnalysisId(
66 master_name, builder_name, build_number, step_name, test_name), 68 master_name, builder_name, build_number, step_name, test_name),
67 version=version) 69 version=version)
68 70
71 def UpdateTriageResult(self, triage_result, suspect_info, user_name,
72 version_number=None):
73 super(MasterFlakeAnalysis, self).UpdateTriageResult(
74 triage_result, suspect_info, user_name, version_number=version_number)
75
76 if triage_result == triage_status.TRIAGED_CORRECT:
77 self.result_status = result_status.FOUND_CORRECT
78 else:
79 self.result_status = result_status.FOUND_INCORRECT
80
69 def Reset(self): 81 def Reset(self):
70 super(MasterFlakeAnalysis, self).Reset() 82 super(MasterFlakeAnalysis, self).Reset()
71 self.swarming_rerun_results = [] 83 self.swarming_rerun_results = []
72 self.error = None 84 self.error = None
73 self.correct_regression_range = None 85 self.correct_regression_range = None
74 self.correct_culprit = None 86 self.correct_culprit = None
75 self.algorithm_parameters = None 87 self.algorithm_parameters = None
76 self.suspected_flake_build_number = None 88 self.suspected_flake_build_number = None
77 self.data_points = [] 89 self.data_points = []
90 self.result_status = None
78 91
79 # A list of dicts containing information about each swarming rerun's results 92 # A list of dicts containing information about each swarming rerun's results
80 # that were involved in this analysis. The contents of this list will be used 93 # that were involved in this analysis. The contents of this list will be used
81 # for metrics, such as the number of cache hits this analysis benefited from, 94 # for metrics, such as the number of cache hits this analysis benefited from,
82 # the number of swarming tasks that were needed end-to-end to find the 95 # the number of swarming tasks that were needed end-to-end to find the
83 # regressed build number (if any), etc. See FlakeSwarmingTaskData for exact 96 # regressed build number (if any), etc. See FlakeSwarmingTaskData for exact
84 # fields. 97 # fields.
85 swarming_rerun_results = ndb.LocalStructuredProperty( 98 swarming_rerun_results = ndb.LocalStructuredProperty(
86 FlakeSwarmingTaskData, repeated=True, compressed=True) 99 FlakeSwarmingTaskData, repeated=True, compressed=True)
87 100
(...skipping 26 matching lines...) Expand all
114 data_points = ndb.LocalStructuredProperty( 127 data_points = ndb.LocalStructuredProperty(
115 DataPoint, repeated=True, compressed=True) 128 DataPoint, repeated=True, compressed=True)
116 129
117 # Whether the analysis was triggered by a manual request through check flake, 130 # Whether the analysis was triggered by a manual request through check flake,
118 # Findit's automatic analysis upon detection, or Findit API. 131 # Findit's automatic analysis upon detection, or Findit API.
119 triggering_source = ndb.IntegerProperty(default=None, indexed=True) 132 triggering_source = ndb.IntegerProperty(default=None, indexed=True)
120 133
121 # Who triggered the analysis. Used for differentiating between manual and 134 # Who triggered the analysis. Used for differentiating between manual and
122 # automatic runs, and determining the most active users to gather feedback. 135 # automatic runs, and determining the most active users to gather feedback.
123 triggering_user_email = ndb.StringProperty(default=None, indexed=False) 136 triggering_user_email = ndb.StringProperty(default=None, indexed=False)
137
138 # Overall conclusion of analysis result for the flake. Found untriaged, Found
139 # Correct, etc. used to filter what is displayed on the check flake dashboard.
140 result_status = ndb.IntegerProperty(indexed=True)
OLDNEW
« no previous file with comments | « appengine/findit/model/base_triaged_model.py ('k') | appengine/findit/model/flake/test/master_flake_analysis_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698