| Index: appengine/findit/waterfall/schedule_try_job_pipeline.py
|
| diff --git a/appengine/findit/waterfall/schedule_try_job_pipeline.py b/appengine/findit/waterfall/schedule_try_job_pipeline.py
|
| index a195c5d4f6e00fbe6658077ce8ed77cd3a073b5c..bae8b08946415c40ea914b4ac9fd357dfafc9fa3 100644
|
| --- a/appengine/findit/waterfall/schedule_try_job_pipeline.py
|
| +++ b/appengine/findit/waterfall/schedule_try_job_pipeline.py
|
| @@ -5,21 +5,22 @@
|
| from common.pipeline_wrapper import BasePipeline
|
| from common.pipeline_wrapper import pipeline
|
| from common.waterfall import buildbucket_client
|
| +from common.waterfall import failure_type
|
| from model.wf_try_job import WfTryJob
|
| from model.wf_try_job_data import WfTryJobData
|
| from waterfall import buildbot
|
| from waterfall import waterfall_config
|
| -from waterfall.try_job_type import TryJobType
|
|
|
|
|
| class ScheduleTryJobPipeline(BasePipeline):
|
| - """A pipeline for scheduling a new try job for current build."""
|
| + """A base pipeline for scheduling a new try job for current build."""
|
|
|
| def _GetBuildProperties(
|
| self, master_name, builder_name, build_number, good_revision,
|
| bad_revision, try_job_type, suspected_revisions):
|
| properties = {
|
| - 'recipe': 'findit/chromium/%s' % try_job_type,
|
| + 'recipe': 'findit/chromium/%s' % (
|
| + failure_type.GetDescriptionForFailureType(try_job_type)),
|
| 'good_revision': good_revision,
|
| 'bad_revision': bad_revision,
|
| 'target_mastername': master_name,
|
| @@ -27,34 +28,17 @@ class ScheduleTryJobPipeline(BasePipeline):
|
| master_name, builder_name, build_number)
|
| }
|
|
|
| - if try_job_type == TryJobType.COMPILE:
|
| - properties['target_buildername'] = builder_name
|
| - else: # try_job_type is 'test'.
|
| - properties['target_testername'] = builder_name
|
| -
|
| if suspected_revisions:
|
| properties['suspected_revisions'] = suspected_revisions
|
|
|
| return properties
|
|
|
| - # Arguments number differs from overridden method - pylint: disable=W0221
|
| - def run(
|
| - self, master_name, builder_name, build_number, good_revision,
|
| - bad_revision, try_job_type, compile_targets, targeted_tests,
|
| - suspected_revisions):
|
| + def _TriggerTryJob(
|
| + self, master_name, builder_name, properties, additional_parameters):
|
| tryserver_mastername, tryserver_buildername = (
|
| waterfall_config.GetTrybotForWaterfallBuilder(
|
| master_name, builder_name))
|
|
|
| - properties = self._GetBuildProperties(
|
| - master_name, builder_name, build_number, good_revision, bad_revision,
|
| - try_job_type, suspected_revisions)
|
| -
|
| - if try_job_type == TryJobType.COMPILE:
|
| - additional_parameters = {'compile_targets': compile_targets}
|
| - else:
|
| - additional_parameters = {'tests': targeted_tests}
|
| -
|
| try_job = buildbucket_client.TryJob(
|
| tryserver_mastername, tryserver_buildername, None, properties, [],
|
| additional_parameters)
|
| @@ -64,25 +48,22 @@ class ScheduleTryJobPipeline(BasePipeline):
|
| raise pipeline.Retry(
|
| 'Error "%s" occurred. Reason: "%s"' % (error.message, error.reason))
|
|
|
| - try_job_result = WfTryJob.Get(master_name, builder_name, build_number)
|
| - build_id = build.id
|
| + return build.id
|
|
|
| - if try_job_type == TryJobType.COMPILE:
|
| - try_job_result.compile_results.append({'try_job_id': build_id})
|
| - else:
|
| - try_job_result.test_results.append({'try_job_id': build_id})
|
| - try_job_result.try_job_ids.append(build_id)
|
| - try_job_result.put()
|
| -
|
| - # Create a corresponding WfTryJobData entity to capture as much metadata as
|
| - # early as possible.
|
| + def _CreateTryJobData(
|
| + self, build_id, master_name, builder_name, build_number, try_job_type,
|
| + has_compile_targets, has_heuristic_results):
|
| try_job_data = WfTryJobData.Create(build_id)
|
| try_job_data.master_name = master_name
|
| try_job_data.builder_name = builder_name
|
| try_job_data.build_number = build_number
|
| try_job_data.try_job_type = try_job_type
|
| - try_job_data.has_compile_targets = bool(compile_targets)
|
| - try_job_data.has_heuristic_results = bool(suspected_revisions)
|
| + try_job_data.has_compile_targets = has_compile_targets
|
| + try_job_data.has_heuristic_results = has_heuristic_results
|
| try_job_data.put()
|
|
|
| - return build_id
|
| + # Arguments number differs from overridden method - pylint: disable=W0221
|
| + def run(
|
| + self, master_name, builder_name, build_number, good_revision,
|
| + bad_revision, try_job_type, suspected_revisions):
|
| + raise NotImplementedError()
|
|
|