| 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 common.pipeline_wrapper import BasePipeline | 5 from common.pipeline_wrapper import BasePipeline |
| 6 from common.waterfall import failure_type | |
| 7 from model.wf_analysis import WfAnalysis | 6 from model.wf_analysis import WfAnalysis |
| 8 from waterfall import try_job_util | 7 from waterfall import try_job_util |
| 9 | 8 |
| 10 | 9 |
| 11 class StartTryJobOnDemandPipeline(BasePipeline): | 10 class StartTryJobOnDemandPipeline(BasePipeline): |
| 12 | 11 |
| 13 # Arguments number differs from overridden method - pylint: disable=W0221 | 12 # Arguments number differs from overridden method - pylint: disable=W0221 |
| 14 def run(self, failure_info, signals, build_completed, heuristic_result): | 13 def run(self, failure_info, signals, build_completed, force_try_job, |
| 14 heuristic_result): |
| 15 """Starts a try job if one is needed for the given failure.""" | 15 """Starts a try job if one is needed for the given failure.""" |
| 16 if not build_completed: # Only start try-jobs for completed builds. | 16 if not build_completed: # Only start try-jobs for completed builds. |
| 17 return False | 17 return False |
| 18 | 18 |
| 19 failure_result_map = try_job_util.ScheduleTryJobIfNeeded( | 19 failure_result_map = try_job_util.ScheduleTryJobIfNeeded( |
| 20 failure_info, signals=signals, heuristic_result=heuristic_result) | 20 failure_info, signals=signals, heuristic_result=heuristic_result, |
| 21 force_try_job=force_try_job) |
| 21 | 22 |
| 22 # Save reference to the try-jobs if any was scheduled. | 23 # Save reference to the try-jobs if any was scheduled. |
| 23 master_name = failure_info['master_name'] | 24 master_name = failure_info['master_name'] |
| 24 builder_name = failure_info['builder_name'] | 25 builder_name = failure_info['builder_name'] |
| 25 build_number = failure_info['build_number'] | 26 build_number = failure_info['build_number'] |
| 26 analysis = WfAnalysis.Get(master_name, builder_name, build_number) | 27 analysis = WfAnalysis.Get(master_name, builder_name, build_number) |
| 27 analysis.failure_result_map = failure_result_map | 28 analysis.failure_result_map = failure_result_map |
| 28 analysis.put() | 29 analysis.put() |
| 29 return True | 30 return True |
| OLD | NEW |