api/config: use resource type annotations to provide type-to-endpoint.#9566
Merged
htuch merged 7 commits intoenvoyproxy:masterfrom Jan 6, 2020
Merged
api/config: use resource type annotations to provide type-to-endpoint.#9566htuch merged 7 commits intoenvoyproxy:masterfrom
htuch merged 7 commits intoenvoyproxy:masterfrom
Conversation
Previously, type_to_endpoint.cc had a lot of hardcoding, which doesn't scale well with multiple API versions. See envoyproxy#9526 for an example of the issues encountered. This patch switches to using explicit resource type annotations on service descriptors, which is great for documentation (previously this was sometimes given in comments, sometimes not), and allows for a reflection driven reverse map from resource type URL to endpoints to be built at runtime. Risk level: Low Testing: New unit tests for type_to_endpoint.cc and golden protoxform tests for the new annotations. Fixes envoyproxy#9454. Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
mattklein123
reviewed
Jan 6, 2020
Member
mattklein123
left a comment
There was a problem hiding this comment.
This is really fantastic, thanks. A few comments. Also, can we open a doc issue for 1.14 to use these annotations in doc output instead of all the manual insertions we have everywhere now?
/wait-any
Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
Member
Author
|
@mattklein123 #3091 tracks the service method doc generation, I left a comment to make use of the resource type annotations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, type_to_endpoint.cc had a lot of hardcoding, which doesn't scale well with multiple API
versions. See #9526 for an example of the issues
encountered.
This patch switches to using explicit resource type annotations on service descriptors, which is
great for documentation (previously this was sometimes given in comments, sometimes not), and allows
for a reflection driven reverse map from resource type URL to endpoints to be built at runtime.
Risk level: Low
Testing: New unit tests for type_to_endpoint.cc and golden protoxform tests for the new annotations.
Fixes #9454.
Signed-off-by: Harvey Tuch htuch@google.com