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

echo 1.575.0

Choose a tag to compare

@emjburns emjburns released this 24 Oct 17:42
· 935 commits to master since this release
5db2c64
 refactor(core): Split pipeline matching and triggering logic (#369)

* refactor(core): Split pipeline matching and triggering logic

The EventMonitor classes are currently responsible for looking
up the pipelines from the cache, figuring out which ones should be
triggered by a given event, and actually initiating the resulting
pipelines. This leads so some reasonably complex inheritance
relationships that will only become more complex as we add more
artifact extraction logic to echo.

Factor out the logic to match events to pipelines into a separate
class hierarchy that is composed into the event monitor. The event
monitor is then responsible for looking up the pipelines and starting
the matching ones, but delegates responsiblity for actually determining
which pipelines match.

* refactor(core): Use generics in echo event handlers

There is a lot of casting in the echo event handlers, as they
all implement a common base class that only specifies the
event in question is a TriggerEvent. This change makes each
event handler parameterized by the type of event it's handling
so we can get type safety and avoid casting.

* refactor(core): Clean up code in event handlers

A number of minor changes:
* Removing final from parameters in a number of places
* Making function/member variable acces more restrictive
  where possible
* Rearranging the order of some functions/renaming for clarity

* fix(test): Remove explicit casting from test files

Now that the getMatchingPipelines functions accept a specific event
type, we no longer need to cast to the generic TriggerEvent as we
did before.

* style(core): Autowire ObjectMapper in event monitors

* style(core): Address pull request comments

* refactor(core): Push event type conversion to base class

Rather than duplicate the logic for converting events to the handler's
class, we can have each class tell the parent class what type to convert
to and let the conversion happen in the parent class.