-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: Actual providers implementation #1011
Conversation
c0c779b
to
f7173c0
Compare
This works in a basic sense, but I still need to implement the HTTP provider and add configuration options support (which will be read from the DB) |
0478927
to
c90a352
Compare
Added basic configurations from the database already. This is ready for feedback @evankanderson @jhrozek @rdimitrov |
eff756e
to
263f087
Compare
3571999
to
e60f070
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we expect that mediator will continue to fetch updates via a webhook? In that sense would it be useful if we update the current webhook handler to be more provider agnostic by adding to the provider interface methods for populating the initial event message (something similar to what we do when we build the entity wrapper?) but also have a method for processing a web hook event. Anyway, the PR is big enough so I'll approve to not block it 👍
func (h *REST) Do(ctx context.Context, req *http.Request) (*http.Response, error) { | ||
req = req.WithContext(ctx) | ||
|
||
return h.cli.Do(req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we close it too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing should happen at the caller's side (the ingester)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, two questions inline
Yes, however, I think we'll end up having provider-specific webhook implementations. I'd like it if we could figure out a more flexible way of handling this, but it'll have to wait for later. |
e60f070
to
cb0b07e
Compare
This defines the provider implementations in such a way that we can instantiate them and check if a rule type is able to accomodate for those. This is done through a new `ProviderBuidler` implementation which is in charge of instantiating the provider type that's needed at a given time. Note that we still use the GitHub provider for HTTP calls since it has a lot of handy features (such as rate limiting handling) that we could leverage.
cb0b07e
to
a02a354
Compare
@jhrozek fixed a merge conflict and resolved your suggestions. |
This defines the provider implementations in such a way that we can instantiate them and check if a rule type is able to accomodate for those.
This is done through a new
ProviderBuidler
implementation which is in charge of instantiating the provider type that's needed at a given time.Note that we still use the GitHub provider for HTTP calls since it has a lot of handy features (such as rate limiting handling) that we could leverage.
Note that on the way, this removes the GitHub graphql client implementation since it's unused. We may recover it from history if/when needed.
Related-to: #723
Closes: #543