-
Notifications
You must be signed in to change notification settings - Fork 420
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
TEP-0022: Switch to immutable input event bodies #828
Conversation
71fba76
to
42173f5
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Looks good to me. |
The following is the coverage report on the affected files.
|
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.
Overall looking good!
if interceptorInterface, ok := interceptor.(triggersv1.InterceptorInterface); ok { | ||
// Set per interceptor config params to the request | ||
request.InterceptorParams = interceptors.GetInterceptorParams(i) | ||
interceptorResponse = interceptorInterface.Process(context.Background(), &request) |
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.
We should add the context as a parameter so that we can accurately pass through timeouts and tracing information (if any).
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.
ack. the only reason I did not do it here was because there was no existing context to plumb through. Was planning on adding it a follow up PR where we move the interceptors to run in a separate HTTP service. What do you think?
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.
sgtm
The following is the coverage report on the affected files.
|
This commit adds two new types for InterceptorRequest and InterceptorResponse. Instead of just forwarding the incoming request, EventListeners will use these types to send requests to interceptors. This commit introduces an `extensions` field where Interceptors can add additional data that is available to TriggerBindings. This replaces the previous mechanism where Interceptors could freely modify the input bodies. With this change, the input bodies are immutable, and any extra fields added by Interceptors can only be done within the `extensions` field. This commit simply adds the new interface types and plumbing. Future commits will change the Interceptors to adopt the new Interface. Part of tektoncd#271 and tektoncd#778 Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
The following is the coverage report on the affected files.
|
e96bacd
to
daacebf
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
This commit updates the CEL interceptor to use the new interface that supports immutable input event bodies. This represents a BREAKING CHANGE for users using `overlays`. Overlays will no longer modify the request body. Instead `keys` from overlays will be added to a new top-level `extensions` field that is accessible to TriggerBindings. Part of tektoncd#271 Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
The following is the coverage report on the affected files.
|
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wlynch The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
There are two commits in this PR:
This commit adds two new types for InterceptorRequest and
InterceptorResponse. Instead of just forwarding the incoming request,
EventListeners will use these types to send requests to interceptors.
This commit introduces an
extensions
field where Interceptors can addadditional data that is available to TriggerBindings. This replaces the
previous mechanism where Interceptors could freely modify the input
bodies. With this change, the input bodies are immutable, and any extra
fields added by Interceptors can only be done within the
extensions
field.
This commit simply adds the new interface types and plumbing. Future
commits will change the Interceptors to adopt the new Interface.
This commit updates the CEL interceptor to use the new interface that supports
immutable input event bodies. This represents a BREAKING CHANGE for users using
overlays
. Overlays will no longer modify the request body. Insteadkeys
from overlays will be added to a new top-level
extensions
field that isaccessible to TriggerBindings.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Release Notes