Skip to content

Surface every bus-forwarding RPC kind in the gRPC endpoint manifest (GH-3265)#3266

Merged
jeremydmiller merged 1 commit into
mainfrom
feat/grpc-endpoint-manifest-stream-kinds-3265
Jun 27, 2026
Merged

Surface every bus-forwarding RPC kind in the gRPC endpoint manifest (GH-3265)#3266
jeremydmiller merged 1 commit into
mainfrom
feat/grpc-endpoint-manifest-stream-kinds-3265

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Closes #3265.

Summary

IGrpcEndpointManifest (#3235) exposed Wolverine's discovered gRPC endpoint → message-type mapping so CritterWatch can populate PublisherKind.GrpcEndpoint, but it surfaced only unary proto-first/code-first endpoints. Server-streaming and bidirectional-streaming RPCs also forward their request to the message bus (via IMessageBus.StreamAsync), so they are equally valid message-publishing origins — they were invisible.

This PR completes #3265:

  • Surfaces every RPC kind Wolverine forwards to the bus — proto-first unary + server-streaming + bidirectional-streaming, and code-first unary + server-streaming.
  • Adds a GrpcRpcStreamKind discriminator (Unary / ServerStreaming / BidirectionalStreaming) to GrpcEndpointDescriptor so consumers can render the right cardinality on a chain-detail page.
  • For bidirectional RPCs, the published message is the per-item element type of the inbound request stream (unwrapped from IAsyncStreamReader<T>), not the reader wrapper — each item is forwarded individually via StreamAsync.

The "or decide it's N/A" half

Hand-written and direct-mapped services remain excluded by design: Wolverine delegates those to the user's own service implementation rather than forwarding to the bus, so there is no reliable message-publishing origin to surface. The decision is now encoded in code, docs, and tests rather than left implicit.

Test coverage

Comprehensive coverage across every supported gRPC configuration (grpc_endpoint_manifest_3265.cs):

Configuration Kind Asserted
proto-first Unary (SayHello, SayGoodbye, Fault) service/method/request/response/handler/kind
proto-first ServerStreaming (StreamGreetings) request DTO + response = stream element type
proto-first BidirectionalStreaming (Echo) request = stream element type, not the reader
code-first Unary (Greet) full descriptor
code-first ServerStreaming (StreamGreetings) request + IAsyncEnumerable<T> element response
hand-written discovered as a chain but excluded from the manifest
direct-mapped manifest never reports the mode

Plus manifest-wide invariants (every descriptor carries a request message, a known stream kind, and a bus-forwarding discovery mode). The pre-existing #3235 test was updated where it previously asserted streaming was excluded.

Wolverine.Grpc.Tests236/236 passing locally (net9.0).

🤖 Generated with Claude Code

…t manifest (GH-3265)

The IGrpcEndpointManifest (GH-3235) only surfaced unary proto-first/code-first
endpoints. But server-streaming and bidirectional-streaming RPCs also forward
their request to the message bus via IMessageBus.StreamAsync, so they are equally
valid PublisherKind.GrpcEndpoint origins for CritterWatch's event model.

Extend the manifest to surface every RPC kind Wolverine actually forwards to the
bus, and add a GrpcRpcStreamKind discriminator (Unary / ServerStreaming /
BidirectionalStreaming) to GrpcEndpointDescriptor so consumers can render the
right cardinality. For bidirectional RPCs the published message is the per-item
element type of the inbound request stream (unwrapped from IAsyncStreamReader<T>),
not the reader wrapper.

Hand-written and direct-mapped services remain excluded by design: Wolverine
delegates those to the user's own implementation rather than forwarding to the
bus, so there is no reliable message-publishing origin to surface. This resolves
the "or decide it's N/A" half of GH-3265 for those two modes.

Adds comprehensive coverage across every supported gRPC configuration:
proto-first unary/server-streaming/bidirectional, code-first unary/server-streaming,
and the hand-written/direct-mapped exclusions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit 52c6176 into main Jun 27, 2026
26 checks passed
ArieGato pushed a commit to ArieGato/wolverine that referenced this pull request Jun 28, 2026
…iptor source (JasperFxGH-3267)

The gRPC endpoint manifest (JasperFxGH-3266) lived only inside Wolverine.Grpc and never
reached the ServiceCapabilities capability path, so a monitoring console
(CritterWatch) had no way to discover the gRPC services a Wolverine app exposes
the way it discovers HTTP chains (IHttpGraphUsageSource) and ASP.NET endpoints
(IAspNetEndpointDescriptorSource).

This adds the parallel descriptor/source plumbing for gRPC:

- GrpcRpcDescriptor : OptionsDescription (Wolverine core, next to ServiceCapabilities)
  carrying per-RPC service name, method, RPC kind, the published/request message
  type, response type, and the forwarding origin (all types as serializable
  TypeDescriptors).
- IGrpcEndpointDescriptorSource — discovery source mirroring
  IAspNetEndpointDescriptorSource; registered in DI by Wolverine.Grpc, projecting
  the runtime IGrpcEndpointManifest into descriptors.
- ServiceCapabilities.GrpcEndpoints + readGrpcEndpoints, folding every registered
  source into the snapshot ordered by service::method (mirrors AspNetEndpoints).

The descriptor lives in Wolverine core rather than JasperFx.Descriptors:
ServiceCapabilities is itself a Wolverine-core type and CritterWatch already
references WolverineFx, so a core-resident descriptor is equally consumable
without a coordinated JasperFx release. Hand-written and direct-mapped services
stay excluded (inherited from the manifest) — they delegate to user code and have
no message-publishing origin.

Adds coverage across every supported configuration: proto-first
unary/server-streaming/bidirectional and code-first unary/server-streaming
through both the raw source and the end-to-end ServiceCapabilities.ReadFrom path,
plus the no-gRPC (empty, no source registered) case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 29, 2026
This was referenced Jul 9, 2026
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.

gRPC endpoint discovery surface — populate PublisherKind.GrpcEndpoint with route/method origin (or decide it's N/A)

1 participant