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

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

Issue 2605803002: [Findit] Refactoring WfTryJobData into BaseTryJobData, WfTryJobData, and FlakeTryJobData (Closed)
Patch Set: Fixing code coverage Created 3 years, 11 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
index fdf97fcf26f28e7763966a7423a3c7eddcd1f345..cf06d7763f110636e4778a531fba3b27c91a2e6b 100644
--- a/appengine/findit/waterfall/schedule_compile_try_job_pipeline.py
+++ b/appengine/findit/waterfall/schedule_compile_try_job_pipeline.py
@@ -4,6 +4,7 @@
from common.waterfall import failure_type
from model.wf_try_job import WfTryJob
+from model.wf_try_job_data import WfTryJobData
from waterfall.schedule_try_job_pipeline import ScheduleTryJobPipeline
@@ -20,6 +21,16 @@ class ScheduleCompileTryJobPipeline(ScheduleTryJobPipeline):
return properties
+ def _CreateTryJobData(
+ self, build_id, try_job_key, has_compile_targets, has_heuristic_results):
+ try_job_data = WfTryJobData.Create(build_id)
+ try_job_data.has_compile_targets = has_compile_targets
+ try_job_data.has_heuristic_results = has_heuristic_results
+ try_job_data.try_job_key = try_job_key
+ try_job_data.try_job_type = failure_type.GetDescriptionForFailureType(
+ failure_type.COMPILE)
+ try_job_data.put()
+
# Arguments number differs from overridden method - pylint: disable=W0221
def run(
self, master_name, builder_name, build_number, good_revision,
@@ -47,16 +58,14 @@ class ScheduleCompileTryJobPipeline(ScheduleTryJobPipeline):
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()
+ try_job = WfTryJob.Get(master_name, builder_name, build_number)
+ try_job.compile_results.append({'try_job_id': build_id})
+ try_job.try_job_ids.append(build_id)
+ try_job.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))
+ build_id, try_job.key, bool(compile_targets), bool(suspected_revisions))
return build_id
« no previous file with comments | « appengine/findit/waterfall/monitor_try_job_pipeline.py ('k') | appengine/findit/waterfall/schedule_test_try_job_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698