feat(messaging): add message history pattern#380
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Adds the Message History enterprise integration pattern with runtime APIs, source generation, examples, documentation, tests, catalog coverage, and benchmark result entries.
Changes:
- Introduces
MessageHistory<TPayload>andMessageHistoryEntryfor appending/reading handling history from message headers. - Adds
[GenerateMessageHistory]andMessageHistoryGeneratorfor source-generated history builder factories. - Adds order message history examples, DI registration, docs/catalog entries, tests, and benchmark coverage/results.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/PatternKit.Core/Messaging/Diagnostics/MessageHistory.cs |
Adds core message history recorder and entry model. |
src/PatternKit.Generators.Abstractions/Messaging/MessageHistoryAttributes.cs |
Adds generator attribute for message history factories. |
src/PatternKit.Generators/Messaging/MessageHistoryGenerator.cs |
Adds Roslyn incremental generator for message history builders. |
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md |
Registers new generator diagnostics. |
src/PatternKit.Examples/Messaging/OrderMessageHistoryExample.cs |
Adds fluent/generated message history example and DI demo registration. |
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs |
Adds aggregate example registration and service wrapper. |
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs |
Adds Message History to production readiness catalog. |
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs |
Adds Order Message History to example catalog. |
benchmarks/PatternKit.Benchmarks/Messaging/MessageHistoryBenchmarks.cs |
Adds construction/execution benchmarks. |
test/PatternKit.Tests/Messaging/Diagnostics/MessageHistoryTests.cs |
Adds core behavior and validation tests. |
test/PatternKit.Generators.Tests/MessageHistoryGeneratorTests.cs |
Adds generator output/diagnostic tests. |
test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs |
Adds attribute coverage expectations. |
test/PatternKit.Examples.Tests/Messaging/OrderMessageHistoryExampleTests.cs |
Adds example and DI coverage. |
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs |
Updates catalog count expectations. |
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs |
Updates benchmark route total expectation. |
README.md |
Updates pattern counts and benchmark table. |
docs/patterns/messaging/message-history.md |
Adds pattern documentation. |
docs/patterns/toc.yml |
Adds pattern TOC entry. |
docs/generators/message-history.md |
Adds generator documentation. |
docs/generators/index.md |
Adds generator index entry. |
docs/generators/toc.yml |
Adds generator TOC entry. |
docs/examples/order-message-history.md |
Adds example documentation. |
docs/examples/toc.yml |
Adds example TOC entry. |
docs/guides/pattern-coverage.md |
Adds coverage guide row. |
docs/guides/benchmarks.md |
Adds benchmark guide rows. |
docs/guides/benchmark-results.md |
Updates benchmark matrices and counts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sb.AppendLine(); | ||
| } | ||
|
|
||
| sb.Append("partial ").Append(type.TypeKind == TypeKind.Struct ? "struct" : "class").Append(' ').Append(type.Name).AppendLine(); |
| _ = RoslynTestHelpers.Run(comp, new MessageHistoryGenerator(), out var run, out _); | ||
| return run.Results.Single().GeneratedSources.Single().SourceText.ToString(); | ||
| }) | ||
| .Then("the generated factory returns a configured builder", text => | ||
| { | ||
| ScenarioExpect.Contains("MessageHistory<global::MyApp.Order>.Builder Build()", text); | ||
| ScenarioExpect.Contains("MessageHistory<global::MyApp.Order>.Create(@\"checkout-api\")", text); | ||
| ScenarioExpect.Contains(".Action(@\"received\")", text); | ||
| ScenarioExpect.Contains(".Header(@\"X-History\")", text); |
Test Results 1 files 1 suites 2m 51s ⏱️ Results for commit 5281db7. |
Code Coverage |
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #380 +/- ##
==========================================
+ Coverage 89.57% 95.61% +6.04%
==========================================
Files 510 514 +4
Lines 41628 41833 +205
Branches 6011 6037 +26
==========================================
+ Hits 37287 39999 +2712
+ Misses 1978 1834 -144
+ Partials 2363 0 -2363
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Closes #379
Validation