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

Delete versions from generated code #127

Merged
merged 1 commit into from
Mar 5, 2022
Merged

Conversation

bufdev
Copy link
Member

@bufdev bufdev commented Mar 5, 2022

I think this was just doing what protoc-gen-go-grpc was doing (?). This deletes the versions from the generated code and capitalizes "Source":

-// versions:
-// - protoc-gen-connect-go v0.0.1
-// - protoc              (unknown)
-// source: connect/ping/v1test/ping.proto
+//
+// Source: connect/ping/v1test/ping.proto

Having these in the generated code is a constant source of frustration for people, it means that every time you do an upgrade of connect, you get a huge diff, and in theory for no reason - we only really care about whether the file is compatible or not, which we get through the compile-time assertion with IsAtLeast*. There's an argument to keep the protoc-gen-connect-go version, as this could be useful information for debugging, especially if using i.e. BSR remote generation, but the protoc version definitely should go IMO - you shouldn't have to care what version of protoc you are using outside of using the builtin plugins (java, cpp, etc). Even more to the point, buf stopped emitting a protoc version, so this will always be (unknown) with buf.

If we do want to keep the protoc-gen-connect-go version, I'd argue to do it in the form that Twirp does, inlining it in the Code generated by line https://github.com/twitchtv/twirp/blob/main/example/service.twirp.go#L1

@bufdev bufdev requested a review from akshayjshah March 5, 2022 16:41
Copy link
Member

@akshayjshah akshayjshah left a comment

Choose a reason for hiding this comment

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

Yep, I just did what the grpc-go plug-in did. Happy to do something better.

@bufdev
Copy link
Member Author

bufdev commented Mar 5, 2022

I say we try this out for a bit, but we might want to re-add the protoc-gen-connect-go version before release, re: my debate above - I can see an argument for that, but it might just be because we're so used to it that it's hard to give it up.

@bufdev bufdev merged commit 7f5426c into main Mar 5, 2022
@bufdev bufdev deleted the delete-generated-versions branch March 5, 2022 16:46
@akshayjshah
Copy link
Member

akshayjshah commented Mar 5, 2022 via email

akshayjshah pushed a commit that referenced this pull request Jul 26, 2023
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.

2 participants