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

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

Issue 1926473002: [Findit] Adding new fields to try job metadata and updating as soon as possible (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Addressing comments Created 4 years, 8 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_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..a29ca3d4f6c3086a46f3ca90320dec0864b2c727 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,24 @@ 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.
+ 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

Powered by Google App Engine
This is Rietveld 408576698