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

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

Issue 2075423002: [Findit] Group failures by culprit and send notification to codereview. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Address Jeff's comments. Tests will be added in next patch. Created 4 years, 6 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 | « no previous file | appengine/findit/waterfall/identify_try_job_culprit_pipeline.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 2016 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 import analysis_status as status
8
9
10 class WfCulprit(ndb.Model):
11 """Represents a culprit that causes a group of failures on Chromium waterfall.
12
13 'Wf' is short for waterfall.
14 """
15
16 # Repo or project name of the culprit, eg: chromium, etc.
17 repo_name = ndb.StringProperty()
18
19 # The Git hash revision of the culprit.
20 revision = ndb.StringProperty(indexed=False)
21
22 # When the code-review of this culprit was notified.
23 cr_notification_time = ndb.DateTimeProperty()
lijeffrey 2016/06/21 17:59:54 do we still want to do ndb.DateTimeProperty(indexe
stgao 2016/06/24 16:10:28 By default, it is indexed. But I made it explicit.
24
25 # The status of code-review notification.
26 cr_notification_status = ndb.IntegerProperty()
27
28 # The list of builds in which the culprit caused some breakage.
29 builds = ndb.JsonProperty(indexed=False, default=[])
30
31 @property
32 def project_name(self): # pragma: no cover
33 return self.repo_name
34
35 @property
36 def cr_notification_processed(self):
37 return self.cr_notification_status in (status.COMPLETED, status.RUNNING)
38
39 @property
40 def cr_notified(self):
41 return self.cr_notification_status == status.COMPLETED
42
43 @classmethod
44 def _CreateKey(cls, repo_name, revision): # pragma: no cover
45 return ndb.Key(cls.__name__, '%s/%s' % (repo_name, revision))
46
47 @classmethod
48 def Create(cls, repo_name, revision): # pragma: no cover
49 return cls(key=cls._CreateKey(repo_name, revision))
50
51 @classmethod
52 def Get(cls, repo_name, revision): # pragma: no cover
53 return cls._CreateKey(repo_name, revision).get()
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/waterfall/identify_try_job_culprit_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698