| 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 from model.flake.master_flake_analysis import MasterFlakeAnalysis | 7 from model.flake.master_flake_analysis import MasterFlakeAnalysis |
| 8 from model.versioned_model import VersionedModel | 8 from model.versioned_model import VersionedModel |
| 9 | 9 |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 wf_builder_name = ndb.StringProperty(indexed=False) | 29 wf_builder_name = ndb.StringProperty(indexed=False) |
| 30 wf_build_number = ndb.IntegerProperty(indexed=False) | 30 wf_build_number = ndb.IntegerProperty(indexed=False) |
| 31 wf_step_name = ndb.StringProperty(indexed=False) | 31 wf_step_name = ndb.StringProperty(indexed=False) |
| 32 | 32 |
| 33 # Indicate whether the flake is run on Swarming. | 33 # Indicate whether the flake is run on Swarming. |
| 34 swarmed = ndb.BooleanProperty(indexed=False, default=False) | 34 swarmed = ndb.BooleanProperty(indexed=False, default=False) |
| 35 | 35 |
| 36 # Indicate whether analysis on the step is supported. | 36 # Indicate whether analysis on the step is supported. |
| 37 supported = ndb.BooleanProperty(indexed=False, default=False) | 37 supported = ndb.BooleanProperty(indexed=False, default=False) |
| 38 | 38 |
| 39 # Indicate whether the flake on this configuration is analyzed. | 39 # Indicate whether the analysis of flake on this configuration is scheduled. |
| 40 analyzed = ndb.BooleanProperty(indexed=False, default=False) | 40 scheduled = ndb.BooleanProperty(indexed=False, default=False) |
| 41 | 41 |
| 42 @staticmethod | 42 @staticmethod |
| 43 def _StripMasterPrefix(name): | 43 def _StripMasterPrefix(name): |
| 44 master_prefix = 'master.' | 44 master_prefix = 'master.' |
| 45 if name.startswith(master_prefix): | 45 if name.startswith(master_prefix): |
| 46 return name[len(master_prefix):] | 46 return name[len(master_prefix):] |
| 47 return name | 47 return name |
| 48 | 48 |
| 49 @staticmethod | 49 @staticmethod |
| 50 def Create(master_name, builder_name, build_number, step_name, reported_time): | 50 def Create(master_name, builder_name, build_number, step_name, reported_time): |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 if s.build_number <= build_number: | 112 if s.build_number <= build_number: |
| 113 return False | 113 return False |
| 114 s.build_number = build_number | 114 s.build_number = build_number |
| 115 s.reported_time = reported_time | 115 s.reported_time = reported_time |
| 116 return True | 116 return True |
| 117 | 117 |
| 118 self.build_steps.append( | 118 self.build_steps.append( |
| 119 BuildStep.Create( | 119 BuildStep.Create( |
| 120 master_name, builder_name, build_number, step_name, reported_time)) | 120 master_name, builder_name, build_number, step_name, reported_time)) |
| 121 return True | 121 return True |
| 122 |
| 123 def CopyFrom(self, other): |
| 124 """Copies all states from the given request.""" |
| 125 assert isinstance(other, FlakeAnalysisRequest) |
| 126 self.is_step = other.is_step |
| 127 self.bug_id = other.bug_id |
| 128 self.user_emails = other.user_emails |
| 129 self.build_steps = other.build_steps |
| 130 self.analyses = other.analyses |
| OLD | NEW |