| OLD | NEW |
| (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_approach_type |
| 8 from model.wf_suspected_cl import WfSuspectedCL |
| 9 |
| 10 |
| 11 @ndb.transactional |
| 12 def UpdateSuspectedCL( |
| 13 approach, master_name, builder_name, build_number, failure_type, |
| 14 repo_name, revision, commit_position): |
| 15 |
| 16 suspected_cl = ( |
| 17 WfSuspectedCL.Get(repo_name, revision) or |
| 18 WfSuspectedCL.Create(repo_name, revision, commit_position)) |
| 19 |
| 20 if suspected_cl.approach is None: |
| 21 suspected_cl.approach = approach |
| 22 elif suspected_cl.approach != approach: |
| 23 suspected_cl.approach = analysis_approach_type.BOTH |
| 24 |
| 25 suspected_cl.failure_type = suspected_cl.failure_type or failure_type |
| 26 |
| 27 build_info = [master_name, builder_name, build_number] |
| 28 if build_info not in suspected_cl.builds: |
| 29 suspected_cl.builds.append(build_info) |
| 30 |
| 31 suspected_cl.put() |
| OLD | NEW |