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

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

Issue 2320153003: [Findit] Datamodel change for triaging at CL level. (Closed)
Patch Set: change index.yaml Created 4 years, 3 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 import analysis_status as status 7 from model import analysis_status as status
8 from model.wf_suspected_cl import WfSuspectedCL 8 from model.base_suspected_cl import BaseSuspectedCL
9 9
10 10
11 class WfCulprit(WfSuspectedCL): 11 class WfCulprit(BaseSuspectedCL):
12 """Represents a culprit that causes a group of failures on Chromium waterfall. 12 """Represents a culprit that causes a group of failures on Chromium waterfall.
13 13
14 'Wf' is short for waterfall. 14 'Wf' is short for waterfall.
15 """ 15 """
16 # The list of builds in which the culprit caused some breakage.
17 builds = ndb.JsonProperty(indexed=False)
16 18
17 # When the code-review of this culprit was notified. 19 # When the code-review of this culprit was notified.
18 cr_notification_time = ndb.DateTimeProperty(indexed=True) 20 cr_notification_time = ndb.DateTimeProperty(indexed=True)
19 21
20 # The status of code-review notification: None, RUNNING, COMPLETED, ERROR. 22 # The status of code-review notification: None, RUNNING, COMPLETED, ERROR.
21 cr_notification_status = ndb.IntegerProperty(indexed=True) 23 cr_notification_status = ndb.IntegerProperty(indexed=True)
22 24
23 @property 25 @property
24 def cr_notification_processed(self): 26 def cr_notification_processed(self):
25 return self.cr_notification_status in (status.COMPLETED, status.RUNNING) 27 return self.cr_notification_status in (status.COMPLETED, status.RUNNING)
26 28
27 @property 29 @property
28 def cr_notified(self): 30 def cr_notified(self):
29 return self.cr_notification_status == status.COMPLETED 31 return self.cr_notification_status == status.COMPLETED
32
33 @classmethod
34 def Create(cls, repo_name, revision, commit_position): # pragma: no cover
35 instance = cls(key=cls._CreateKey(repo_name, revision))
36 instance.repo_name = repo_name
37 instance.revision = revision
38 instance.commit_position = commit_position
39 instance.builds = []
40 return instance
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698