feat: add ports and adapters pattern#497
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 a first-class “Ports and Adapters” (hexagonal architecture) pattern across PatternKit’s runtime APIs, source generator, examples, benchmarks, and docs—integrating it into the production-readiness catalog/coverage gates.
Changes:
- Introduces
PortsAndAdaptersPipeline<...>fluent runtime API + TinyBDD runtime coverage. - Adds
[GeneratePortsAndAdapters]abstractions and a Roslyn incremental generator + generator tests/diagnostics registration. - Integrates the new pattern into catalogs, docs navigation, examples (including
IServiceCollectionimport), and BenchmarkDotNet coverage/docs counts.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/PatternKit.Core/Application/PortsAndAdapters/PortsAndAdaptersPipeline.cs |
Adds the fluent runtime pipeline API and builder. |
src/PatternKit.Generators.Abstractions/PortsAndAdapters/PortsAndAdaptersAttributes.cs |
Adds generator-facing attributes for ports/adapters declarations. |
src/PatternKit.Generators/PortsAndAdapters/PortsAndAdaptersGenerator.cs |
Implements the incremental generator emitting pipeline factories + diagnostics. |
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md |
Registers new analyzer diagnostic IDs (PKPA001–PKPA004). |
test/PatternKit.Tests/Application/PortsAndAdapters/PortsAndAdaptersPipelineTests.cs |
TinyBDD runtime tests for fluent pipeline behavior + validation. |
test/PatternKit.Generators.Tests/PortsAndAdaptersGeneratorTests.cs |
Validates generator output and diagnostics via Roslyn test harness. |
src/PatternKit.Examples/PortsAndAdaptersDemo/OrderEntryPortsAndAdaptersDemo.cs |
Adds an importable example with fluent + generated paths and DI registration. |
test/PatternKit.Examples.Tests/PortsAndAdaptersDemo/OrderEntryPortsAndAdaptersDemoTests.cs |
Tests the example for fluent/generated correctness and DI importability. |
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs |
Wires the new example into the shared examples DI registration surface. |
benchmarks/PatternKit.Benchmarks/Application/PortsAndAdaptersBenchmarks.cs |
Adds benchmark coverage for fluent vs generated construction/execution. |
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs |
Adds Ports and Adapters to the production-readiness pattern catalog. |
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs |
Adds the new demo to the example catalog. |
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs |
Updates pattern list and family counts for the new pattern. |
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs |
Updates expected route-result totals and humanization for new benchmark class. |
README.md |
Updates pattern counts and table to include Ports and Adapters. |
docs/index.md |
Updates pattern counts and table to include Ports and Adapters. |
docs/patterns/toc.yml |
Adds Ports and Adapters to patterns TOC. |
docs/patterns/application/ports-and-adapters.md |
Adds pattern documentation page. |
docs/generators/toc.yml |
Adds Ports and Adapters generator doc to TOC. |
docs/generators/index.md |
Adds generator overview entry for Ports and Adapters. |
docs/generators/ports-and-adapters.md |
Adds generator documentation page. |
docs/examples/toc.yml |
Adds order-entry ports/adapters example to examples TOC. |
docs/examples/index.md |
Adds ports/adapters example overview entry. |
docs/examples/order-entry-ports-and-adapters.md |
Adds the example documentation page. |
docs/guides/benchmark-results.md |
Updates benchmark results matrix entries and coverage totals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 11m 19s ⏱️ Results for commit 3c7e15b. ♻️ 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. |
92ed2ed to
3c7e15b
Compare
Code Coverage |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #497 +/- ##
=========================================
Coverage 97.40% 97.40%
=========================================
Files 599 603 +4
Lines 49014 49238 +224
Branches 3167 34 -3133
=========================================
+ Hits 47742 47961 +219
- Misses 1272 1277 +5
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:
|
Closes #484.\n\nAdds a Ports and Adapters / hexagonal architecture pattern with fluent runtime APIs, source generator, TinyBDD coverage, IServiceCollection-backed example, benchmark coverage, and docs/catalog updates.\n\nValidation run locally:\n- dotnet build PatternKit.slnx --configuration Release --no-restore -p:UseSharedCompilation=false\n- dotnet test test/PatternKit.Tests/PatternKit.Tests.csproj --configuration Release --framework net8.0 --no-build -p:TestTfmsInParallel=false -p:UseSharedCompilation=false\n- dotnet test test/PatternKit.Generators.Tests/PatternKit.Generators.Tests.csproj --configuration Release --framework net8.0 --no-build -p:TestTfmsInParallel=false -p:UseSharedCompilation=false\n- dotnet test test/PatternKit.Hosting.Extensions.Tests/PatternKit.Hosting.Extensions.Tests.csproj --configuration Release --framework net8.0 --no-build -p:TestTfmsInParallel=false -p:UseSharedCompilation=false\n- dotnet test test/PatternKit.Examples.Tests/PatternKit.Examples.Tests.csproj --configuration Release --framework net8.0 --no-build -p:TestTfmsInParallel=false -p:UseSharedCompilation=false\n- dotnet format PatternKit.slnx --verify-no-changes --verbosity minimal\n- docfx metadata docs/docfx.json; docfx build docs/docfx.json