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

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: Add appengine/findit/model/test/base_model_test.py 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
OLDNEW
(Empty)
1 # Copyright (c) 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_model import BaseModel
8 from model.build_analysis_status import BuildAnalysisStatus
9
10
11 class BuildAnalysis(BaseModel):
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('Master', master_name, 'Builder', builder_name,
17 'BuildAnalysis', build_number)
18
19 @staticmethod
20 def CreateBuildAnalysis(
21 master_name, builder_name, build_number): # pragma: no cover
22 return BuildAnalysis(
23 key=BuildAnalysis.CreateKey(master_name, builder_name, build_number))
24
25 @staticmethod
26 def GetBuildAnalysis(
27 master_name, builder_name, build_number): # pragma: no cover
28 return BuildAnalysis.CreateKey(
29 master_name, builder_name, build_number).get()
30
31 def Reset(self): # pragma: no cover
32 """Reset to the state as if no analysis is run."""
33 self.pipeline_url = None
34 self.status = BuildAnalysisStatus.PENDING
35 self.start_time = None
36 self.updated_time = None
37
38 # Information of the analyzed build.
39 build_start_time = ndb.DateTimeProperty(indexed=True)
40
41 # Information of analysis processing.
42 pipeline_url = ndb.StringProperty(indexed=False)
43 status = ndb.IntegerProperty(
44 default=BuildAnalysisStatus.PENDING, indexed=False)
45 start_time = ndb.DateTimeProperty(indexed=False)
46 updated_time = ndb.DateTimeProperty(indexed=False)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698