#11734 Need room added to Fedora space and Fedora bot account to send messages to room
Closed: Fixed a month ago by jlebon. Opened 5 months ago by jlebon.

Describe what you would like us to do:


My high-level goal is to have one of our Jenkins instance (running in the Fedora OpenShift instance) send build failure notifications to a room in Matrix.

I'd like that room to be part of the Fedora space. Does the room need to be created directly in there, or is the SOP to create a room in e.g. fedora.im and add an alias? If the latter, I've created #jenkins-coreos:fedora.im already which can be aliased. If the former, I'm happy to nuke that room.

I think also IIUC since Matrix auth on fedoraproject.org is backed by Fedora accounts, we need a bot account created?

When do you need this to be done by? (YYYY/MM/DD)


Not urgent, but ideally in the next month or so?


Metadata Update from @phsmoura:
- Issue priority set to: Waiting on Assignee (was: Needs Review)
- Issue tagged with: low-gain, low-trouble, ops

5 months ago

we also do have a maubot instance that we could (in theory) use to get the notifications to your channel.

we have 3 bots running on maubot -- zodbot, meetbot, and nonbot -- nonbot is the one that we could setup to do this. (it is the one that does this kind of notification stuff.)

if jenkins can send webhooks, it should be somewhat trivial to get the build failure notifications coming through to your channel via nonbot.

we also do have a maubot instance that we could (in theory) use to get the notifications to your channel.

we have 3 bots running on maubot -- zodbot, meetbot, and nonbot -- nonbot is the one that we could setup to do this. (it is the one that does this kind of notification stuff.)

if jenkins can send webhooks, it should be somewhat trivial to get the build failure notifications coming through to your channel via nonbot.

Sounds like a path forward. Do you have a link to what the API looks like there?

Though I guess we do still also need a room created.

Yeah, typically we create 'official' fedoraproject.org rooms and then add a fedora.im alias to them.

We can reprupose your existing room though if you want. I have joined my admin account there ( @kevin:fedoraproject.org ). Can you make it an admin? Then I can add a fedoraproject.org address and set it default. ;)

Actually, nevermind. I can use the admin api to do it. ;)

Cool, I see it now as #jenkins-coreos:fedoraproject.org! Awesome, thanks!

I'm not sure if I'm not doing Matrix properly (I'm using the default Element web UI on chat.fp.o), though I did notice that the channel doesn't show up if I'm in the Fedora space. I have to go to the Home space to see it. Also noticed that the room doesn't show when browsing public rooms in the Fedora space, which I suspect is related the first issue. Anyway, not a big deal, but wondering if there's some other setting that needs to be flipped to make it belong in the Fedora space proper.

I did not add it to the space yet.

Where do you expect it to be? under project teams? or 'bot chatter' ?

I did not add it to the space yet.

Where do you expect it to be? under project teams? or 'bot chatter' ?

Bot Chatter sounds appropriate. :thumbsup:

we also do have a maubot instance that we could (in theory) use to get the notifications to your channel.

we have 3 bots running on maubot -- zodbot, meetbot, and nonbot -- nonbot is the one that we could setup to do this. (it is the one that does this kind of notification stuff.)

if jenkins can send webhooks, it should be somewhat trivial to get the build failure notifications coming through to your channel via nonbot.

Sounds like a path forward. Do you have a link to what the API looks like there?

OK, digging around I found https://github.com/fedora-infra/maubot-webhook, which is probably what you're talking about here. Though I'm not finding the config file for nonbot in Fedora to see what that looks like (a grep for nonbot in the ansible repo actually just has a single hit: https://pagure.io/fedora-infra/ansible/blob/baf1e002511a8474a76e5f5a62a6635c19af0a02/f/roles/nagios_server/templates/nagios/scripts/matrix-notify.sh.j2#L4). Is all that stuff purely app data that's not part of the ansible repo?

Based on the README, it sounds like this would require setting up another instance of the plugin with the room setting pointing to our new room?

ok, added to the space. I will let @ryanlerch answer the maubot questions.

Yeah, i would just need to set up the plugin for you, on the maubot instance, and you will just need to configure jenkins to fire webhook POSTS at that endpoint.

https://github.com/fedora-infra/maubot-webhook?tab=readme-ov-file#example

Yes, let's do that. Feel free to make up a token for us (and email it to me -- GPG key). The room is #jenkins-coreos:fedoraproject.org. For the message, I don't think we need any fancy templating, so just e.g. {{ json.body }}?

@ryanlerch Any update on this? Hoping to tie this off soon.

I've set up the bot and sent you the auth token.
Let me know if you need anything else (or if you didn't receive the email, my gpg skills are a bit rusty)

This is working well. Thanks all for the help!

Metadata Update from @jlebon:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

a month ago

Log in to comment on this ticket.

Metadata
Boards 1
ops Status: Backlog