Repository navigation
Add stable URN identities for various components in Mocha - #10035
Merged
Merged
Conversation
PascalSenn
commented
Jul 2, 2026
Member
- Introduced URN properties for ReceiveEndpoint, InboundRoute, OutboundRoute, MessageType, and Saga classes to provide stable identifiers.
- Implemented HostInfoExtensions to derive effective service names.
- Updated MochaUrn utility to generate URNs for new components.
- Enhanced Saga initialization to assign URNs to states and transitions.
- Added tests to validate URN generation and descriptions for various components.
- Updated project dependencies to include System.IO.Hashing.
- Introduced URN properties for ReceiveEndpoint, InboundRoute, OutboundRoute, MessageType, and Saga classes to provide stable identifiers. - Implemented HostInfoExtensions to derive effective service names. - Updated MochaUrn utility to generate URNs for new components. - Enhanced Saga initialization to assign URNs to states and transitions. - Added tests to validate URN generation and descriptions for various components. - Updated project dependencies to include System.IO.Hashing.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces stable URN-based identities across Mocha’s messaging description model (transports, endpoints, routes, message types, consumers, saga states/transitions, and topology entities/links) so diagnostics/visualization can rely on consistent IDs across runs and environments.
Changes:
- Add
Urn/Idfields and propagate them through description records for transports, endpoints, routes, message types, consumers, sagas, and topology entities/links. - Introduce
HostInfoExtensions.EffectiveServiceNameand use it to scope URNs and (for in-memory) topology addresses to a stable service name. - Add a mediator description/URN model and snapshot tests validating URN generation across components.
Reviewed changes
Copilot reviewed 56 out of 56 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Mocha/test/Mocha.Transport.RabbitMQ.Tests/Topology/RabbitMQMessagingTopologyTests.cs | Adds test coverage for address-based topology entity/link IDs in RabbitMQ transport description. |
| src/Mocha/test/Mocha.Transport.Postgres.Tests/Topology/PostgresMessagingTopologyTests.cs | Adds test coverage for address-based topology entity/link IDs in Postgres transport description. |
| src/Mocha/test/Mocha.Transport.Postgres.Tests/PostgresTransportTests.cs | Updates transport description assertions for renamed/repurposed transport fields. |
| src/Mocha/test/Mocha.Transport.InMemory.Tests/Topology/InMemoryMessagingTopologyTests.cs | Adds test coverage for address-based topology entity/link IDs in in-memory transport description. |
| src/Mocha/test/Mocha.Transport.InMemory.Tests/InMemoryTransportTests.cs | Adds test verifying in-memory topology address/queue addresses are scoped by configured service name; updates describe assertions. |
| src/Mocha/test/Mocha.Tests/MessageTypes/OutboundRouteTests.cs | Extends outbound route tests to assert stable URN generation (explicit + implicit destinations). |
| src/Mocha/test/Mocha.Tests/MessageBusChangeTokenSourceTests.cs | Updates mutable test transport TransportDescription construction to match new signature and include URN ID. |
| src/Mocha/test/Mocha.Tests/Descriptions/MochaUrnTests.cs | Adds unit tests validating URN formats and stability properties. |
| src/Mocha/test/Mocha.Tests/Consumers/snapshots/ConsumerBehaviorTests.Describe_Should_ReturnConsumerDescription_When_EventHandlerRegistered.snap | Updates snapshot to include consumer Id URN. |
| src/Mocha/test/Mocha.Sagas.Tests/SagaInitializationTests.cs | Adds saga initialization/description tests validating state/transition URN assignment and propagation. |
| src/Mocha/test/Mocha.Sagas.TestHelpers/TestMessagingSetupContext.cs | Provides a usable Host for saga test initialization (instead of throwing). |
| src/Mocha/test/Mocha.Mediator.Tests/Mocha.Mediator.Tests.csproj | Adds CookieCrumble test dependencies for mediator snapshots. |
| src/Mocha/test/Mocha.Mediator.Tests/MediatorDescriptionTests.cs | Adds snapshot test for mediator description output. |
| src/Mocha/test/Mocha.Mediator.Tests/snapshots/MediatorDescriptionTests.Describe_Should_ReturnMediatorDescription_When_HandlersRegistered.snap | Introduces mediator description snapshot including mediator/handler/message URNs. |
| src/Mocha/src/Mocha/Transport/MessagingTransport.Lifecyle.cs | Assigns stable transport URN during initialization (scoped by effective service name). |
| src/Mocha/src/Mocha/Transport/MessagingTransport.cs | Extends base transport description with URN ID and topology entity IDs. |
| src/Mocha/src/Mocha/Sagas/SagaTransition.cs | Adds transition URN to saga transition model. |
| src/Mocha/src/Mocha/Sagas/SagaState.cs | Adds state URN to saga state model. |
| src/Mocha/src/Mocha/Sagas/SagaEventListener.cs | Ensures saga event listener consumer description includes URN ID. |
| src/Mocha/src/Mocha/Sagas/Saga.Initialization.cs | Assigns saga URN and generates URNs for states/transitions during initialization. |
| src/Mocha/src/Mocha/Sagas/Saga.cs | Propagates saga/state/transition URNs into SagaDescription. |
| src/Mocha/src/Mocha/Mocha.csproj | Adds System.IO.Hashing dependency to support URN hashing. |
| src/Mocha/src/Mocha/MessageTypes/OutboundRoute.cs | Adds outbound route URN generation and includes it in descriptions. |
| src/Mocha/src/Mocha/MessageTypes/MessageType.cs | Adds message type URN (identity passthrough) and includes it in descriptions. |
| src/Mocha/src/Mocha/MessageTypes/InboundRoute.cs | Adds inbound route URN generation (with hashed condition) and includes it in descriptions. |
| src/Mocha/src/Mocha/Extensions/HostInfoExtensions.cs | Adds EffectiveServiceName derivation to consistently scope URNs/addresses. |
| src/Mocha/src/Mocha/Endpoints/ReceiveEndpoint.cs | Adds receive endpoint URN generation and includes it in descriptions. |
| src/Mocha/src/Mocha/Endpoints/DispatchEndpoint.cs | Adds dispatch endpoint URN generation and includes it in descriptions. |
| src/Mocha/src/Mocha/Descriptions/TransportDescription.cs | Updates transport description record to include stable Id URN and explicit Address. |
| src/Mocha/src/Mocha/Descriptions/TopologyLinkDescription.cs | Adds stable Id URN to topology link description model. |
| src/Mocha/src/Mocha/Descriptions/TopologyEntityDescription.cs | Adds stable Id URN to topology entity description model. |
| src/Mocha/src/Mocha/Descriptions/SagaTransitionDescription.cs | Adds stable Id URN to saga transition description model. |
| src/Mocha/src/Mocha/Descriptions/SagaStateDescription.cs | Adds stable Id URN to saga state description model. |
| src/Mocha/src/Mocha/Descriptions/SagaDescription.cs | Adds stable Id URN to saga description model. |
| src/Mocha/src/Mocha/Descriptions/ReceiveEndpointDescription.cs | Adds stable Id URN to receive endpoint description model. |
| src/Mocha/src/Mocha/Descriptions/OutboundRouteDescription.cs | Adds stable Id URN to outbound route description model. |
| src/Mocha/src/Mocha/Descriptions/MochaUrn.cs | Introduces central URN builder (including hashed route condition support). |
| src/Mocha/src/Mocha/Descriptions/MessageTypeDescription.cs | Adds stable Id URN to message type description model. |
| src/Mocha/src/Mocha/Descriptions/MessageBusDescriptionBuilder.cs | Adds stable host URN ID to the overall bus description. |
| src/Mocha/src/Mocha/Descriptions/InboundRouteDescription.cs | Adds stable Id URN to inbound route description model. |
| src/Mocha/src/Mocha/Descriptions/HostDescription.cs | Adds stable Id URN to host description model. |
| src/Mocha/src/Mocha/Descriptions/DispatchEndpointDescription.cs | Adds stable Id URN to dispatch endpoint description model. |
| src/Mocha/src/Mocha/Descriptions/ConsumerDescription.cs | Adds stable Id URN to consumer description model. |
| src/Mocha/src/Mocha/Consumers/Implementations/BatchConsumer.cs | Updates batch consumer description to include URN ID. |
| src/Mocha/src/Mocha/Consumers/Consumer.cs | Adds consumer URN generation and includes it in descriptions. |
| src/Mocha/src/Mocha.Transport.RabbitMQ/RabbitMQMessagingTransport.cs | Adds topology entity/link URN IDs in RabbitMQ transport description output. |
| src/Mocha/src/Mocha.Transport.Postgres/PostgresMessagingTransport.cs | Adds topology entity/link URN IDs in Postgres transport description output. |
| src/Mocha/src/Mocha.Transport.InMemory/InMemoryMessagingTransport.cs | Scopes in-memory topology addresses by effective service name; adds topology entity/link URN IDs. |
| src/Mocha/src/Mocha.Mediator/MediatorRuntime.cs | Adds Describe() support via cached mediator description. |
| src/Mocha/src/Mocha.Mediator/MediatorOptions.cs | Adds mediator ServiceName option for URN scoping with documented fallbacks. |
| src/Mocha/src/Mocha.Mediator/IMediatorRuntime.cs | Extends mediator runtime interface to expose mediator description. |
| src/Mocha/src/Mocha.Mediator/Descriptions/MediatorUrn.cs | Introduces mediator URN builder for mediator/handler/message identities. |
| src/Mocha/src/Mocha.Mediator/Descriptions/MediatorHandlerDescription.cs | Adds mediator handler description model including URN IDs. |
| src/Mocha/src/Mocha.Mediator/Descriptions/MediatorDescriptionHelpers.cs | Adds helper for stable readable type names in mediator description output. |
| src/Mocha/src/Mocha.Mediator/Descriptions/MediatorDescription.cs | Introduces mediator description model including mediator URN ID. |
| src/Mocha/src/Mocha.Mediator/DependencyInjection/MediatorBuilder.cs | Builds mediator description (deterministic ordering) and injects it into runtime at build time. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 13, 2026
This was referenced Jul 20, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Sep 1, 2026
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
This was referenced Oct 5, 2026
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.