With the transition of the applications from Fedmsg to Fedora Messaging inching towards completion, today we want to introduce a new service, Webhook To Fedora Messaging. Webhook To Fedora Messaging has been researched and developed by the Fedora Infrastructure team members with the company of an Outreachy mentee over the last quarter to communicate with services using webhooks.
Webhook To Fedora Messaging takes webhook events from services and translates them into semantic messages to be sent over on the Fedora Messaging bus, to which every Fedora Project application can listen and act for automation. Currently, the project supports services like GitHub but going forward we plan on implementing support for services like Discourse, GitLab, Forgejo etc.
As this service was designed to be the successor to the existing Github2Fedmsg service, we are also announcing that the service is now deprecated and users are encouraged to migrate to the newer service. If you are an existing user of the Github2Fedmsg service, please open a private ticket in the fedora-infra/w2fm-registration repository using the template named “Github2Fedmsg Migration Request”.
Additionally, as GitHub allows for managing webhooks at an organizational level, users migrating from the GitHub2Fedmsg service can explore the functionality by visiting the page https://github.com/organizations//settings/hooks. Once the changes have been made by the owner of the GitHub organization, the activities from all repositories can be conveniently relayed on the Fedora Messaging bus.
Will the new service be self-service (i.e. I don’t need to open a ticket somewhere) at some point in the future?
It can be done without opening a ticket right now, but there isn’t much of a UI to do so, and not much documentation either.
Since github2fedmsg was the last app that had to run on RHEL7, we prioritized getting the core features working asap. But we’d be happy to guide someone around the codebase and review PRs if they’re interested in writing a UI! It’s a pretty simple app, so it shouldn’t take too long
Well, I suppose you’d have to run the webserver that receives the webhook too, no?
Yeah, I think it’s something that could be added to FMN if we want user-centric webhooks, or it could be a separate project (running for example in communishift) if we want a more generic filtering.
I can see it in 3 parts:
a UI where people define what topics / affected users / agents / packages etc they want to notify on, and where they want the webhook to be sent
a database to store that
a Fedora Messaging listener that would subscribe to all messages, check if the incoming message matches a filter in the DB, and make the HTTP request itself.
There could be many listeners running at the same time (in separate openshift pods) to share the load of incoming messages, and also depending on how long we want to set the timeout on those HTTP requests.
From here it doesn’t look like a very complex app to write, and I’d be happy to help somebody in the community scratch their itch (if needed)