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

Side by Side Diff: appengine/findit/model/build_analysis.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/build.py ('k') | appengine/findit/model/test/base_build_model_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 from google.appengine.ext import ndb
6
7 from model.base_build_model import BaseBuildModel
8 from model.build_analysis_status import BuildAnalysisStatus
9
10
11 class BuildAnalysis(BaseBuildModel):
12 """Represents an analysis of a build cycle of a builder in a waterfall."""
13
14 @staticmethod
15 def CreateKey(master_name, builder_name, build_number): # pragma: no cover
16 return ndb.Key('BuildAnalysis',
17 BaseBuildModel.CreateBuildId(
18 master_name, builder_name, build_number))
19
20 @staticmethod
21 def CreateBuildAnalysis(
22 master_name, builder_name, build_number): # pragma: no cover
23 return BuildAnalysis(
24 key=BuildAnalysis.CreateKey(master_name, builder_name, build_number))
25
26 @staticmethod
27 def GetBuildAnalysis(
28 master_name, builder_name, build_number): # pragma: no cover
29 return BuildAnalysis.CreateKey(
30 master_name, builder_name, build_number).get()
31
32 def Reset(self): # pragma: no cover
33 """Reset to the state as if no analysis is run."""
34 self.pipeline_url = None
35 self.status = BuildAnalysisStatus.PENDING
36 self.start_time = None
37 self.updated_time = None
38
39 # Information of the analyzed build.
40 build_start_time = ndb.DateTimeProperty(indexed=True)
41
42 # Information of analysis processing.
43 pipeline_url = ndb.StringProperty(indexed=False)
44 status = ndb.IntegerProperty(
45 default=BuildAnalysisStatus.PENDING, indexed=False)
46 start_time = ndb.DateTimeProperty(indexed=False)
47 updated_time = ndb.DateTimeProperty(indexed=False)
OLDNEW
« no previous file with comments | « appengine/findit/model/build.py ('k') | appengine/findit/model/test/base_build_model_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698