Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2152)

Unified Diff: appengine/findit/waterfall/schedule_compile_try_job_pipeline.py

Issue 2187763004: [Findit] Refactor Findit pipeline. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/waterfall/schedule_compile_try_job_pipeline.py
diff --git a/appengine/findit/waterfall/schedule_compile_try_job_pipeline.py b/appengine/findit/waterfall/schedule_compile_try_job_pipeline.py
new file mode 100644
index 0000000000000000000000000000000000000000..fdf97fcf26f28e7763966a7423a3c7eddcd1f345
--- /dev/null
+++ b/appengine/findit/waterfall/schedule_compile_try_job_pipeline.py
@@ -0,0 +1,62 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from common.waterfall import failure_type
+from model.wf_try_job import WfTryJob
+from waterfall.schedule_try_job_pipeline import ScheduleTryJobPipeline
+
+
+class ScheduleCompileTryJobPipeline(ScheduleTryJobPipeline):
+ """A pipeline for scheduling a new try job for failed compile build."""
+
+ def _GetBuildProperties(
+ self, master_name, builder_name, build_number, good_revision,
+ bad_revision, try_job_type, suspected_revisions):
+ properties = super(ScheduleCompileTryJobPipeline, self)._GetBuildProperties(
+ master_name, builder_name, build_number, good_revision,
+ bad_revision, try_job_type, suspected_revisions)
+ properties['target_buildername'] = builder_name
+
+ 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, suspected_revisions):
+ """
+ Args:
+ master_name (str): the master name of a build.
+ builder_name (str): the builder name of a build.
+ build_number (int): the build number of a build.
+ good_revision (str): the revision of the last passed build.
+ bad__revision (str): the revision of the first failed build.
+ try_job_type (int): type of the try job: COMPILE in this case.
+ compile_targets (list): a list of failed output nodes.
+ suspected_revisions (list): a list of suspected revisions from heuristic.
+
+ Returns:
+ build_id (str): id of the triggered try job.
+ """
+
+ properties = self._GetBuildProperties(
+ master_name, builder_name, build_number, good_revision, bad_revision,
+ try_job_type, suspected_revisions)
+ additional_parameters = {'compile_targets': compile_targets}
+
+ build_id = self._TriggerTryJob(
+ master_name, builder_name, properties, additional_parameters)
+
+ try_job_result = WfTryJob.Get(master_name, builder_name, build_number)
+ try_job_result.compile_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.
+ self._CreateTryJobData(
+ build_id, master_name, builder_name, build_number,
+ failure_type.GetDescriptionForFailureType(try_job_type),
+ bool(compile_targets), bool(suspected_revisions))
+
+ return build_id

Powered by Google App Engine
This is Rietveld 408576698