mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-12 01:24:59 +08:00
Merge #87 Instantly fail component builds if we fail to submit them
This commit is contained in:
@@ -129,14 +129,22 @@ def wait(config, session, msg):
|
||||
build.batch = 1
|
||||
|
||||
artifact_name = "module-build-macros"
|
||||
state = koji.BUILD_STATES['BUILDING'] # Default state
|
||||
task_id = builder.build(artifact_name=artifact_name, source=srpm)
|
||||
|
||||
# Fail task if we failed to submit it to koji
|
||||
# This typically happens when koji auth failed
|
||||
if not task_id:
|
||||
state = koji.BUILD_STATES['FAILED']
|
||||
# TODO: set fail_reason to "Failed to submit build"
|
||||
|
||||
component_build = models.ComponentBuild(
|
||||
module_id=build.id,
|
||||
package=artifact_name,
|
||||
format="rpms",
|
||||
scmurl=srpm,
|
||||
task_id=task_id,
|
||||
state=koji.BUILD_STATES['BUILDING'],
|
||||
state=state,
|
||||
batch=1,
|
||||
)
|
||||
session.add(component_build)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user