Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 7 |
| 8 class WfTryJobData(ndb.Model): | 8 class WfTryJobData(ndb.Model): |
|
stgao
2016/02/05 00:59:13
Just found that we didn't save the try job type, w
stgao
2016/02/05 00:59:13
A side note: later, we need to monitor the number
lijeffrey
2016/02/05 01:11:20
Done.
| |
| 9 """Represents a tryjob's data for a completed try job.""" | 9 """Represents a tryjob's data for a completed try job.""" |
| 10 # The original master on which the build was detected to have failed. | |
| 11 master_name = ndb.StringProperty(indexed=True) | |
| 12 # The original buildername on which the build was detected to have failed. | |
| 13 builder_name = ndb.StringProperty(indexed=True) | |
| 10 # When the try job was created. | 14 # When the try job was created. |
| 11 request_time = ndb.DateTimeProperty(indexed=False) | 15 request_time = ndb.DateTimeProperty(indexed=True) |
| 12 # When the try job began executing. | 16 # When the try job began executing. |
| 13 start_time = ndb.DateTimeProperty(indexed=False) | 17 start_time = ndb.DateTimeProperty(indexed=True) |
| 14 # When the try job completed. | 18 # When the try job completed. |
| 15 end_time = ndb.DateTimeProperty(indexed=False) | 19 end_time = ndb.DateTimeProperty(indexed=True) |
| 16 # Number of commits in the revision range. | 20 # Number of commits in the revision range. |
| 17 regression_range_size = ndb.IntegerProperty(indexed=False) | 21 regression_range_size = ndb.IntegerProperty(indexed=False) |
| 18 # Number of commits analyzed to determine a culprit if any. | 22 # Number of commits analyzed to determine a culprit if any. |
| 19 number_of_commits_analyzed = ndb.IntegerProperty(indexed=False) | 23 number_of_commits_analyzed = ndb.IntegerProperty(indexed=False) |
| 20 # Culprit(s) determined to have caused the failure, if any. | 24 # Culprit(s) determined to have caused the failure, if any. |
| 21 culprits = ndb.JsonProperty(indexed=False) | 25 culprits = ndb.JsonProperty(indexed=False) |
| 22 # The url to the try job build page. | 26 # The url to the try job build page. |
| 23 try_job_url = ndb.StringProperty(indexed=False) | 27 try_job_url = ndb.StringProperty(indexed=False) |
| 24 # Error message and reason, if any. | 28 # Error message and reason, if any. |
| 25 error = ndb.JsonProperty(indexed=False) | 29 error = ndb.JsonProperty(indexed=False) |
| 26 | 30 |
| 27 # TODO(lijeffrey): We may want to determine whether or not a try job | 31 # TODO(lijeffrey): We may want to determine whether or not a try job |
| 28 # was triggered as a redo of another if the first failed to find a culprit. | 32 # was triggered as a redo of another if the first failed to find a culprit. |
| 29 # For example, if passing compile targets yields no results, a redo without | 33 # For example, if passing compile targets yields no results, a redo without |
| 30 # compile targets may be attempted to find the culprit CL and the occurrence | 34 # compile targets may be attempted to find the culprit CL and the occurrence |
| 31 # documented in a queryable manner. | 35 # documented in a queryable manner. |
| 32 | 36 |
| 33 @staticmethod | 37 @staticmethod |
| 34 def _CreateKey(build_id): # pragma: no cover | 38 def _CreateKey(build_id): # pragma: no cover |
| 35 return ndb.Key('WfTryJobData', build_id) | 39 return ndb.Key('WfTryJobData', build_id) |
| 36 | 40 |
| 37 @staticmethod | 41 @staticmethod |
| 38 def Create(build_id): # pragma: no cover | 42 def Create(build_id): # pragma: no cover |
| 39 return WfTryJobData(key=WfTryJobData._CreateKey(build_id)) | 43 return WfTryJobData(key=WfTryJobData._CreateKey(build_id)) |
| 40 | 44 |
| 41 @staticmethod | 45 @staticmethod |
| 42 def Get(build_id): # pragma: no cover | 46 def Get(build_id): # pragma: no cover |
| 43 return WfTryJobData._CreateKey(build_id).get() | 47 return WfTryJobData._CreateKey(build_id).get() |
| 44 | 48 |
| OLD | NEW |