Don't report start on unmanaged projects

When using a check pipeline with enabled start reporting zuul reports
start on all projects of the gerrit instance regardless if they are
part of the pipeline or not. After that zuul notices that there are no
jobs to do.

The fix is to delay reporting until zuul knows if there are jobs to
run. This also implies changes to reporting of syntax errors such that
zuul now just reports with "syntax error" instead "starting jobs" and
then almost immediately "syntax error".

Change-Id: Idd754f3e42157d50012f49ef89cfb05f566efd7e
This commit is contained in:
Tobias Henkel
2017-05-16 13:40:03 +02:00
committed by James E. Blair
parent 7c60e4451b
commit 9842bd7eb3
5 changed files with 60 additions and 19 deletions

View File

@@ -312,9 +312,7 @@ class PipelineManager(object):
item.enqueue_time = enqueue_time
item.live = live
self.reportStats(item)
if not quiet:
if len(self.pipeline.start_actions) > 0:
self.reportStart(item)
item.quiet = quiet
self.enqueueChangesBehind(change, quiet, ignore_requirements,
change_queue)
zuul_driver = self.sched.connections.drivers['zuul']
@@ -580,6 +578,14 @@ class PipelineManager(object):
self.cancelJobs(item)
if actionable:
ready = self.prepareItem(item) and self.prepareJobs(item)
# Starting jobs reporting should only be done once if there are
# jobs to run for this item.
if ready and len(self.pipeline.start_actions) > 0 \
and len(item.job_graph.jobs) > 0 \
and not item.reported_start \
and not item.quiet:
self.reportStart(item)
item.reported_start = True
if item.current_build_set.unable_to_merge:
failing_reasons.append("it has a merge conflict")
if item.current_build_set.config_error: