| 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 common.waterfall import failure_type |
| 6 from model.wf_try_job import WfTryJob |
| 7 from waterfall.schedule_try_job_pipeline import ScheduleTryJobPipeline |
| 8 |
| 9 |
| 10 class ScheduleCompileTryJobPipeline(ScheduleTryJobPipeline): |
| 11 """A pipeline for scheduling a new try job for failed compile build.""" |
| 12 |
| 13 def _GetBuildProperties( |
| 14 self, master_name, builder_name, build_number, good_revision, |
| 15 bad_revision, try_job_type, suspected_revisions): |
| 16 properties = super(ScheduleCompileTryJobPipeline, self)._GetBuildProperties( |
| 17 master_name, builder_name, build_number, good_revision, |
| 18 bad_revision, try_job_type, suspected_revisions) |
| 19 properties['target_buildername'] = builder_name |
| 20 |
| 21 return properties |
| 22 |
| 23 # Arguments number differs from overridden method - pylint: disable=W0221 |
| 24 def run( |
| 25 self, master_name, builder_name, build_number, good_revision, |
| 26 bad_revision, try_job_type, compile_targets, suspected_revisions): |
| 27 |
| 28 properties = self._GetBuildProperties( |
| 29 master_name, builder_name, build_number, good_revision, bad_revision, |
| 30 try_job_type, suspected_revisions) |
| 31 additional_parameters = {'compile_targets': compile_targets} |
| 32 |
| 33 build_id = self._TriggerTryJob( |
| 34 master_name, builder_name, properties, additional_parameters) |
| 35 |
| 36 try_job_result = WfTryJob.Get(master_name, builder_name, build_number) |
| 37 try_job_result.compile_results.append({'try_job_id': build_id}) |
| 38 try_job_result.try_job_ids.append(build_id) |
| 39 try_job_result.put() |
| 40 |
| 41 # Create a corresponding WfTryJobData entity to capture as much metadata as |
| 42 # early as possible. |
| 43 self._CreateTryJobData( |
| 44 build_id, master_name, builder_name, build_number, |
| 45 failure_type.GetDescriptionForFailureType(try_job_type), |
| 46 bool(compile_targets), bool(suspected_revisions)) |
| 47 |
| 48 return build_id |
| OLD | NEW |