planetscale / planetscale/vtprotobuf
Duplicated code generated for GRPC client/server
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
Hi All,
I'm running the vtproto generator on the proto below, we use both the go + go-grpc generators in addition to vtproto.
However when I run the vtproto generator it duplicates the grpc generated code.
What's the best way to deal with this type of proto to remove the duplicated code?
- Split the proto files into two files: messages.proto + grpc.proto?
- Ignore the generated gRPC types when running the vtproto generator?
Thanks!
Glenn
Single proto
Attached are the generated files: gen.zip
syntax = "proto3";
package pingpong;
option go_package = "pingpong";
service PingPongService {
rpc Pong(PingRequest) returns (PongResponse) {}
}
message PingRequest {
string hello = 1;
}
message PongResponse {
string world = 1;
}
Split protos
Attached are the split generated files: gen 2.zip
messages.proto
syntax = "proto3";
package pingpong;
option go_package = "gen";
message PingRequest {
string hello = 1;
}
message PongResponse {
string world = 1;
}
grpc.proto
syntax = "proto3";
package pingpong;
option go_package = "gen";
import "messages.proto";
service PingPongService {
rpc Pong(PingRequest) returns (PongResponse) {}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the generated outputs in the attached gen.zip and gen 2.zip files with the single and split proto examples. Trace how the vtproto generator handles service definitions alongside message types. Done means the intended handling of gRPC-generated code is defined and the duplicate output is eliminated or the supported proto layout is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, grpc
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100