Chromium Code Reviews| 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 c57a85fbdd1f1dfe52a3c2618848ae9f4399f185..9cb001b25e05998bd1273ce3803a289e128faf03 100644 |
| --- a/appengine/findit/waterfall/schedule_try_job_pipeline.py |
| +++ b/appengine/findit/waterfall/schedule_try_job_pipeline.py |
| @@ -6,6 +6,7 @@ from common.pipeline_wrapper import BasePipeline |
| from common.pipeline_wrapper import pipeline |
| from common.waterfall import buildbucket_client |
| 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 |
| @@ -62,11 +63,25 @@ class ScheduleTryJobPipeline(BasePipeline): |
| 'Error "%s" occurred. Reason: "%s"' % (error.message, error.reason)) |
| try_job_result = WfTryJob.Get(master_name, builder_name, build_number) |
| + build_id = build.id |
| + |
| if try_job_type == TryJobType.COMPILE: |
| - try_job_result.compile_results.append({'try_job_id': build.id}) |
| + 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.test_results.append({'try_job_id': build_id}) |
| + try_job_result.try_job_ids.append(build_id) |
| try_job_result.put() |
| - return build.id |
| + # Create a corresponding WfTryJobData entity to capture as much metadata as |
| + # early as possible. |
| + assert build_id |
|
stgao
2016/04/27 17:34:33
No need to assert here. If no error, build id will
lijeffrey
2016/04/27 22:21:03
Done.
|
| + 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.put() |
| + |
| + return build_id |