Repository navigation
hooks/grpc: Support RejectTermination in gRPC hook responses - #1420
Merged
Merged
Conversation
The gRPC HookResponse message had no field corresponding to hooks.HookResponse.RejectTermination, so pre-terminate hooks using the gRPC backend could not reject an upload termination, unlike the file, HTTP and plugin backends. Add a rejectTermination field (number 5) to the HookResponse message, regenerate the Go and Python bindings and map the field when converting gRPC responses. The Python example server now shows how to reject a termination. Because the gRPC backend converts between the Go hook types and the Protocol Buffers messages by hand, add generic tests that catch any field which is missing or not mapped: - Field parity between each Go type and its proto message. - Full request and response round trips through a real gRPC server, with fixtures that must set every field. Also cover header forwarding, retries on transient errors and validation of the secure Setup options.
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.
The gRPC
HookResponsemessage had no field forRejectTermination, so pre-terminate hooks using the gRPC backend could not reject an upload termination. The file, HTTP and plugin backends already support it.Changes:
rejectTermination(field number 5) toHookResponseinhook.proto, regenerate the Go bindings (protoc 3.21.12, protoc-gen-go v1.28.1) and the Python example bindings, and map the field inunmarshal.Setupvalidation.