Replace gogo protobuf with google's protobuf v2 compiler#317
Merged
tdeebswihart merged 30 commits intotemporalio:masterfrom Nov 21, 2023
Merged
Replace gogo protobuf with google's protobuf v2 compiler#317tdeebswihart merged 30 commits intotemporalio:masterfrom
tdeebswihart merged 30 commits intotemporalio:masterfrom
Conversation
While the performance won't be as nice and it won't generate helper methods for use it'll be easier to maintain and is not deprecated.
This will let us use the makefile in other repos instead of copying all our GRPC stuff everywhere...
We really don't care if the Google protos get an Equal method...
Doing this manually is tedious and buf will manage dependencies (like the GRPC protoc plugin) for us. We already use it for linting so /shrug
Whoops. Eventually we can swap to vtprotobuf and simply call the vtprotobuf helpers from these generic methods without changing our code elsewhere for a nice performance gain
I'm probably going to ditch buf for codegen eventually anyways...
This also fixes a bug where fmt.Fprintf wouldn't write the entire response (as I never checked how much was written). Also its binary and writing binary to a file using strings is silly
cretz
reviewed
Oct 9, 2023
This needn't be here
If you need to do this again:
$ grep -R 'import "google' | cut -d':' -f2- | sort -u
1 task
cretz
approved these changes
Nov 3, 2023
Contributor
cretz
left a comment
There was a problem hiding this comment.
LGTM (may want to wait on merging until dependents are ready)
buf.yaml
Outdated
| use: | ||
| - WIRE_JSON | ||
| ignore: | ||
| - dependencies |
Contributor
There was a problem hiding this comment.
Assuming we can remove this post-merge
alexshtin
approved these changes
Nov 9, 2023
Comment on lines
-6
to
-8
| github.com/grpc-ecosystem/grpc-gateway v1.16.0 | ||
| github.com/pseudomuto/protoc-gen-doc v1.5.1 | ||
| github.com/temporalio/gogo-protobuf v1.22.1 |
Contributor
There was a problem hiding this comment.
This was here to pin dependencies to specific versions. Not every project follows semver and from time to time someone may make a breaking change. I am actually ok to take this risk and use latest always.
* Create workflow collection proto * address comments * add export in the name * Apply suggestions from code review Co-authored-by: Roey Berman <roey@temporal.io> * Apply suggestions from code review * Update temporal/api/export/v1/message.proto * address comments * rename workflowExecutionHistory to workflowExecution --------- Co-authored-by: Roey Berman <roey@temporal.io>
The stamp file let's us only do so when the file actually changes :)
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.
What changed?
gogo/protobuf has been replaced with Google's official go compiler.
I also changed our code generation to use buf as it was slightly easier to manage plugin versions, though I may revert that.
Why?
gogo/protobuf has been deprecated for some time and the community is moving on, building new tools (like vtproto) atop google's v2 compiler.
Breaking changes
*time.Timein proto structs will now be timestamppb.Timestamp*time.Durationwill now be durationpb.Durationgo vetwill scream at you about thisSCREAMING_SNAKE_CASErather thanPascalCase. We decided (in discussion with the SDK team) that now was as good a time as any to rip the bandage offRelease Plan
Our goal is to release our API, Go API, Go SDK, and Server all at once, then update our UI (and ui-server), CLI, and HTTP API in a second pass. Until the second pass happens no changes to our JSON formatting will be apparent to users