Skip to content

Make gorums.RPCCall generic to match QuorumCall#258

Merged
meling merged 2 commits intomasterfrom
meling/257/generic-rpccall
Feb 7, 2026
Merged

Make gorums.RPCCall generic to match QuorumCall#258
meling merged 2 commits intomasterfrom
meling/257/generic-rpccall

Conversation

@meling
Copy link
Member

@meling meling commented Feb 7, 2026

Fixes #257

This makes RPCCall generic so that callsites in generated code becomes much cleaner, and aligns with the QuorumCall approach. It was an oversight that this was not made generic during an earlier refactor when we made QuorumCall, Multicast, and Unicast generic.

This makes RPCCall generic so that callsites in generated code
becomes much cleaner, and aligns with the QuorumCall approach.
@deepsource-io
Copy link
Contributor

deepsource-io bot commented Feb 7, 2026

Here's the code health analysis summary for commits e998359..5cf4a51. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGo✅ SuccessView Check ↗
DeepSource Shell LogoShell✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Gorums runtime to make RPCCall generic (matching the generic style already used by QuorumCall), and adjusts generated code and tests accordingly to remove manual type assertions at call sites.

Changes:

  • Make gorums.RPCCall generic over request/response protobuf message types.
  • Update protoc-gen-gorums RPC wrapper template to emit direct generic RPCCall invocations.
  • Update generated test/example stubs and unit tests to use the new generic call form.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rpc.go Changes RPCCall to a generic API and adjusts response handling.
cmd/protoc-gen-gorums/gengorums/template_rpc.go Updates generator template to emit RPCCall[*In, *Out](...) wrappers.
examples/storage/proto/storage_gorums.pb.go Updates example generated RPC wrappers to use generic RPCCall.
internal/tests/unresponsive/unresponsive_gorums.pb.go Updates generated test RPC wrapper to use generic RPCCall.
internal/tests/tls/tls_gorums.pb.go Updates generated test RPC wrapper to use generic RPCCall.
internal/tests/ordering/order_gorums.pb.go Updates generated test RPC wrapper to use generic RPCCall.
internal/tests/metadata/metadata_gorums.pb.go Updates generated test RPC wrappers to use generic RPCCall.
cmd/protoc-gen-gorums/dev/zorums_rpc_gorums.pb.go Updates dev generated RPC wrapper to use generic RPCCall.
rpc_test.go Updates RPCCall unit tests to call the generic API.
server_test.go Updates server interceptor/reconnection tests to call the generic API.
config_test.go Updates concurrent access test to call the generic API.
channel_test.go Updates channel tests to call the generic API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This returns an error instead of panicking if the caller accidentally
specifies the wrong response type for the method. This should not happen
in practice when used with generated code, but this can be useful when
using the RPCCall from test code.
@meling meling merged commit ccaccf7 into master Feb 7, 2026
5 checks passed
@meling meling deleted the meling/257/generic-rpccall branch February 7, 2026 22:41
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.

bug: RPCCall should also be generic just like QuorumCall

1 participant