Instantly fail component builds if we fail to submit them

- Fail builds if builder.build() does not return bool(value) == True

Signed-off-by: Lubos Kocman <lkocman@redhat.com>
This commit is contained in:
Lubos Kocman
2016-10-12 16:32:52 +02:00
parent 8e075bfeb0
commit b4d712cf33
2 changed files with 14 additions and 1 deletions

View File

@@ -71,6 +71,11 @@ def start_next_build_batch(module, session, builder, components=None):
for c in unbuilt_components:
c.batch = module.batch
c.task_id = builder.build(artifact_name=c.package, source=c.scmurl)
# Fail task if we failed to submit it to koji
# This typically happens when koji auth failed
if not c.task_id:
c.state = koji.BUILD_STATES['FAILED']
# TODO: set c.fail_reason to "Failed to submit build"
session.commit()