Use Koji multicall when tagging builds. Do not query Koji to get the status of builds which we are reusing from previous module build.

This commit is contained in:
Jan Kaluza
2017-04-04 11:23:30 +02:00
parent 1df6f8e8ad
commit 7e5743248e
2 changed files with 13 additions and 1 deletions

View File

@@ -575,6 +575,7 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
tagged_nvrs = self._get_tagged_nvrs(self.module_build_tag['name'])
self.koji_session.multicall = True
for nvr in artifacts:
if nvr in tagged_nvrs:
continue
@@ -589,18 +590,21 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
name = kobo.rpmlib.parse_nvr(nvr)['name']
log.info("%r adding %s to group %s" % (self, name, group))
self.koji_session.groupPackageListAdd(build_tag, group, name)
self.koji_session.multiCall(strict=True)
def tag_artifacts(self, artifacts):
dest_tag = self._get_tag(self.module_tag)['id']
tagged_nvrs = self._get_tagged_nvrs(self.module_tag['name'])
self.koji_session.multicall = True
for nvr in artifacts:
if nvr in tagged_nvrs:
continue
log.info("%r tagging %r into %r" % (self, nvr, dest_tag))
self.koji_session.tagBuild(dest_tag, nvr)
self.koji_session.multiCall(strict=True)
def wait_task(self, task_id):
"""

View File

@@ -74,6 +74,14 @@ class MBSProducer(PollingProducer):
if not component_build.task_id:
continue
# Don't check tasks for components which have been reused,
# they may have BUILDING state temporarily before we tag them
# to new module tag. Checking them would be waste of resources.
if component_build.reused_component_id:
log.debug('Skipping check for task "{0}", '
'the component has been reused.'.format(task_id))
continue
task_id = component_build.task_id
log.info('Checking status of task_id "{0}"'.format(task_id))
@@ -106,7 +114,7 @@ class MBSProducer(PollingProducer):
if task_info['state'] in state_mapping:
# Fake a fedmsg message on our internal queue
msg = module_build_service.messaging.KojiBuildChange(
msg_id='a faked internal message',
msg_id='producer::fail_lost_builds fake msg',
build_id=component_build.task_id,
task_id=component_build.task_id,
build_name=component_build.package,