Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype Review Pull Request #1

Closed
wants to merge 270 commits into from
Closed

Prototype Review Pull Request #1

wants to merge 270 commits into from

Conversation

ottomata
Copy link
Contributor

The work is mostly already in master, and was reviewed and designed at ottomata/eventbus#1. This PR can be used to review all of the code for this new library and service.

…est.yaml

This allows us to fully mock the Eventbus instance used when testing,
while still piping events through the same functions used
for prod by creating them in eventbus-init-utils.js
to be compatible with node 6
This makes configuration of Eventbus for the route cleaner.  Instead
of the app.conf.eventbus_init_module exporting both an Eventbus instance
and a createEventError function, it only needs to export the Eventbus instance.
createEventError is given to the Eventbus constructor, and Eventbus
handles event error processing.
- schema_field -> schema_uri_field
- config file cleanup
- allow protocol less uris, assume these are local file paths
Ajv already caches its compiled validators (and schemas) by
$id. This makes it really handy to look up event schemas if
their schema URIs match the schema's $id property.

$refs get a little tricky, but I think I got it.  Unfortunetly,
in order to properly resolve, we need to make event schema $schema
URIs start with /, other wise $ref that point at schemas will not
be correct.
objectGet just wraps _.get, but throws PropertyNotFoundError
if undefined.

Also fix test logging to make it easier to enable logging
output during tests.
TODO: update README docs about this
Also throw EventSchemaLoadError when schema fails loading from uri
ottomata and others added 28 commits December 11, 2019 16:27
This is needed in case any validate or produce functions
use the context, since they will be used for
error events as well.

Change-Id: Ibe633b59317e99a5dd2ba5586c22dbcd877b59ef
This allows callers to pass e.g. custom HTTP headers
when using urlGet function(s) to load URLs.

Change-Id: Ib31713c8da1adf119393301837a27bfec23f2f1d
This will allow for custom EventGate implementations
(like eventgate-wikimedia) to register extra routes
with the eventgate service.

eventgate-wikimedia will use this to expose runtime stream
configs.

Bug: T253157
Change-Id: I72b21df3696e5fa09bf5e9597037c80af79ce6d6
Change-Id: Id35ef1a18d476bf276de7ac9db8ba18a28d31c75
Pass router into eventgate factory function
Release EventGate 1.1.1

Change-Id: I4e502f3d9bd4559ab6d2e0293bf05595d341beae
This allows our default config files to work even if eventgate is launched
from outside of the current directory.
If `test_events` is configured, a `GET /v1/events-test` route will be added.
When requested, the `test_events` will be produced as if they were POSTed to
/v1/events. This is useful for readiness probes that want to make sure the
service can produce events end to end.

Bug: T251935
More clearly indicates that this is a route for internal use.
Add a configurable /v1/events-test route
… being set once

Downstream processors of events might mutate those events if they are filling
in default values. Usually this is fine since normal events are discarded after
they are processed.  But we were holding a reference to test_events, and when
they were mutated, the next call to /v1/_test/events was passing in the mutated
events from the previous call.
This is needed for compatibility with Chrome's Network Error Logging
reporter code: https://bit.ly/2YWcf6f
Per the Reporting API W3C technical recommendation, this is the
content-type used by browsers to POST reporting events.
https://www.w3.org/TR/reporting/#media-type
Make EventGate compatible with receiving Network Error Logging reports from Chrome
Add comment in app.js about cors modification for network error logging.
Producing to Kafka is just one way to use EventGate.
It's nice to have it as the default, except that building the
librdkafka binary is not very lightway, nor does it always work so
smoothly on all OS-es (e.g. MacOS). By making node-rdkafka an
optional dependency (and guarding against it being missing),
we should be able to more easily create development eventgate
instances without needing to build librdkafka.

Bug: T266058
@ottomata ottomata closed this in 6cdc985 Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants