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

Update generated proto code to latest protoc #165

Merged
merged 4 commits into from
Aug 11, 2020

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Jul 28, 2020

From what I can tell, this is required for binaries that use google.golang.org/protobuf. I think it means users of this package will have to use it 1.20.x+ or 1.4.x of github.com/golang/protobuf. Not sure if this constitutes a breaking change, let me know :)

Adds go_package to the proto file which is required in latest protoc versions. This means the package name changed to be the same as the folder name.

Fixes #164

@coveralls
Copy link

Coverage Status

Coverage remained the same at 60.568% when pulling 60a2d9e on anuraaga:proto-1.4.2 into ef1b344 on openzipkin:master.

@coveralls
Copy link

coveralls commented Jul 28, 2020

Coverage Status

Coverage remained the same at 60.568% when pulling 4478b86 on anuraaga:proto-1.4.2 into ef1b344 on openzipkin:master.

@@ -16,7 +16,7 @@
Package zipkin_proto3 adds support for the Zipkin protobuf definition to allow
Go applications to consume model.SpanModel from protobuf serialized data.
*/
package zipkin_proto3
package v2
Copy link
Contributor

@jcchavezs jcchavezs Jul 28, 2020

Choose a reason for hiding this comment

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

While package name is not too important outside the scope of this codebase I am curious about the reason for changing the name (I guess this is autogenerated and the name comes from the folder name). In any case we might need to change the description in line 16: https://github.com/openzipkin/zipkin-go/pull/165/files#diff-aed4b0e2183470649d6be446904a6842R16

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah now protoc requires a go_package in the proto file, and the code is automatically generated into the folder with the same package name so this changed. I updated the description, but let me know if there could be any other issues.

@jcchavezs
Copy link
Contributor

LGTM unless @basvanbeek has any objection.

@basvanbeek
Copy link
Member

@anuraaga I'm good with the change. @odeke-em do you see issues with the package rename as you are the one who added this logic?

@odeke-em
Copy link
Contributor

@anuraaga I'm good with the change. @odeke-em do you see issues with the package rename as you are the one who added this logic?

I'd instead just rename that directory from v2 to zipkin_proto3 instead of to v2, because v2 is going to cause a whole lot of confusion with Zipkin's protocol v2, yet this is Zipkin proto3. The package's real name is zipkin_proto3 anyways https://pkg.go.dev/github.com/openzipkin/zipkin-go@v0.2.2/proto/v2?tab=doc and even https://github.com/census-instrumentation/opencensus-service/blob/c54ee82d39581d32338d3bc1400ec371fd26ae96/receiver/zipkinreceiver/proto_parse_test.go#L24

@anuraaga
Copy link
Contributor Author

If I rename the folder, it will be a breaking change though won't it? For example, I don't think the linked census file will compile anymore. Is that worth it?

@odeke-em
Copy link
Contributor

odeke-em commented Jul 30, 2020 via email

@anuraaga
Copy link
Contributor Author

anuraaga commented Jul 30, 2020

I personally didn't find the current folder confusing - it's the proto for Zipkin API V2. If there were a future Zipkin API V3, adding a v3 folder would be very natural.

Proto3 is more an implementation detail of the compiler and not as interesting - can't say I've seen it used much in other package names. Zipkin probably also should have been named just zipkin.proto but it's too late to change that - I don't think the go package is required to match it though if there is something more idiomatic - in go I guess it's not common to repeat the repo name in a package name.

But I just noticed zipkin-go isn't 1.x yet so a folder rename would be totally fine too. Let's get a bit more input on what seems easiest to manage.

@basvanbeek
Copy link
Member

@anuraaga I'm on board with @odeke-em's reasoning. Please change package path to zipkin_proto3 to avoid confusion.

This package is mostly consumed by packages under his control so we can expect minimal disruption.

@@ -14,12 +14,16 @@

syntax = "proto3";

// This is the package for using protobuf with Zipkin API V2, but for historical
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok renamed the package but please let me have my social commentary here (don't mean to be snarky but I'm confident in a deep understanding of protobuf, much more than I may wish actually :P)

Copy link
Member

Choose a reason for hiding this comment

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

freedom of expression allowed :)

@basvanbeek
Copy link
Member

@anuraaga merge at your convenience

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.

Update proto generated files to github.com/golang/protobuf v1.4.2 or newer
6 participants