-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add metadata exchange to trigger and handler #15043
base: develop
Are you sure you want to change the base?
Conversation
f2abb56
to
5117aae
Compare
5117aae
to
e966e1e
Compare
e966e1e
to
b9cdec8
Compare
// TODO: Should we return here instead? | ||
payloadJSON, _ = json.Marshal(ghcapabilities.TriggerResponsePayload{Status: "ERROR", ErrorMessage: fmt.Sprintf("error %s marshalling payload", err.Error())}) |
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.
I think we can log the error
} | ||
err = h.connector.SignAndSendToGateway(ctx, gatewayIDStr, &body) | ||
if err != nil { | ||
h.lggr.Errorw("error sending message", "gateway", gatewayIDStr, "err", err) |
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 return errors.Wrap(err, "error sending message") here and it will get logged in loop()
count uint | ||
} | ||
|
||
func (h *handler) updateTriggerConsensus() { |
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 like this function is not called in this PR. how do we determine when we should trigger consensus?
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.
Good question. I forgot to put a TODO that once i have a timer with tests working (from the trigger), the handler needs to do something similar. I've updated the PR description.
@@ -38,6 +43,7 @@ type webapiTrigger struct { | |||
ch chan<- capabilities.TriggerResponse | |||
config webapicap.TriggerConfig | |||
rateLimiter *common.RateLimiter | |||
rawConfig *values.Map |
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.
what data is in this rawConfig
?
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.
It's the config that is in the triggers config, ie allowedSenders, allowedTopics, RateLimiter.. I wanted to make the metadata exchange "future-proof" so that changes to the config don't require rewriting the exchange logic.
Metadata exchange from handlers to gateways.
TODOs before merge: