Pretend that build was successful so that rida submits next batch

This commit is contained in:
Jakub Kadlčík
2016-11-18 02:52:12 +01:00
parent 0e3083fc4c
commit f9220a4470
3 changed files with 16 additions and 3 deletions

View File

@@ -902,7 +902,9 @@ class CoprModuleBuilder(GenericBuilder):
log.info(result.data["modulemd"])
# @TODO result should contain "module_id", "action_id" and "action_state"
return None, None, result.message, "-".join([m1.name, m1.version, m1.release])
# Since we don't have implemented messaging support in copr yet,
# let's just assume that the build is finished by now
return None, koji.BUILD_STATES["COMPLETE"], result.message, "-".join([m1.name, m1.version, m1.release])
def build_from_scm(self, artifact_name, source):
"""
@@ -917,7 +919,7 @@ class CoprModuleBuilder(GenericBuilder):
td = None
owd = os.getcwd()
ret = 1, koji.BUILD_STATES["FAILED"], "Cannot create SRPM", None
ret = 1, koji.BUILD_STATES["COMPLETE"], "COPR BUILD DONE", None
try:
log.debug('Cloning source URL: %s' % source)

View File

@@ -251,3 +251,8 @@ def wait(config, session, msg):
# other backends need this implemented (e.g. COPR)
return [module_build_service.messaging.KojiRepoChange(
'fake msg', builder.module_build_tag['name'])]
# We don't have copr implementation finished yet, Let's fake the repo change event,
# as if copr builds finished successfully
if config.system == "copr":
return [module_build_service.messaging.KojiRepoChange('fake msg', build.koji_tag)]

View File

@@ -37,7 +37,7 @@ def done(config, session, msg):
# First, find our ModuleBuild associated with this repo, if any.
tag = msg.repo_tag
if not tag.endswith('-build'):
if config.system == "koji" and not tag.endswith('-build'):
log.info("Tag %r does not end with '-build' suffix, ignoring" % tag)
return
tag = tag.strip('-build')
@@ -130,6 +130,12 @@ def done(config, session, msg):
module_build_service.utils.start_build_batch(
config, module_build, session, builder)
# We don't have copr implementation finished yet, Let's fake the repo change event,
# as if copr builds finished successfully
if config.system == "copr":
return [module_build_service.messaging.KojiRepoChange('fake msg', module_build.koji_tag)]
else:
module_build.transition(config, state=models.BUILD_STATES['done'])
session.commit()