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

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

Issue 1866883002: [Findit] A huge refactoring and some bug fixing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix nit. Created 4 years, 8 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
« no previous file with comments | « appengine/findit/model/wf_swarming_task.py ('k') | appengine/findit/queue.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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_build_model import BaseBuildModel 7 from model.base_build_model import BaseBuildModel
8 from model import wf_analysis_status 8 from model import analysis_status
9 9
10 10
11 class WfTryJob(BaseBuildModel): 11 class WfTryJob(BaseBuildModel):
12 """Represents a try job results for a failed build. 12 """Represents a try job results for a failed build.
13 13
14 'Wf' is short for waterfall. 14 'Wf' is short for waterfall.
15 """ 15 """
16 # A list of dict containing results and urls of each try job for compile. 16 # A list of dict containing results and urls of each try job for compile.
17 compile_results = ndb.JsonProperty(default=[], indexed=False, compressed=True) 17 compile_results = ndb.JsonProperty(default=[], indexed=False, compressed=True)
18 18
19 # A list of dict containing results and urls of each try job for test. 19 # A list of dict containing results and urls of each try job for test.
20 test_results = ndb.JsonProperty(default=[], indexed=False, compressed=True) 20 test_results = ndb.JsonProperty(default=[], indexed=False, compressed=True)
21 21
22 # The status of the try job. 22 # The status of the try job.
23 status = ndb.IntegerProperty( 23 status = ndb.IntegerProperty(
24 default=wf_analysis_status.PENDING, indexed=False) 24 default=analysis_status.PENDING, indexed=False)
25 25
26 # A list of try job IDs associated with each try job for collecting metadata. 26 # A list of try job IDs associated with each try job for collecting metadata.
27 try_job_ids = ndb.JsonProperty(default=[], indexed=False, compressed=True) 27 try_job_ids = ndb.JsonProperty(default=[], indexed=False, compressed=True)
28 28
29 @staticmethod 29 @staticmethod
30 def _CreateKey(master_name, builder_name, build_number): # pragma: no cover 30 def _CreateKey(master_name, builder_name, build_number): # pragma: no cover
31 return ndb.Key('WfTryJob', 31 return ndb.Key('WfTryJob',
32 BaseBuildModel.CreateBuildId( 32 BaseBuildModel.CreateBuildId(
33 master_name, builder_name, build_number)) 33 master_name, builder_name, build_number))
34 34
35 @staticmethod 35 @staticmethod
36 def Create(master_name, builder_name, build_number): # pragma: no cover 36 def Create(master_name, builder_name, build_number): # pragma: no cover
37 return WfTryJob( 37 return WfTryJob(
38 key=WfTryJob._CreateKey(master_name, builder_name, build_number)) 38 key=WfTryJob._CreateKey(master_name, builder_name, build_number))
39 39
40 @staticmethod 40 @staticmethod
41 def Get(master_name, builder_name, build_number): # pragma: no cover 41 def Get(master_name, builder_name, build_number): # pragma: no cover
42 return WfTryJob._CreateKey( 42 return WfTryJob._CreateKey(
43 master_name, builder_name, build_number).get() 43 master_name, builder_name, build_number).get()
44 44
45 @property 45 @property
46 def completed(self): 46 def completed(self):
47 return self.status in ( 47 return self.status in (
48 wf_analysis_status.ANALYZED, wf_analysis_status.ERROR) 48 analysis_status.COMPLETED, analysis_status.ERROR)
49 49
50 @property 50 @property
51 def failed(self): 51 def failed(self):
52 return self.status == wf_analysis_status.ERROR 52 return self.status == analysis_status.ERROR
OLDNEW
« no previous file with comments | « appengine/findit/model/wf_swarming_task.py ('k') | appengine/findit/queue.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698