-
Notifications
You must be signed in to change notification settings - Fork 846
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
atc: structure: support pluggable build event processing
The motivation for this change is to decouple build events from the database layer. This can allow us to add different storage options for build events (e.g. Elasticsearch), which was brought up in #5306. This commit adds `EventProcessor`. The reason for the generic name (as opposed to something like `EventStore`) is that I envision this interface being implemented by things that go beyond just a Store. For instance, the initial motivation for this was to explore server-side interpretation of the ANSI control sequences in log events. Another possible use case for `EventProcessors` is secret redaction - which I'll look into refactoring in subsequent commits. Multiple `EventProcessors` can be chained together to form a data transformation pipeline, where the terminal processor (should) store the events somewhere. In addition to processing events, the `EventProcessor` has the `Initialize(Build)` and `Finalize(Build)` methods. For the DB store, this is creating and deleting a sequence for event ids (respectively). Since we initialize builds right when they're created, this commit also introduces a `BuildCreator` interface, the implementation of which delegates the `Initialize` call to the `EventProcessor`. This is so higher-level packages (e.g. API) don't need to be aware of `EventProcessors`, which feels like a lower-level detail. P.S. a lot of tests are broken after this commit - I'm saving most of the test fixes for a subsequent commit so it's easier to skim through. Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io>
- Loading branch information
1 parent
3416c90
commit 1d3172d
Showing
36 changed files
with
1,825 additions
and
1,342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.