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

Side by Side Diff: appengine/findit/model/wf_try_job_data.py

Issue 2605803002: [Findit] Refactoring WfTryJobData into BaseTryJobData, WfTryJobData, and FlakeTryJobData (Closed)
Patch Set: Fixing code coverage Created 3 years, 11 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 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 from google.appengine.ext import ndb 5 from google.appengine.ext import ndb
6 6
7 from model.base_try_job_data import BaseTryJobData
8 from model.wf_try_job import WfTryJob
7 9
8 class WfTryJobData(ndb.Model): 10
9 """Represents a tryjob's data for a completed try job.""" 11 class WfTryJobData(BaseTryJobData):
10 # The original master on which the build was detected to have failed. 12 """Represents a tryjob's data for a completed compile or test try job."""
11 master_name = ndb.StringProperty(indexed=True) 13 # Number of commits in the revision range.
12 # The original buildername on which the build was detected to have failed. 14 regression_range_size = ndb.IntegerProperty(indexed=False)
13 builder_name = ndb.StringProperty(indexed=True) 15
14 # The original build number. 16 # Number of commits analyzed to determine a culprit if any.
15 build_number = ndb.IntegerProperty(indexed=True) 17 number_of_commits_analyzed = ndb.IntegerProperty(indexed=False)
18
19 # Culprit(s) determined to have caused the failure, if any.
20 culprits = ndb.JsonProperty(indexed=False)
21
22 # Whether or not the try job had compile targets passed (compile only).
23 has_compile_targets = ndb.BooleanProperty(indexed=True)
24
25 # Whether or not the try job had heuristic results to guide it.
26 has_heuristic_results = ndb.BooleanProperty(indexed=True)
27
16 # The type of try job, such as 'compile' or 'test'. 28 # The type of try job, such as 'compile' or 'test'.
17 try_job_type = ndb.StringProperty(indexed=True) 29 try_job_type = ndb.StringProperty(indexed=True)
18 # When the try job was created. 30
19 request_time = ndb.DateTimeProperty(indexed=True) 31 @ndb.ComputedProperty
20 # When the try job began executing. 32 def build_number(self):
21 start_time = ndb.DateTimeProperty(indexed=True) 33 return WfTryJob.GetBuildNumber(self.try_job_key)
22 # When the try job completed.
23 end_time = ndb.DateTimeProperty(indexed=True)
24 # Number of commits in the revision range.
25 regression_range_size = ndb.IntegerProperty(indexed=False)
26 # Number of commits analyzed to determine a culprit if any.
27 number_of_commits_analyzed = ndb.IntegerProperty(indexed=False)
28 # Culprit(s) determined to have caused the failure, if any.
29 culprits = ndb.JsonProperty(indexed=False)
30 # The url to the try job build page.
31 try_job_url = ndb.StringProperty(indexed=False)
32 # Error message and reason, if any.
33 error = ndb.JsonProperty(indexed=False)
34 # Error code if anything went wrong with the try job.
35 error_code = ndb.IntegerProperty(indexed=True)
36 # The last buildbucket build response received.
37 last_buildbucket_response = ndb.JsonProperty(indexed=False, compressed=True)
38 # Whether or not the try job had compile targets passed (compile only).
39 has_compile_targets = ndb.BooleanProperty(indexed=True)
40 # Whether or not the try job had heuristic results to guide it.
41 has_heuristic_results = ndb.BooleanProperty(indexed=True)
42 34
43 @staticmethod 35 @staticmethod
44 def _CreateKey(build_id): # pragma: no cover 36 def _CreateKey(build_id): # pragma: no cover
45 return ndb.Key('WfTryJobData', build_id) 37 return ndb.Key('WfTryJobData', build_id)
46 38
47 @staticmethod 39 @staticmethod
48 def Create(build_id): # pragma: no cover 40 def Create(build_id): # pragma: no cover
49 return WfTryJobData(key=WfTryJobData._CreateKey(build_id)) 41 return WfTryJobData(key=WfTryJobData._CreateKey(build_id))
50 42
51 @staticmethod 43 @staticmethod
52 def Get(build_id): # pragma: no cover 44 def Get(build_id): # pragma: no cover
53 return WfTryJobData._CreateKey(build_id).get() 45 return WfTryJobData._CreateKey(build_id).get()
54 46
OLDNEW
« no previous file with comments | « appengine/findit/model/wf_try_job.py ('k') | appengine/findit/waterfall/monitor_try_job_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698