koji: support draft builds
Draft builds have some specialities we need to take care of:
- the release and nvr contains
,draft_<build-id>suffix - the src.rpm does not contain the suffix
- we need to support the promoted nvr (without the draft suffix) in some use cases - see TFT-3976
To fix this:
-
introduce
draftproperty to the builds, indicating this is a draft build -
introduce
nvr_promotedwhich exposes the NVR that would be promoted for the draft build. This will be used in the UMB reporting to report the correct NVR in the messages (TFT-3976) -
correct the code so it reports correct
src.rpmname,release,nvr,rpm_urlsandsrpm_urlsby falling back to using subtasks similarly to scratch builds -
add test coverage for the added changes
You can test with a draft build this way:
$ poetry install -E development
$ citool brew --task-id 69369167 debug --execute
ipdb> self.shared('primary_task')
BrewTask(69369167)
ipdb> self.shared('primary_task').nvr
'libtiff-4.0.9-17.el8_2.2,draft_3882886'
ipdb> self.shared('primary_task').nvr_promoted
'libtiff-4.0.9-17.el8_2.2'
ipdb> self.shared('primary_task').release
'17.el8_2.2,draft_3882886'
ipdb> self.shared('primary_task').srpm_urls
['http://download.devel.redhat.com/brewroot/work/tasks/9180/69369180/libtiff-4.0.9-17.el8_2.2.src.rpm']
Relates to TFT-3976
Signed-off-by: Miroslav Vadkerti mvadkert@redhat.com