| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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): |
| 51 return BuildStep( | 51 return BuildStep( |
| 52 master_name=BuildStep._StripMasterPrefix(master_name), | 52 master_name=BuildStep._StripMasterPrefix(master_name), |
| 53 builder_name=builder_name, | 53 builder_name=builder_name, |
| 54 build_number=build_number, | 54 build_number=build_number, |
| 55 step_name=step_name, | 55 step_name=step_name, |
| 56 reported_time=reported_time) | 56 reported_time=reported_time) |
| 57 | 57 |
| 58 @property |
| 59 def has_matching_waterfall_step(self): |
| 60 return None not in (self.wf_master_name, self.wf_builder_name, |
| 61 self.wf_build_number, self.wf_step_name) |
| 62 |
| 58 | 63 |
| 59 class FlakeAnalysisRequest(VersionedModel): | 64 class FlakeAnalysisRequest(VersionedModel): |
| 60 """Represents a request to analyze a flake. | 65 """Represents a request to analyze a flake. |
| 61 | 66 |
| 62 The name of the flake will be the key, and the model is versioned. | 67 The name of the flake will be the key, and the model is versioned. |
| 63 """ | 68 """ |
| 64 | 69 |
| 65 # Name of the flake. Could be a step name, or a test name. | 70 # Name of the flake. Could be a step name, or a test name. |
| 66 # Assume there are no step and test with the same name. | 71 # Assume there are no step and test with the same name. |
| 67 name = ndb.StringProperty(indexed=True) | 72 name = ndb.StringProperty(indexed=True) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 if s.build_number <= build_number: | 112 if s.build_number <= build_number: |
| 108 return False | 113 return False |
| 109 s.build_number = build_number | 114 s.build_number = build_number |
| 110 s.reported_time = reported_time | 115 s.reported_time = reported_time |
| 111 return True | 116 return True |
| 112 | 117 |
| 113 self.build_steps.append( | 118 self.build_steps.append( |
| 114 BuildStep.Create( | 119 BuildStep.Create( |
| 115 master_name, builder_name, build_number, step_name, reported_time)) | 120 master_name, builder_name, build_number, step_name, reported_time)) |
| 116 return True | 121 return True |
| OLD | NEW |