Add caller metadata to projection create and update#47
Conversation
Mirrors KurrentDB server PR #5638. The server stamps a caller-supplied
properties map onto the projection's $ProjectionUpdated definition event,
giving deployment tooling (gaffer) a per-deploy annotation bound to the
exact projection version. It does not affect the projection engine, and
older servers ignore the field.
- Add the properties map to CreateReq.Options (field 6) and
UpdateReq.Options (field 5) in projections.proto and regenerate
- Expose it as Metadata map[string]interface{} on CreateProjectionOptions
and UpdateProjectionOptions, converted to a struct-value map before the
RPC and failing fast on non-JSON values
- Add round-trip, update-keeps-existing, and invalid-value tests; the
round-trip tests are gated to server 26.2.0+
PR Summary by QodoAdd caller metadata support to projection Create/Update requests Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1.
|
structpb.NewValue base64-encodes []byte into a string Value, so it does not round-trip as bytes. Advertising it was misleading.
Adds support for attaching caller-supplied metadata to projection create and update, kurrent-io/KurrentDB#5638.
projections.proto- add thepropertiesmap toCreateReq.Options(field 6) andUpdateReq.Options(field 5), and regenerate.projection_options.go/projection_client.go- exposeMetadata map[string]interface{}on both option structs, converted to a struct-value map before the RPC and failing fast with a wrapped error on non-JSON values.