GregSutcliffe / maubot-meetings

A Maubot plugin for running meetings in Matrix
Other
9 stars 5 forks source link

Extend to send a fedora message #1

Closed ryanlerch closed 1 year ago

ryanlerch commented 1 year ago

Not sure how feasible this is to implement a plugin to a plugin, but the current fedora IRC meetbot sends a message to the Fedora Messaging bus for certain actions. (meeting start, end, actionitems, etc)

This was implemented in meetbot directly in our forked version (since meetbot was basically not under maintenance )

https://github.com/fedora-infra/supybot-meetbot/blob/develop/supybot_meetbot/meeting.py

However, it would be nice to be able to send these messages from the maubot-meetings plugin somehow if we can.

GregSutcliffe commented 1 year ago

I think we can pretty much copy that exact code from Supybot:

We can make fedora_messaging an option Pip dependency, and only load it if the config key is set. I think that should work?

GregSutcliffe commented 1 year ago

I like this approach, because it means we can implement multiple backends for storage, etc. While your deployment of this plugin would want to format and push the logs to https://meetbot.fedoraproject.org/, I would like to start pushing things like this to the Ansible forum. So we need configurable backends anyway.

GregSutcliffe commented 1 year ago

Took a shot at this today, I think I have the bare-bones of something working. @ryanlerch take a look at this diff in the backends branch.

It definres a fedora.py and ansible.py and allows you to pick which in the plugin config file. You can see both define log_msg which is then called from the main bot in (start|end)meeting.

My Python is ... not the best, so this might be a terrible way of going about this, but it seems to work. Here's a log snippet from my dev setup:

[2023-08-14 10:50:14,505] [INFO@maubot.instance.meetbot] Ansible: Starting
<snip matrix logs>
[2023-08-14 10:50:32,130] [INFO@maubot.instance.meetbot] Ansible: Ending

So long as the backend plugins all define the same messages, and we take care to factor common stuff up to the main plugin, I think this will do for now?

ryanlerch commented 1 year ago

going to close this one -- can do fedora messages with the backends system (its not done yet, but its possible)