feat: add PatternKit hosting extensions#392
Conversation
Dependency ReviewThe following issues were found:
License Issuessrc/PatternKit.Hosting.Extensions/PatternKit.Hosting.Extensions.csproj
test/PatternKit.Hosting.Extensions.Tests/PatternKit.Hosting.Extensions.Tests.csproj
OpenSSF Scorecard
Scanned Files
|
There was a problem hiding this comment.
Pull request overview
Adds a new first-party hosting integration package (PatternKit.Hosting.Extensions) that provides IServiceCollection registration helpers for PatternKit messaging and cloud resilience primitives, along with dedicated TinyBDD test coverage and supporting docs/metadata updates.
Changes:
- Introduces
PatternKit.Hosting.Extensionswith DI extension methods for messaging channels/stores/guaranteed delivery and cloud policies (retry, circuit breaker, bulkhead, rate limiting, queue load leveling, priority queue). - Adds
PatternKit.Hosting.Extensions.Teststo validate DI registration behavior, lifetimes, configuration, and input validation across net8/net9/net10. - Updates docs/DocFX metadata, solution inclusion, and central package versions (notably TinyBDD 0.19.21) and Roslyn pinning for generator compatibility.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/PatternKit.Tests/PatternKit.Tests.csproj | Removes per-project TinyBDD version override to rely on central package management. |
| test/PatternKit.Hosting.Extensions.Tests/xunit.runner.json | Adds xUnit runner config for the new hosting extensions test project. |
| test/PatternKit.Hosting.Extensions.Tests/PatternKit.Hosting.Extensions.Tests.csproj | New multi-targeted test project for hosting extensions DI behavior. |
| test/PatternKit.Hosting.Extensions.Tests/packages.lock.json | Lock file for the new test project dependencies. |
| test/PatternKit.Hosting.Extensions.Tests/DependencyInjection/PatternKitServiceCollectionExtensionsTests.cs | TinyBDD scenarios covering DI registrations, behavior, lifetimes, and validation for the new hosting extensions. |
| test/PatternKit.Generators.Tests/PatternKit.Generators.Tests.csproj | Removes TinyBDD version overrides to use centrally-managed versions. |
| test/PatternKit.Examples.Tests/PatternKit.Examples.Tests.csproj | Removes TinyBDD.Xunit version override to use centrally-managed versions. |
| src/PatternKit.Hosting.Extensions/PatternKit.Hosting.Extensions.csproj | New packable hosting extensions project referencing PatternKit.Core and DI abstractions. |
| src/PatternKit.Hosting.Extensions/packages.lock.json | Lock file for hosting extensions package dependencies. |
| src/PatternKit.Hosting.Extensions/DependencyInjection/PatternKitServiceCollectionExtensions.cs | Implements IServiceCollection extension methods to register PatternKit primitives with configurable lifetimes. |
| src/PatternKit.Generators/PatternKit.Generators.csproj | Pins Microsoft.CodeAnalysis.CSharp to 5.0.0 via VersionOverride while repo central version moves forward. |
| src/PatternKit.Generators/packages.lock.json | Updated lock file for generator project restore consistency. |
| src/PatternKit.Examples/packages.lock.json | Lock file update reflecting central package/version shifts. |
| README.md | Documents the new PatternKit.Hosting.Extensions package and provides a basic DI usage example. |
| PatternKit.slnx | Adds the new hosting extensions project and its test project to the solution. |
| docs/index.md | Mentions hosting extensions install and updates pattern counts/summary text. |
| docs/guides/toc.yml | Adds “Hosting Extensions” guide to the guides TOC. |
| docs/guides/hosting-extensions.md | New guide describing how to use the hosting extensions for DI registration. |
| docs/docfx.json | Adds hosting extensions csproj to DocFX metadata generation. |
| Directory.Packages.props | Centralizes new/updated package versions (TinyBDD 0.19.21; Roslyn central version; adds DI.Abstractions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| lifetime, | ||
| provider => | ||
| { | ||
| var store = storeFactory?.Invoke(provider) ?? new InMemoryGuaranteedDeliveryStore<TPayload>(); |
| public static IServiceCollection AddPatternKitGuaranteedDelivery<TPayload>( | ||
| this IServiceCollection services, | ||
| Action<GuaranteedDeliveryQueue<TPayload>.Builder>? configure = null, | ||
| ServiceLifetime lifetime = ServiceLifetime.Singleton, | ||
| Func<IServiceProvider, IGuaranteedDeliveryStore<TPayload>>? storeFactory = null) | ||
| { |
Test Results 12 files 12 suites 8m 49s ⏱️ Results for commit a74041f. ♻️ This comment has been updated with latest results. |
🔍 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 #392 +/- ##
==========================================
+ Coverage 89.57% 95.63% +6.05%
==========================================
Files 529 530 +1
Lines 42801 42899 +98
Branches 6182 6203 +21
==========================================
+ Hits 38340 41026 +2686
+ Misses 2020 1873 -147
+ Partials 2441 0 -2441
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:
|
Code Coverage |
Summary
PatternKit.Hosting.Extensionswith first-partyIServiceCollectionregistration helpers for PatternKit messaging and cloud resilience primitives.VersionOverrideso analyzers remain loadable by the installed SDK compiler.Verification
dotnet restore PatternKit.slnxdotnet build PatternKit.slnx --configuration Release --no-restore -m:1dotnet test test\PatternKit.Hosting.Extensions.Tests\PatternKit.Hosting.Extensions.Tests.csproj --configuration Release --no-build --logger "console;verbosity=minimal" -p:TestTfmsInParallel=falsedotnet test test\PatternKit.Tests\PatternKit.Tests.csproj --configuration Release --framework net8.0 --no-build --logger "console;verbosity=minimal"dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release --framework net8.0 --no-build --logger "console;verbosity=minimal"dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --configuration Release --framework net8.0 --no-build --logger "console;verbosity=minimal"docfx docs\docfx.json --warningsAsErrorsdotnet list PatternKit.slnx package --outdatedreports only the intentionalPatternKit.GeneratorsRoslyn 5.0.0 compatibility override.A local full solution test run timed out after 10 minutes before producing a failure; the split suites above passed and CI should exercise the full matrix.
Closes #389.