-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ext_proc: revise service api for attributes #32176
ext_proc: revise service api for attributes #32176
Conversation
Signed-off-by: Jacob Bohanon <[email protected]>
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
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.
Thanks for you contribution. I taken a look to the dicussion and you previous PR. (But it's a little complex so I am not sure I get it correctly, feel free to point it out if I am wrong.)
I think if you want to revert (or partly revert)previous implementation, you should add the [#not-implemented-hide:]
back to the request_attributes
and response_attributes
because you may want to change the behavior in the implementation.
Actually, if we haven't figured out a final solution or API, we should just revert previous two implementation commits directly. It would be more clean. cc @htuch
@wbpcode I dont think we need to revert any changes from previous PRs. If we agree on just moving the attributes outside the HttpHeaders message, then this API change becomes much simpler and the implementation should require only minor changes (populate ProcessingRequest.attributes instead of ProcessingRequest.request|response_headers.attributes) on top of the code in #31090. |
@@ -110,8 +110,19 @@ message ProcessingRequest { | |||
HttpTrailers response_trailers = 7; | |||
} | |||
|
|||
// [#not-implemented-hide:] | |||
// TODO(jbohanon) reserve field as part of rework detailed in https://github.com/envoyproxy/envoy/issues/32125 |
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.
@htuch , per discussion in the issue thread, shall we just keep this field as it is, maintaining a clear separation between attributes derived from the connection/request/resp vs those pushed through config or internal state?
Yeah. But the premise is we can agree on with all the API changes (attributes and metadata context) and complete the code and test updates in the windows. (Today may the last day?) And from my perspective, this PR seems more like a partly reverting rather than refactoring, for now. Considering the time windows, I still suggest you revert the previous commits and we can merge the reverting directly. Then you can create a new PR for these features immediately. Or we must act very quickly. |
/assign @htuch |
Another solution is defer the Then this PR could only update the attributes implementation (like the @rshriram 's suggestion) and API which would LGTM to me. |
Signed-off-by: Jacob Bohanon <[email protected]>
I have updated this to be more tightly-scoped to the attributes fields. I agree that reverting the committed code is not necessary. The discussion around the field |
Signed-off-by: Jacob Bohanon <[email protected]>
/retest |
@jbohanon LGTM to the API, and please update the implementation. Here is the timeline: 2024/01/24: merged the feature of the Now, if you want to move the |
Sounds good. For my education, where is the two-week contract specified? |
…ath, not just with headers messages Signed-off-by: Jacob Bohanon <[email protected]>
Possible implementation put up here: jbohanon#1 I can pull those changes into this PR if desired, but I still need to work on the tests |
https://github.com/envoyproxy/envoy/blob/main/api%2FAPI_VERSIONING.md From this API guiding, we can only do a break change to exist API in two weeks after it is merged or it's marked as WIP. Now you want to abort the |
I also noticed that the |
Signed-off-by: Jacob Bohanon <[email protected]>
Signed-off-by: Jacob Bohanon <[email protected]>
@wbpcode that is precisely the reason we are doing this change now and trying to remove the HttpHeaders.attributes because that field was never implemented till now. So we have the ability to make this breaking change. |
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
Thank you so much for acting quickly.
Signed-off-by: Jacob Bohanon <[email protected]>
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. To be clear, the headers attributes
field was never marked not [#not-implemented-hide:]
(it's unchanged on line 206 above). So, from a stable API perspective it was never a stable field :)
Thanks @htuch. I am working through the integration test updates now and will ping again once everything is green on CI. There was an outstanding question on jbohanon#1 re: simply reserving this field that was never marked as stable/implemented. What do you think of that? |
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 to the code. Could you check the integration tests? Seems that the error may is related to this PR.
Signed-off-by: Jacob Bohanon <[email protected]>
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. Thanks.
@jbohanon one question. Our API says request_attributes and response_attributes. What about the connection.* attributes documented here (https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes) ? Does the code reject those? |
Put another way, should we just have a generic attributes repeated field in ext_proc filter instead of request and response attributes that does not seem to add any real value, as the wire proto has all attributes in one bag. |
@rshriram the qualifier in front of |
so if I set BOTH request_attributes and response attributes in ext_proc filter to the following, what happens during request headers/body events and response headers/body events? Can I assume that there will be exactly ONe copy of request.host, source.address in ProcessingRequest.attributes for request headers/body calls and exactly ONE copy of request.host, source.address, response.code in ProcessingRequest.attributes for response headers/body calls? |
Signed-off-by: Jacob Bohanon <[email protected]>
Correct, given: ExternalProcessor:
request_attributes:
- request.host
- source.address
- response.code
response_attributes:
- request.host
- source.address
- response.code There will be exactly ONE copy of I added a test to validate that the unavailable attribute is not included. |
--------- Signed-off-by: Jacob Bohanon <[email protected]>
--------- Signed-off-by: Jacob Bohanon <[email protected]>
* ext_proc: send attributes (envoyproxy#31090) Introduce the ability to send attributes in the External Processing Request --------- Signed-off-by: Jacob Bohanon <[email protected]> * ext_proc: send and receive dynamic metadata (envoyproxy#30747) Introduce the ability to send dynamic metadata in the External Processing Request. Also implements the API for returning dynamic metadata as part of the External Processing Response. --------- Signed-off-by: Jacob Bohanon <[email protected]> * ext_proc: revise service api for attributes (envoyproxy#32176) --------- Signed-off-by: Jacob Bohanon <[email protected]> --------- Signed-off-by: Jacob Bohanon <[email protected]>
Commit Message: Revise service API to reflect changes discussed in #32125
Additional Description:
Risk Level: Low - feature merged very recently and has not been released
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]