Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

echo 1.601.0

Choose a tag to compare

@ezimanyi ezimanyi released this 18 Apr 19:19
· 815 commits to master since this release
5d16e86
refactor(pubsub): Encapsulate logic for creating events (#523)

* feat(pubsub): Send pubsub events through eventPropagator

Currently all pubsub events are sent directly to the trigger
event listener, rather than to the general eventPropagator (which
notifies all event listeners). This means that pubsub events can
never do anything other than start pipelines. (Other incoming
events, such as webhooks or build notifications are sent to the
general eventPropagator.)

In order to allow pubsub messages to do other things than start
pipelines, send the resulting event to the eventPropagator so
that other listeners can act on these events.

* refactor(pubsub): Encapsulate logic for creating events

The logic for extracting artifacts from pubsub events and for creating
events from the message is embedded in the logic for handling these
messages. In order to allow more general events to be created from
pubsub messages, create an interface EventCreator that handles
creating an event from a pubsub MessageDescription.

The initial implementation of EventCreator will extract artifacts and
create exactly the same event as prior to this change, allowing us
to remove the code from the pubsub subscribers and handler.

When setting up a subscription it is now possible to pass in a custom
EventCreator so that messages read from that subscription create
arbitrary event types.