-
Notifications
You must be signed in to change notification settings - Fork 2
Rabbitmq integration plus integrations refactor #41
Conversation
Test coverage for b8fe43c
Static code analysis report
|
@@ -115,6 +115,11 @@ requires: | |||
interface: saml | |||
optional: True | |||
limit: 1 | |||
amqp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it have to be called this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update to rabbitmq in the other pr. The reason for that was because that was the name in rabbitmq-server (and amqp is the protocol)
import charms.data_platform_libs.v0.s3 # noqa: F401 | ||
except ImportError: | ||
logger.exception( | ||
"Missing charm library, please run `charmcraft fetch-lib charms.data_platform_libs.v0.s3`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we just say run fetch-libs
?
self.charm_integrations = Integrations(self) | ||
self.charm_integrations.register(self._on_generic_integration_event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I like it, I propose we go with the if-else ladder for now and get advice from @tonyandrewmeyer from the ops team on how to reduce it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't do this because it takes away the option of the charm developer customising the code. All the observe need to be here and all the functions need to be defined on the class so that an adventurous Flask developer can change how they work and still be able to use the machinery we have built
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, we can go without the refactor (I have it in the other PR).
However, I do not see why that would limit a user, everything can be overridden as it was before...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(talked outside here) the reason is that there is only one callback function for all of the integrations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sounds like this is resolved now, but let me know if you'd still like input on anything :)
closing the PR for now. |
Applicable spec: ISD175 - RabbitMQ support in paas-charm
Overview
Support RabbitMQ in paas-app-charmer.
There are two different charms that provider RabbitMQ, rabbitmq-server and rabbitmq-k8s. A new library has done, based on the one in rabbitmq-k8s,
paas_app_charmer.rabbitmq.RabbitMQRequires
that provides a common interface to both charms, and provides aRabbitMQParameters
model with the rabbitmq information. This is the same as the one in the charm state, as that library is just use in this project.A refactor has been done, moving most of the code related to integrations from
charm.py
,databases.py
andcharm_state.py
tocharm_integrations.py
. The integrations are managed now by the classpaas_app_charmer.charm_integrations.Integrations
, that is in charge of registering all integrations, checking if there are missing integrations and also in creating the IntegrationsState instance (part of the CharmState).Each one of the integrations are subclasses of Integration, so they all contain
register
andis_ready
methods, and are handled in a similar way. Each of these integrations can create its own part of the charm state for the integration (before this code was in charm_state.py). This code may require further improvements in future PRs.Rationale
Juju Events Changes
Module Changes
Library Changes
Checklist
src-docs
urgent
,trivial
,complex
)