Skip to content

feat: audit hosting integration coverage#406

Merged
JerrettDavis merged 1 commit into
mainfrom
chore/close-analyzer-and-hosting-matrix
May 28, 2026
Merged

feat: audit hosting integration coverage#406
JerrettDavis merged 1 commit into
mainfrom
chore/close-analyzer-and-hosting-matrix

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

  • add a first-class hosting integration catalog that audits every production pattern against reusable PatternKit.Hosting.Extensions APIs or the example-level IServiceCollection import path
  • add TinyBDD coverage for the hosting integration catalog and its IServiceCollection registration
  • add BenchmarkDotNet hosting integration matrix routes plus a dedicated hosting extensions benchmark class for registration/provider/resolve overhead
  • document the reusable hosting extension matrix and published hosting benchmark route results

Closes #390.
Closes #391.
Closes #394.

Next issues opened

Validation

  • dotnet restore PatternKit.slnx --use-lock-file
  • dotnet format PatternKit.slnx --verify-no-changes --verbosity minimal
  • dotnet build PatternKit.slnx --configuration Release --no-restore -m:1
  • dotnet test PatternKit.slnx --configuration Release --no-build -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"
  • dotnet test test\PatternKit.Examples.Tests\PatternKit.Examples.Tests.csproj --configuration Release --framework net8.0 --filter "FullyQualifiedName~ProductionReadiness" --logger "console;verbosity=minimal"
  • dotnet test test\PatternKit.Hosting.Extensions.Tests\PatternKit.Hosting.Extensions.Tests.csproj --configuration Release --no-build --framework net8.0 --logger "console;verbosity=minimal"
  • dotnet build benchmarks\PatternKit.Benchmarks\PatternKit.Benchmarks.csproj --configuration Release --no-restore
  • docfx docs\docfx.json --warningsAsErrors

Copilot AI review requested due to automatic review settings May 28, 2026 04:55
@github-actions

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

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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 an audit layer that maps every production-readiness catalog pattern to either a reusable PatternKit.Hosting.Extensions registration API or the example-level AddPatternKitExamples import, and extends benchmark/test/doc coverage to keep the audit honest.

Changes:

  • New PatternKitHostingIntegrationCatalog (with descriptor, enum, interface, and AddPatternKitHostingIntegrationCatalog DI extension) hard-coding the 9 reusable hosting APIs and falling back to example registrations for all other catalog patterns.
  • New BenchmarkRoute.HostingIntegration value, hosting-integration routes derived from the new catalog, a HostingIntegrationPatternMatrixBenchmarks coverage class, and a dedicated HostingExtensionsBenchmarks measuring registration / provider build / resolve-and-execute overhead.
  • TinyBDD scenarios validating the audit matrix and DI registration, plus benchmark-coverage tests that pin hosting routes against the published benchmark-results.md/hosting-extensions.md rows.

Reviewed changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/PatternKit.Examples/ProductionReadiness/PatternKitHostingIntegrationCatalog.cs Introduces the hosting integration descriptor/catalog/DI extension.
benchmarks/PatternKit.Benchmarks/Coverage/BenchmarkRoute.cs Adds HostingIntegration enum member.
benchmarks/PatternKit.Benchmarks/Coverage/PatternBenchmarkCoverage.cs Emits hosting-integration construction routes per reusable pattern.
benchmarks/PatternKit.Benchmarks/Coverage/PatternMatrixBenchmarks.cs Adds the hosting-integration coverage benchmark class.
benchmarks/PatternKit.Benchmarks/Hosting/HostingExtensionsBenchmarks.cs Dedicated benchmark measuring DI registration, provider build, and resolve/execute.
benchmarks/PatternKit.Benchmarks/PatternKit.Benchmarks.csproj Adds project reference to PatternKit.Hosting.Extensions.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs TinyBDD scenarios auditing the hosting catalog and DI registration.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs Ensures hosting routes exist and are published in benchmark-results.md.
docs/guides/hosting-extensions.md Documents the current reusable hosting coverage table.
docs/guides/benchmark-results.md Adds Hosting Extensions timing rows and a hosting-integration matrix table.

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

Comment on lines +41 to +42
public ServiceProvider Construction_BuildProvider()
=> CreateConfiguredServices().BuildServiceProvider(validateScopes: true);
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   10m 11s ⏱️
 3 517 tests  3 517 ✅ 0 💤 0 ❌
10 562 runs  10 562 ✅ 0 💤 0 ❌

Results for commit f677e93.

@github-actions

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 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.07692% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.63%. Comparing base (d2b4b20) to head (f677e93).

Files with missing lines Patch % Lines
...onReadiness/PatternKitHostingIntegrationCatalog.cs 98.07% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #406      +/-   ##
==========================================
+ Coverage   89.56%   95.63%   +6.07%     
==========================================
  Files         530      531       +1     
  Lines       42899    42951      +52     
  Branches     6203     6204       +1     
==========================================
+ Hits        38421    41078    +2657     
+ Misses       2022     1873     -149     
+ Partials     2456        0    -2456     
Flag Coverage Δ
unittests 95.63% <98.07%> (+6.07%) ⬆️

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/28/2026 - 05:04:28
  Coverage date: 05/28/2026 - 05:00:37 - 05/28/2026 - 05:04:16
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1616
  Files: 650
  Line coverage: 94.6%
  Covered lines: 42113
  Uncovered lines: 2388
  Coverable lines: 44501
  Total lines: 97228
  Branch coverage: 75.5% (12376 of 16382)
  Covered branches: 12376
  Total branches: 16382
  Method coverage: 96% (8436 of 8782)
  Full method coverage: 88.1% (7741 of 8782)
  Covered methods: 8436
  Fully covered methods: 7741
  Total methods: 8782

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 ae9e09d into main May 28, 2026
13 checks passed
@JerrettDavis
JerrettDavis deleted the chore/close-analyzer-and-hosting-matrix branch May 28, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants