Background
cockroachdb/drpc#56 added the protoc-gen-go-drpc generator feature that reads google.api.http annotations from proto method options and emits DRPCGatewayRoutes functions in the generated *_drpc.pb.go files. Each function returns a []drpc.HTTPRoute containing the HTTP method, path, and a reference to the corresponding RPC client method.
The PR shipped without unit tests for the generator itself.
Task
Add unit tests for the protoc-gen-go-drpc generator covering the HTTP gateway route generation logic, including:
- Correct emission of
DRPCGatewayRoutes for methods with google.api.http annotations
- Skipping of streaming RPCs
- Skipping of methods without HTTP annotations
- Edge cases (multiple HTTP bindings, nested path params, etc.)
Notes
This should be relatively low-effort — a good candidate for Claude Code to scaffold the test suite. The generator logic lives in the cockroachdb/drpc repo but the tracking issue is here since that's where we manage DRPC-related work.
References
Jira issue: CRDB-63937
Background
cockroachdb/drpc#56 added the
protoc-gen-go-drpcgenerator feature that readsgoogle.api.httpannotations from proto method options and emitsDRPCGatewayRoutesfunctions in the generated*_drpc.pb.gofiles. Each function returns a[]drpc.HTTPRoutecontaining the HTTP method, path, and a reference to the corresponding RPC client method.The PR shipped without unit tests for the generator itself.
Task
Add unit tests for the
protoc-gen-go-drpcgenerator covering the HTTP gateway route generation logic, including:DRPCGatewayRoutesfor methods withgoogle.api.httpannotationsNotes
This should be relatively low-effort — a good candidate for Claude Code to scaffold the test suite. The generator logic lives in the
cockroachdb/drpcrepo but the tracking issue is here since that's where we manage DRPC-related work.References
Jira issue: CRDB-63937