| 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 Args: |
| 29 master_name (str): the master name of a build. |
| 30 builder_name (str): the builder name of a build. |
| 31 build_number (int): the build number of a build. |
| 32 good_revision (str): the revision of the last passed build. |
| 33 bad__revision (str): the revision of the first failed build. |
| 34 try_job_type (int): type of the try job: COMPILE in this case. |
| 35 compile_targets (list): a list of failed output nodes. |
| 36 suspected_revisions (list): a list of suspected revisions from heuristic. |
| 37 |
| 38 Returns: |
| 39 build_id (str): id of the triggered try job. |
| 40 """ |
| 41 |
| 42 properties = self._GetBuildProperties( |
| 43 master_name, builder_name, build_number, good_revision, bad_revision, |
| 44 try_job_type, suspected_revisions) |
| 45 additional_parameters = {'compile_targets': compile_targets} |
| 46 |
| 47 build_id = self._TriggerTryJob( |
| 48 master_name, builder_name, properties, additional_parameters) |
| 49 |
| 50 try_job_result = WfTryJob.Get(master_name, builder_name, build_number) |
| 51 try_job_result.compile_results.append({'try_job_id': build_id}) |
| 52 try_job_result.try_job_ids.append(build_id) |
| 53 try_job_result.put() |
| 54 |
| 55 # Create a corresponding WfTryJobData entity to capture as much metadata as |
| 56 # early as possible. |
| 57 self._CreateTryJobData( |
| 58 build_id, master_name, builder_name, build_number, |
| 59 failure_type.GetDescriptionForFailureType(try_job_type), |
| 60 bool(compile_targets), bool(suspected_revisions)) |
| 61 |
| 62 return build_id |
| OLD | NEW |