Make gorums.RPCCall generic to match QuorumCall#258
Merged
Conversation
This makes RPCCall generic so that callsites in generated code becomes much cleaner, and aligns with the QuorumCall approach.
Contributor
|
Here's the code health analysis summary for commits Analysis Summary
|
Contributor
There was a problem hiding this comment.
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.RPCCallgeneric over request/response protobuf message types. - Update protoc-gen-gorums RPC wrapper template to emit direct generic
RPCCallinvocations. - 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.
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.
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.