Files
backstage/plugins/events-backend-module-gerrit/README.md
T
Patrick Jungermann 25f6d7bddb feat(events/gerrit): add GerritEventRouter
Add an event router for Gerrit
which handles events from the topic `gerrit`
and re-publishes events under their more specific topic
based on the `$.type` payload field
like e.g., `gerrit.change-merged`.

Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-11-12 01:38:34 +01:00

1.1 KiB

events-backend-module-gerrit

Welcome to the events-backend-module-gerrit backend plugin!

This plugin is a module for the events-backend backend plugin and extends it with an GerritEventRouter.

The event router will subscribe to the topic gerrit and route the events to more concrete topics based on the value of the provided $.type payload field.

Examples:

$.type topic
change-created gerrit.change-created
change-merged gerrit.change-merged

Please find all possible webhook event types at the official documentation.

Installation

Install the events-backend plugin.

Install this module:

# From your Backstage root directory
yarn add --cwd packages/backend @backstage/plugin-events-backend-module-gerrit

Add the event router to the EventsBackend:

+const gerritEventRouter = new GerritEventRouter();

 EventsBackend
+  .addPublishers(gerritEventRouter)
+  .addSubscribers(gerritEventRouter);
// [...]