Skip to content
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

api: rename connection pool proto messages #13378

Merged
merged 3 commits into from
Oct 7, 2020

Conversation

spenceral
Copy link
Contributor

The java_outer_classname must not collide with a type defined within a proto
file in order to compile protos to Java. Additionally, this commit
introduces a format check to prevent this from happening again.

Signed-off-by: Spencer Lewis [email protected]

Risk Level: low
Testing: none
Docs Changes:none
Release Notes: none
Fixes #13368

The java_outer_classname must not collide with a type defined within a proto
file in order to compile protos to Java. Additionally, this commit
introduces a format check to prevent this from happening again.

Signed-off-by: Spencer Lewis <[email protected]>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #13378 was opened by spenceral.

see: more, trace.

@@ -14,5 +14,5 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// A connection pool which forwards downstream HTTP as TCP or HTTP to upstream,
// based on CONNECT configuration.
// [#extension: envoy.upstreams.http.generic]
message GenericConnectionPoolProto {
message GenericConnectionPool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking API change, see https://github.com/envoyproxy/envoy/blob/master/api/API_VERSIONING.md#backwards-compatibility. Can you change the Java outer classname?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no. Yeah I'll do that instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spenceral you'll run into the issue that these are auto-generated by the protoformat tool based on the filename. You'll need to maybe update that with a special case.

# This is a workaround for Java outer class names that would otherwise
# conflict with types defined within the same proto file, see
# https://github.com/envoyproxy/envoy/pull/13378.
options.java_outer_classname += "OuterClass"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose OuterClass because I think it is how protoc handles this case if you don't set the java_outer_classname option https://developers.google.com/protocol-buffers/docs/reference/java-generated

With this protoprint change, we don't actually need the check_format error. WDYT @htuch ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree, the check format isn't needed. I kind of don't like the special case, but my working assumption is if we change every Java outer classname, this will force a lot of churn in folks who are consuming the APIs. Does that sound right? If so, I think this is the best we can do for now. Maybe leave a comment saying "TODO: In next major version, make this consistent.".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that sound right?

That's my understanding as well. All import statements and/or fully qualified class names would need to updated. I'll leave the comment.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@repokitteh-read-only repokitteh-read-only bot removed the api label Oct 7, 2020
@htuch htuch merged commit 03f46bb into envoyproxy:master Oct 7, 2020
@spenceral spenceral deleted the conn-pool-protos branch October 7, 2020 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error compiling api/envoy/extensions/upstreams/http/generic/v3/generic_connection_pool.proto to Java
2 participants