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

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

Issue 820113002: [Findit] Add a sub-pipeline to detect first-known failure. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Address comments Created 5 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
« no previous file with comments | « appengine/findit/model/base_build_model.py ('k') | appengine/findit/model/build_analysis.py » ('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 (c) 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 import calendar
6
7 from google.appengine.ext import ndb 5 from google.appengine.ext import ndb
8 6
9 from model.build_analysis_status import BuildAnalysisStatus 7 from model.base_build_model import BaseBuildModel
10 8
11 9
12 class Build(ndb.Model): 10 class Build(BaseBuildModel):
13 """Represent a build cycle of a builder in a waterfall.""" 11 """Represents a build cycle of a builder in a waterfall."""
14 12
15 @staticmethod 13 @staticmethod
16 def CreateKey(master_name, builder_name, build_number): # pragma: no cover 14 def CreateKey(master_name, builder_name, build_number): # pragma: no cover
17 return ndb.Key( 15 return ndb.Key('Build',
18 'Master', master_name, 'Builder', builder_name, 'Build', build_number) 16 BaseBuildModel.CreateBuildId(
17 master_name, builder_name, build_number))
19 18
20 @staticmethod 19 @staticmethod
21 def CreateBuild(master_name, builder_name, build_number): # pragma: no cover 20 def CreateBuild(master_name, builder_name, build_number): # pragma: no cover
22 """Create a Build instance, but not save it to datastore.""" 21 return Build(key=Build.CreateKey(master_name, builder_name, build_number))
23 return Build(key=Build.CreateKey(master_name, builder_name, build_number),
24 master_name=master_name,
25 builder_name=builder_name,
26 build_number=build_number)
27 22
28 @staticmethod 23 @staticmethod
29 def GetBuild(master_name, builder_name, build_number): # pragma: no cover 24 def GetBuild(master_name, builder_name, build_number): # pragma: no cover
30 return Build.CreateKey(master_name, builder_name, build_number).get() 25 return Build.CreateKey(master_name, builder_name, build_number).get()
31 26
32 def Reset(self): 27 data = ndb.JsonProperty(indexed=False, compressed=True)
33 """Reset to the state as if no analysis is run.""" 28 last_crawled_time = ndb.DateTimeProperty(indexed=False)
34 self.analysis_status = BuildAnalysisStatus.PENDING
35 self.analysis_start_time = None
36 self.analysis_updated_time = None
37 29
38 # Information of the build. 30 start_time = ndb.DateTimeProperty(indexed=False)
39 master_name = ndb.StringProperty(indexed=False) 31 completed = ndb.BooleanProperty(default=False, indexed=False)
40 builder_name = ndb.StringProperty(indexed=False) 32 result = ndb.IntegerProperty(indexed=False)
41 build_number = ndb.IntegerProperty(indexed=False)
42
43 # Information of analysis processing.
44 analysis_status = ndb.IntegerProperty(
45 default=BuildAnalysisStatus.PENDING, indexed=False)
46 analysis_start_time = ndb.DateTimeProperty(indexed=False)
47 analysis_updated_time = ndb.DateTimeProperty(indexed=False)
OLDNEW
« no previous file with comments | « appengine/findit/model/base_build_model.py ('k') | appengine/findit/model/build_analysis.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698