Skip to content

feat: add PatternKit hosting extensions#392

Merged
JerrettDavis merged 3 commits into
mainfrom
feature/hosting-extensions
May 27, 2026
Merged

feat: add PatternKit hosting extensions#392
JerrettDavis merged 3 commits into
mainfrom
feature/hosting-extensions

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

  • Adds PatternKit.Hosting.Extensions with first-party IServiceCollection registration helpers for PatternKit messaging and cloud resilience primitives.
  • Adds TinyBDD scenario coverage for DI registration, configured behavior, lifetimes, and validation across net8/net9/net10.
  • Updates README/docs/docfx metadata and package locks, including TinyBDD 0.19.21.
  • Keeps the PatternKit generator Roslyn package pinned to 5.0.0 via VersionOverride so analyzers remain loadable by the installed SDK compiler.

Verification

  • dotnet restore PatternKit.slnx
  • dotnet build PatternKit.slnx --configuration Release --no-restore -m:1
  • dotnet test test\PatternKit.Hosting.Extensions.Tests\PatternKit.Hosting.Extensions.Tests.csproj --configuration Release --no-build --logger "console;verbosity=minimal" -p:TestTfmsInParallel=false
  • dotnet 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 --warningsAsErrors
  • dotnet list PatternKit.slnx package --outdated reports only the intentional PatternKit.Generators Roslyn 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.

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 8 package(s) with unknown licenses.
See the Details below.

License Issues

src/PatternKit.Hosting.Extensions/PatternKit.Hosting.Extensions.csproj

PackageVersionLicenseIssue Type
Microsoft.Extensions.DependencyInjection.Abstractions>= 0NullUnknown License

test/PatternKit.Hosting.Extensions.Tests/PatternKit.Hosting.Extensions.Tests.csproj

PackageVersionLicenseIssue Type
Microsoft.Extensions.DependencyInjection>= 0NullUnknown License
Microsoft.NET.Test.Sdk>= 0NullUnknown License
TinyBDD.Xunit>= 0NullUnknown License
coverlet.collector>= 0NullUnknown License
xunit>= 0NullUnknown License
xunit.extensibility.core>= 0NullUnknown License
xunit.runner.visualstudio>= 0NullUnknown License
Denied Licenses: GPL-2.0, GPL-3.0, AGPL-3.0

OpenSSF Scorecard

PackageVersionScoreDetails
nuget/Microsoft.Extensions.DependencyInjection.Abstractions >= 0 UnknownUnknown
nuget/Microsoft.Extensions.DependencyInjection >= 0 UnknownUnknown
nuget/Microsoft.NET.Test.Sdk >= 0 UnknownUnknown
nuget/TinyBDD.Xunit >= 0 UnknownUnknown
nuget/coverlet.collector >= 0 UnknownUnknown
nuget/xunit >= 0 UnknownUnknown
nuget/xunit.extensibility.core >= 0 UnknownUnknown
nuget/xunit.runner.visualstudio >= 0 UnknownUnknown

Scanned Files

  • src/PatternKit.Hosting.Extensions/PatternKit.Hosting.Extensions.csproj
  • test/PatternKit.Hosting.Extensions.Tests/PatternKit.Hosting.Extensions.Tests.csproj

@JerrettDavis JerrettDavis changed the title Add PatternKit hosting extensions feat: add PatternKit hosting extensions May 27, 2026

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

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.Extensions with 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.Tests to 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>();
Comment on lines +57 to +62
public static IServiceCollection AddPatternKitGuaranteedDelivery<TPayload>(
this IServiceCollection services,
Action<GuaranteedDeliveryQueue<TPayload>.Builder>? configure = null,
ServiceLifetime lifetime = ServiceLifetime.Singleton,
Func<IServiceProvider, IGuaranteedDeliveryStore<TPayload>>? storeFactory = null)
{
@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   8m 49s ⏱️
 3 513 tests  3 513 ✅ 0 💤 0 ❌
10 550 runs  10 550 ✅ 0 💤 0 ❌

Results for commit a74041f.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

🔍 PR Validation Results

Version: ``

✅ Validation Steps

  • Build solution
  • Run tests
  • Build documentation
  • Dry-run NuGet packaging

📊 Artifacts

Dry-run artifacts have been uploaded and will be available for 7 days.


This comment was automatically generated by the PR validation workflow.

@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.83673% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.63%. Comparing base (a51749d) to head (a74041f).

Files with missing lines Patch % Lines
...Injection/PatternKitServiceCollectionExtensions.cs 91.83% 8 Missing ⚠️
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     
Flag Coverage Δ
unittests 95.63% <91.83%> (+6.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/27/2026 - 18:48:42
  Coverage date: 05/27/2026 - 18:46:25 - 05/27/2026 - 18:48:30
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1613
  Files: 649
  Line coverage: 94.6%
  Covered lines: 42066
  Uncovered lines: 2383
  Coverable lines: 44449
  Total lines: 97120
  Branch coverage: 75.5% (12374 of 16380)
  Covered branches: 12374
  Total branches: 16380
  Method coverage: 96% (8425 of 8770)
  Full method coverage: 88.1% (7732 of 8770)
  Covered methods: 8425
  Fully covered methods: 7732
  Total methods: 8770

PatternKit.Core                                                                                                     95.4%
  PatternKit.Application.ActivityTracking.ActivityGateState                                                          100%
  PatternKit.Application.ActivityTracking.ActivityLease                                                              100%
  PatternKit.Application.ActivityTracking.ActivityRecord                                                             100%
  PatternKit.Application.ActivityTracking.ActivityTracker                                                            100%
  PatternKit.Application.AntiCorruption.AntiCorruptionLayer<T1, T2>                                                 90.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionResult<T>                                                      100%
  PatternKit.Application.AuditLog.AuditLogAppendResult<T>                                                           85.7%
  PatternKit.Application.AuditLog.InMemoryAuditLog<T1, T2>                                                          95.4%
  PatternKit.Application.DataMapping.DataMapper<T1, T2>                                                             94.6%
  PatternKit.Application.DataMapping.DataMapperError                                                                  90%
  PatternKit.Application.DataMapping.DataMapperResult<T>                                                            84.6%
  PatternKit.Application.DomainEvents.DomainEventDispatcher<T>                                                      95.4%
  PatternKit.Application.DomainEvents.DomainEventDispatchResult                                                      100%
  PatternKit.Application.EventSourcing.EventStoreAppendResult                                                        100%
  PatternKit.Application.EventSourcing.InMemoryEventStore<T1, T2>                                                   97.9%
  PatternKit.Application.EventSourcing.StoredEvent<T1, T2>                                                            80%
  PatternKit.Application.FeatureToggles.FeatureToggleDecision                                                       87.5%
  PatternKit.Application.FeatureToggles.FeatureToggleRule<T>                                                         100%
  PatternKit.Application.FeatureToggles.FeatureToggleSet<T>                                                         96.9%
  PatternKit.Application.IdentityMap.IdentityMap<T1, T2>                                                             100%
  PatternKit.Application.IdentityMap.IdentityMapResult<T>                                                           92.8%
  PatternKit.Application.MaterializedViews.MaterializedView<T1, T2>                                                 98.4%
  PatternKit.Application.Repository.InMemoryRepository<T1, T2>                                                      92.8%
  PatternKit.Application.Repository.RepositoryResult<T>                                                             93.3%
  PatternKit.Application.ServiceLayer.ServiceLayerOperation<T1, T2>                                                 96.7%
  PatternKit.Application.ServiceLayer.ServiceLayerResult<T>                                                         94.7%
  PatternKit.Application.ServiceLayer.ServiceLayerRule<T>                                                            100%
  PatternKit.Application.Specification.Specification<T>                                                              100%
  PatternKit.Application.Specification.SpecificationRegistry<T>                                                     93.3%
  PatternKit.Application.TableDataGateway.InMemoryTableDataGateway<T1, T2>                                            86%
  PatternKit.Application.TableDataGateway.TableGatewayResult<T>                                                     82.3%
  PatternKit.Application.TransactionScript.TransactionScript<T1, T2>                                                  97%
  PatternKit.Application.TransactionScript.TransactionScriptError                                                     90%
  PatternKit.Application.TransactionScript.TransactionScriptResult<T>                                                100%
  PatternKit.Application.UnitOfWork.UnitOfWork                                                                      90.9%
  PatternKit.Application.UnitOfWork.UnitOfWorkResult                                                                94.7%
  PatternKit.Application.UnitOfWork.UnitOfWorkRollbackResult                                                         100%
  PatternKit.Application.UnitOfWork.UnitOfWorkStep                                                                   100%

@JerrettDavis
JerrettDavis merged commit d56978c into main May 27, 2026
12 checks passed
@JerrettDavis
JerrettDavis deleted the feature/hosting-extensions branch May 27, 2026 18:57
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.

Add PatternKit.Hosting.Extensions for reusable IServiceCollection integration

2 participants