feat: add table data gateway pattern support#261
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Test Results 1 files 1 suites 1m 48s ⏱️ Results for commit 5e01394. |
🔍 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. |
There was a problem hiding this comment.
Pull request overview
Adds a first-class Table Data Gateway slice to PatternKit, including a runtime in-memory gateway, a Roslyn source generator + attributes for factory generation, an end-to-end example (fluent + generated + DI), and documentation/catalog updates to make the pattern discoverable and covered by CI.
Changes:
- Introduces
ITableDataGateway<TRow,TKey>,InMemoryTableDataGateway<TRow,TKey>, and mutation result types (TableGatewayResult,TableGatewayStatus). - Adds
TableDataGatewayGeneratorplus new[GenerateTableDataGateway]/[TableGatewayKeySelector]attributes and generator tests. - Adds example/demo + test coverage, and updates docs/catalog/tocs to include the new pattern.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/PatternKit.Tests/Application/TableDataGateway/TableDataGatewayTests.cs | Adds runtime behavior and argument validation coverage for the in-memory table gateway. |
| test/PatternKit.Generators.Tests/TableDataGatewayGeneratorTests.cs | Adds Roslyn-based generator tests for emitted factory source and diagnostics. |
| test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs | Extends attribute coverage matrix to include the new TDG attributes and default/config checks. |
| test/PatternKit.Examples.Tests/TableDataGatewayDemo/OrderTableDataGatewayDemoTests.cs | Adds end-to-end example tests for fluent vs generated paths and DI importability. |
| test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs | Updates the expected catalog pattern set/count to include Table Data Gateway. |
| test/PatternKit.Examples.Tests/DependencyInjection/PatternKitExampleDependencyInjectionTests.cs | Ensures the new example is registered and runnable via the examples DI extension set. |
| src/PatternKit.Generators/TableDataGateway/TableDataGatewayGenerator.cs | New incremental generator that emits an InMemoryTableDataGateway factory from an attributed key selector. |
| src/PatternKit.Generators/AnalyzerReleases.Unshipped.md | Registers the new generator diagnostic IDs (PKTDG001-003). |
| src/PatternKit.Generators.Abstractions/TableDataGateway/TableDataGatewayAttributes.cs | Adds the public attributes consumed by the generator. |
| src/PatternKit.Examples/TableDataGatewayDemo/OrderTableDataGatewayDemo.cs | Adds a production-shaped example demonstrating fluent + generated gateway composition and a scoped workflow. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs | Adds the pattern entry wiring docs/source/tests/example into the catalog. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs | Adds the example descriptor entry for the new pattern demo. |
| src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs | Adds DI registration for the Table Data Gateway example into the broader examples pack. |
| src/PatternKit.Core/Application/TableDataGateway/TableDataGateway.cs | Adds the Table Data Gateway runtime API + in-memory implementation + result types. |
| docs/patterns/toc.yml | Adds Table Data Gateway to the application architecture patterns TOC. |
| docs/patterns/application/table-data-gateway.md | New user-facing pattern page describing runtime usage and when to use the generator. |
| docs/guides/pattern-coverage.md | Updates the coverage guide to include Table Data Gateway in the application architecture table. |
| docs/generators/toc.yml | Adds Table Data Gateway to the generators TOC. |
| docs/generators/table-data-gateway.md | New generator documentation page (usage + diagnostics). |
| docs/generators/index.md | Adds Table Data Gateway to the generators index table. |
| docs/examples/toc.yml | Adds the Order Table Data Gateway example to the examples TOC. |
| docs/examples/order-table-data-gateway-pattern.md | New example write-up for the order table gateway demo and DI import guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sb.Append(GetAccessibility(type.DeclaredAccessibility)).Append(' '); | ||
| if (type.IsStatic) | ||
| sb.Append("static "); | ||
| else if (type.IsAbstract && type.TypeKind == TypeKind.Class) | ||
| sb.Append("abstract "); | ||
| else if (type.IsSealed && type.TypeKind == TypeKind.Class) | ||
| sb.Append("sealed "); | ||
| sb.Append("partial ").Append(type.TypeKind == TypeKind.Struct ? "struct" : "class").Append(' ').Append(type.Name).AppendLine(); | ||
| sb.AppendLine("{"); |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #261 +/- ##
==========================================
+ Coverage 90.64% 96.07% +5.43%
==========================================
Files 340 344 +4
Lines 30907 31128 +221
Branches 4335 4371 +36
==========================================
+ Hits 28016 29907 +1891
+ Misses 1294 1221 -73
+ Partials 1597 0 -1597
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 |
Closes #257.\n\nAdds the Table Data Gateway application architecture pattern with a fluent row gateway, source-generated gateway factories, TinyBDD runtime/generator/example coverage, production-shaped IServiceCollection integration, and docs/catalog entries.