Skip to content

hooks/grpc: Support RejectTermination in gRPC hook responses - #1420

Merged
Acconut merged 1 commit into
mainfrom
grpc-reject-termination-8dbc38
Nov 20, 2026
Merged

Acconut merged 1 commit into
mainfrom
grpc-reject-termination-8dbc38

Conversation

@Acconut

@Acconut Acconut commented Nov 20, 2026

Copy link
Copy Markdown
Member

The gRPC HookResponse message had no field for RejectTermination, so pre-terminate hooks using the gRPC backend could not reject an upload termination. The file, HTTP and plugin backends already support it.

Changes:

  • Add rejectTermination (field number 5) to HookResponse in hook.proto, regenerate the Go bindings (protoc 3.21.12, protoc-gen-go v1.28.1) and the Python example bindings, and map the field in unmarshal.
  • Show how to reject a termination in the Python example server.
  • Add tests for the gRPC hook backend. Because it converts between the Go hook types and the proto messages by hand, the tests check field parity between each Go type and its proto message, and do full request/response round trips through a real gRPC server with fixtures that must set every field. A field that is added on one side but not mapped now fails the tests. They also cover header forwarding, retries and the secure Setup validation.

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.
@Acconut
Acconut merged commit 2fea1be into main Nov 20, 2026
11 checks passed
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