mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 17:51:43 +08:00
Be honest. This is a task_id, not a build_id.
This commit is contained in:
@@ -260,7 +260,7 @@ class KojiModuleBuilder(GenericBuilder):
|
||||
def build(self, artifact_name, source):
|
||||
"""
|
||||
:param source : scmurl to spec repository
|
||||
:return koji build id
|
||||
:return koji build task id
|
||||
"""
|
||||
if not self.__prep:
|
||||
raise RuntimeError("Buildroot is not prep-ed")
|
||||
@@ -268,10 +268,10 @@ class KojiModuleBuilder(GenericBuilder):
|
||||
if '://' not in source:
|
||||
raise NotImplementedError("Only scm url is currently supported, got source='%s'" % source)
|
||||
self._koji_whitelist_packages([artifact_name,])
|
||||
build_id = self.koji_session.build(source, self.module_target['name'])
|
||||
log.info("%r submitted build of %s (build_id=%s)" % (
|
||||
self, source, build_id))
|
||||
return build_id
|
||||
task_id = self.koji_session.build(source, self.module_target['name'])
|
||||
log.info("%r submitted build of %s (task_id=%s)" % (
|
||||
self, source, task_id))
|
||||
return task_id
|
||||
|
||||
def _get_tag(self, tag, strict=True):
|
||||
if isinstance(tag, dict):
|
||||
|
||||
@@ -232,7 +232,7 @@ class ComponentBuild(Base):
|
||||
gitref = Column(String, nullable=False)
|
||||
# XXX: Consider making this a proper ENUM
|
||||
format = Column(String, nullable=False)
|
||||
build_id = Column(Integer) # This is the id of the build in koji
|
||||
task_id = Column(Integer) # This is the id of the build in koji
|
||||
# XXX: Consider making this a proper ENUM (or an int)
|
||||
state = Column(Integer)
|
||||
|
||||
@@ -243,14 +243,14 @@ class ComponentBuild(Base):
|
||||
def from_fedmsg(cls, session, msg):
|
||||
if '.buildsys.build.state.change' not in msg['topic']:
|
||||
raise ValueError("%r is not a koji message." % msg['topic'])
|
||||
return session.query(cls).filter(cls.build_id==msg['msg']['build_id']).first()
|
||||
return session.query(cls).filter(cls.task_id==msg['msg']['task_id']).first()
|
||||
|
||||
def json(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'package': self.package,
|
||||
'format': self.format,
|
||||
'build_id': self.build_id,
|
||||
'task_id': self.task_id,
|
||||
'state': self.state,
|
||||
'module_build': self.module_id,
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import logging
|
||||
|
||||
logging.debug("Phasers are set to stun.")
|
||||
logging.info("%s tried to build something", username)
|
||||
logging.warn("%s failed to build", build_id)
|
||||
logging.warn("%s failed to build", task_id)
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -59,5 +59,5 @@ def done(config, session, msg):
|
||||
)
|
||||
artifact_name = 'TODO'
|
||||
component_build.state = koji.BUILD_STATES['BUILDING']
|
||||
component_build.build_id = builder.build(artifact_name, scmurl)
|
||||
component_build.task_id = builder.build(artifact_name, scmurl)
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user