worker/koji-finalize: always report status back to composer and Koji

Enhance the `koji-finalize` job implementation to use deferred function
to ensure that the job status is always reported back to the composer.
In addition, if the `JobError` is set, also fail the Koji job.

Previously, composer and Koji were not updated in some corner cases when
the job would fail.
This commit is contained in:
Tomas Hozza 2022-07-20 13:37:21 +02:00 committed by Tom Gundersen
parent 1fec2c476d
commit 58696e849f
2 changed files with 34 additions and 22 deletions

View file

@ -29,6 +29,7 @@ const (
ErrorJobDependency ClientErrorCode = 26
ErrorJobMissingHeartbeat ClientErrorCode = 27
ErrorTargetError ClientErrorCode = 28
ErrorParsingJobArgs ClientErrorCode = 29
)
type ClientErrorCode int