Skip to content

Add Source metadata support to Mediator and Consumer descriptions - #10063

Merged
PascalSenn merged 1 commit into
mainfrom
pse/adds-source-to-descriptions
Jul 7, 2026
Merged

PascalSenn merged 1 commit into
mainfrom
pse/adds-source-to-descriptions

Conversation

@PascalSenn

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 7, 2026 19:22

@PascalSenn PascalSenn left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds SourceMetadata propagation to various runtime Describe() outputs (messages, consumers, sagas, mediator handlers) so diagnostic/visualization descriptions can include declaration/source information, and updates/extends tests and snapshots accordingly.

Changes:

  • Add SourceMetadata? Source to multiple *Description record types and populate it from configuration in Describe() implementations.
  • Implement saga-consumer fallback behavior so Consumer.Describe() can use the saga’s source when the consumer has none.
  • Add focused tests asserting Source is present when configured, and update existing snapshots to include "Source": null.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/Mocha/test/Mocha.Tests/MessageTypes/MessageTypeTests.cs Adds a test for message type Describe() returning configured Source.
src/Mocha/test/Mocha.Tests/Consumers/ConsumerBehaviorTests.cs Adds a test for consumer Describe() returning configured Source.
src/Mocha/test/Mocha.Tests/Consumers/snapshots/ConsumerBehaviorTests.Describe_Should_ReturnConsumerDescription_When_EventHandlerRegistered.snap Updates snapshot to include Source: null.
src/Mocha/test/Mocha.Sagas.Tests/SagaInitializationTests.cs Adds tests for saga Describe() source and saga-consumer source fallback.
src/Mocha/test/Mocha.Mediator.Tests/MediatorDescriptionTests.cs Adds a test for mediator handler descriptions returning configured Source.
src/Mocha/test/Mocha.Mediator.Tests/snapshots/MediatorDescriptionTests.Describe_Should_ReturnMediatorDescription_When_HandlersRegistered.snap Updates snapshot to include Source: null per handler.
src/Mocha/src/Mocha/Sagas/SagaEventListener.cs Adds consumer description source fallback to saga source.
src/Mocha/src/Mocha/Sagas/Saga.cs Adds saga description Source population from saga configuration.
src/Mocha/src/Mocha/MessageTypes/MessageType.cs Adds message type description Source population.
src/Mocha/src/Mocha/Descriptions/SagaDescription.cs Extends SagaDescription with Source.
src/Mocha/src/Mocha/Descriptions/MessageTypeDescription.cs Extends MessageTypeDescription with Source.
src/Mocha/src/Mocha/Descriptions/ConsumerDescription.cs Extends ConsumerDescription with Source.
src/Mocha/src/Mocha/Consumers/Implementations/BatchConsumer.cs Adds Source to batch consumer description output.
src/Mocha/src/Mocha/Consumers/Consumer.cs Adds Source to base consumer description output.
src/Mocha/src/Mocha.Mediator/Descriptions/MediatorHandlerDescription.cs Extends MediatorHandlerDescription with Source.
src/Mocha/src/Mocha.Mediator/DependencyInjection/MediatorBuilder.cs Populates mediator handler description Source from handler config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Mocha/src/Mocha/Descriptions/ConsumerDescription.cs
Comment thread src/Mocha/src/Mocha/Descriptions/MessageTypeDescription.cs
Comment thread src/Mocha/src/Mocha/Descriptions/SagaDescription.cs
Comment thread src/Mocha/test/Mocha.Tests/MessageTypes/MessageTypeTests.cs
Comment thread src/Mocha/test/Mocha.Tests/Consumers/ConsumerBehaviorTests.cs
Comment thread src/Mocha/test/Mocha.Sagas.Tests/SagaInitializationTests.cs
Comment thread src/Mocha/test/Mocha.Sagas.Tests/SagaInitializationTests.cs
Comment thread src/Mocha/test/Mocha.Mediator.Tests/MediatorDescriptionTests.cs
@PascalSenn
PascalSenn merged commit a3be8fe into main Jul 7, 2026
144 of 147 checks passed
@PascalSenn
PascalSenn deleted the pse/adds-source-to-descriptions branch July 7, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants