s/rida/mbs/

This commit is contained in:
Filip Valder
2017-02-28 17:59:02 +01:00
parent 13b7bcd03e
commit 6b343896dd
10 changed files with 24 additions and 18 deletions

View File

@@ -37,7 +37,7 @@ Your `ssh_config` should look like this::
The configuration above assumes that the development instance with
pdc-updater has the following endpoints configured (typically in
`/etc/fedmsg.d/endpoints.py`).
`/etc/fedmsg.d/endpoints.py`)::
endpoints={
"rida.local": [
@@ -179,3 +179,9 @@ Create a directory to house the fedmsg cache::
Then uncomment the fedmsg signing configuration in
`fedmsg.d/module_build_service.py`.
Historical Names of Module Build Service
----------------------------------------
- Rida
- The Orchestrator

View File

@@ -142,7 +142,7 @@ class GenericBuilder(six.with_metaclass(ABCMeta)):
def tag_to_repo(cls, backend, config, tag_name, arch):
"""
:param backend: a string representing the backend e.g. 'koji'.
:param config: instance of rida.config.Config
:param config: instance of module_build_service.config.Config
:param tag_name: Tag for which the repository is returned
:param arch: Architecture for which the repository is returned
@@ -272,7 +272,7 @@ class GenericBuilder(six.with_metaclass(ABCMeta)):
@abstractmethod
def repo_from_tag(self, config, tag_name, arch):
"""
:param config: instance of rida.config.Config
:param config: instance of module_build_service.config.Config
:param tag_name: Tag for which the repository is returned
:param arch: Architecture for which the repository is returned
@@ -425,7 +425,7 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
%changelog
* {today} Fedora-Modularity - {version}-{release}{disttag}
- autogenerated macro by Rida "The Orchestrator"
- autogenerated macro by Module Build Service (MBS)
""".format(disttag=disttag, today=today, name=name, version=version, release=release)
td = tempfile.mkdtemp(prefix="module_build_service-build-macros")
fd = open(os.path.join(td, "%s.spec" % name), "w")
@@ -672,7 +672,7 @@ chmod 644 %buildroot/%_rpmconfigdir/macros.d/macros.modules
@module_build_service.utils.validate_koji_tag('tag_name')
def repo_from_tag(cls, config, tag_name, arch):
"""
:param config: instance of rida.config.Config
:param config: instance of module_build_service.config.Config
:param tag_name: Tag for which the repository is returned
:param arch: Architecture for which the repository is returned
@@ -1104,7 +1104,7 @@ class CoprModuleBuilder(GenericBuilder):
def repo_from_tag(cls, config, tag_name, arch):
"""
:param backend: a string representing the backend e.g. 'koji'.
:param config: instance of rida.config.Config
:param config: instance of module_build_service.config.Config
:param tag_name: Tag for which the repository is returned
:param arch: Architecture for which the repository is returned

View File

@@ -26,7 +26,7 @@
"""
Logging functions.
At the beginning of the Rida flow, init_logging(conf) must be called.
At the beginning of the MBS flow, init_logging(conf) must be called.
After that, logging from any module is possible using Python's "logging"
module as showed at

View File

@@ -43,7 +43,7 @@ from module_build_service.pdc import (
from module_build_service.utils import (
submit_module_build_from_scm,
)
from module_build_service.messaging import RidaModule
from module_build_service.messaging import MBSModule
import module_build_service.messaging
import module_build_service.scheduler.consumer
@@ -175,7 +175,7 @@ def build_module_locally(url):
submit_module_build_from_scm(username, url, allow_local_url=True)
stop = module_build_service.scheduler.make_simple_stop_condition(db.session)
initial_messages = [RidaModule("local module build", 1, 1)]
initial_messages = [MBSModule("local module build", 1, 1)]
# Run the consumer until stop_condition returns True
module_build_service.scheduler.main(initial_messages, stop)

View File

@@ -134,7 +134,7 @@ class BaseMessage(object):
log.debug("Found mbs related msg: %s" % msg)
body = json.loads(msg.body, encoding='utf8')
if topic == 'module.state.change':
msg_obj = RidaModule(
msg_obj = MBSModule(
msg.id, body['id'], body['state'])
if msg_obj:
@@ -197,7 +197,7 @@ class BaseMessage(object):
elif category == 'mbs' and object == 'module' and \
subobject == 'state' and event == 'change':
msg_obj = RidaModule(
msg_obj = MBSModule(
msg_id, msg_inner_msg.get('id'), msg_inner_msg.get('state'))
# If the message matched the regex and is important to the app,
@@ -247,7 +247,7 @@ class KojiRepoChange(BaseMessage):
self.repo_tag = repo_tag
class RidaModule(BaseMessage):
class MBSModule(BaseMessage):
""" A class that inherits from BaseMessage to provide a message
object for a module event generated by module_build_service
:param msg_id: the id of the msg (e.g. 2016-SomeGUID)
@@ -255,7 +255,7 @@ class RidaModule(BaseMessage):
:param module_build_state: the state of the module build
"""
def __init__(self, msg_id, module_build_id, module_build_state):
super(RidaModule, self).__init__(msg_id)
super(MBSModule, self).__init__(msg_id)
self.module_build_id = module_build_id
self.module_build_state = module_build_state

View File

@@ -150,7 +150,7 @@ class ModuleBuild(MBSBase):
@classmethod
def from_module_event(cls, session, event):
if type(event) == module_build_service.messaging.RidaModule:
if type(event) == module_build_service.messaging.MBSModule:
return session.query(cls).filter(
cls.id == event.module_build_id).first()
else:

View File

@@ -172,7 +172,7 @@ class MBSConsumer(fedmsg.consumers.FedmsgConsumer):
handler = self.on_build_change[msg.build_new_state]
elif type(msg) == module_build_service.messaging.KojiRepoChange:
handler = self.on_repo_change
elif type(msg) == module_build_service.messaging.RidaModule:
elif type(msg) == module_build_service.messaging.MBSModule:
handler = self.on_module_change[module_build_state_from_msg(msg)]
else:
log.debug("Unhandled message...")

View File

@@ -132,7 +132,7 @@ class MBSProducer(PollingProducer):
.format(len(builds)))
for build in builds:
# Fake a message to kickstart the build anew
msg = module_build_service.messaging.RidaModule(
msg = module_build_service.messaging.MBSModule(
'fake message',
build.id,
module_build_service.models.BUILD_STATES['wait']

View File

@@ -184,7 +184,7 @@ class ModuleBuildAPI(MethodView):
def register_api_v1():
""" Registers version 1 of Rida API. """
""" Registers version 1 of MBS API. """
module_view = ModuleBuildAPI.as_view('module_builds')
for key, val in api_v1.items():
app.add_url_rule(val['url'],

View File

@@ -73,6 +73,6 @@ class TestModuleWait(unittest.TestCase):
from_module_event.return_value = mocked_module_build
msg = module_build_service.messaging.RidaModule(msg_id=None, module_build_id=1,
msg = module_build_service.messaging.MBSModule(msg_id=None, module_build_id=1,
module_build_state='some state')
self.fn(config=self.config, session=self.session, msg=msg)