Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fabric-protos #755

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

bestbeforetoday
Copy link
Member

@bestbeforetoday bestbeforetoday commented Sep 24, 2024

New version of fabric-protos uses updated protoc and protobuf versions, including protobuf-java v4. This change updates from protobuf-java v3 to v4.

The change to use generics in the newer generated gRPC client stubs means that the previous approach of mocking them using uber-go/mock is not possible. This change uses mockery to mock the gRPC client connection instead. Mockery does support mocking of most generics, and mocking at the connection allows unit testing to be done using the public API without test hooks to allow replacement of gRPC stubs.

@bestbeforetoday bestbeforetoday force-pushed the fabric-protos branch 7 times, most recently from dc10a55 to 8f651d4 Compare October 1, 2024 18:23
@bestbeforetoday bestbeforetoday force-pushed the fabric-protos branch 4 times, most recently from 4a82a77 to 28f9d84 Compare October 6, 2024 13:57
@bestbeforetoday bestbeforetoday marked this pull request as ready for review October 6, 2024 14:26
@bestbeforetoday bestbeforetoday requested a review from a team as a code owner October 6, 2024 14:26
@bestbeforetoday bestbeforetoday enabled auto-merge (squash) October 6, 2024 14:26
@bestbeforetoday bestbeforetoday enabled auto-merge (squash) October 6, 2024 15:29
New version of fabric-protos uses updated protoc and protobuf versions,
including protobuf-java v4. This change updates from protobuf-java v3 to
v4.

The change to use generics in the newer generated gRPC client stubs
means that the previous approach of mocking them using uber-go/mock is
not possible. This change uses mockery to mock the gRPC client
connection instead. Mockery does support mocking of most generics, and
mocking at the connection allows unit testing to be done using the
public API without test hooks to allow replacement of gRPC stubs.

Signed-off-by: Mark S. Lewis <[email protected]>
@bestbeforetoday bestbeforetoday merged commit d19022b into hyperledger:main Oct 12, 2024
30 checks passed
@bestbeforetoday bestbeforetoday deleted the fabric-protos branch October 12, 2024 10:16
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.

1 participant