How to watch for CentOS Stream activity on Fedora Message Bus

Wednesday, 5, June 2024 bookwar ci, SIG No Comments

As you probably know, CentOS Stream development is happening in the open on Gitlab.com. You can see changes happening in real time in the redhat/centos-stream/rpms namespace. You can check open merge request, create yours and provide feedback.

Yet, due to the limitations of the Gitlab platform, we have not been able to provide an unauthenticated access to the feed of CentOS Stream events.

We are now solving it by publishing all Gitlab events to the Fedora Message Bus.

How to read messages

Let's start with the interesting part first.

Install the fedora-messaging package:

$ sudo dnf install fedora-messaging

Create a local copy of the configuration file:

$ cp /etc/fedora-messaging/fedora.toml ./centos-integration-messaging.toml

Change the routing_keys variable in the configuration file to subscribe to the topic org.centos.sig.integration:

routing_keys = ["org.centos.sig.integration.#"]

Run the client:

$ fedora-messaging --conf ./centos-integration-messaging.toml consume

The client will now listen to the topic on the message bus and will print all messages to the standard output.

Of course you can do much more than just printing. For example, you can trigger a Jenkins job with the help of the AMQP Build Trigger, or you can develop your own application.

Please check the Fedora Messaging documentation for more details.

By the way, events from the CentOS Stream build system are also available on the Fedora Message Bus under the topic org.centos.prod.buildsys.

How does it work

There is a stateless application deployed to the CentOS SIGs Openshift cluster. A webhook on GitLab sends an event to the endpoint of the application, and it then translates the event into a message on the Fedora Message Bus.

The sources are available in the gitlab-webhooks repository. And contributions are of course welcome.

The service is maintained by the community under the umbrella of the CentOS Integration SIG.

What's next

We hope that the service will be useful for everyone who wants to build automation on top of the CentOS Stream.

When you build such an automation - please let us know and consider joining the CentOS Integration SIG.

We might be changing the messaging schema in the future to adopt a more strict message validation, and we would want to know your requirements.

We also may expand the coverage and add events for other namespaces, such as, for example, events from CentOS SIG repositories.

Leave a Reply

Your email address will not be published. Required fields are marked *