feat: add materialized view pattern support#270
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Test Results689 tests 689 ✅ 32s ⏱️ Results for commit 029459c. ♻️ 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. |
There was a problem hiding this comment.
Pull request overview
Adds first-class support for the Materialized View application architecture pattern across PatternKit’s runtime, Roslyn generator surface, examples, and documentation—expanding the Pattern Catalog and providing end-to-end tested coverage (runtime + generator + DI + example).
Changes:
- Introduces
IMaterializedView<TState,TEvent>+ fluentMaterializedView<TState,TEvent>runtime with ordered sync/async handlers. - Adds
[GenerateMaterializedView]/[MaterializedViewHandler]attributes and an incremental generator that emits materialized view factory methods plus diagnostics. - Adds a production-shaped order read-model example (fluent + generated), DI integration, documentation, and TinyBDD tests; updates pattern/example catalogs accordingly.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/PatternKit.Tests/Application/MaterializedViews/MaterializedViewTests.cs | Adds TinyBDD runtime tests for ordering, projection, and validation. |
| test/PatternKit.Generators.Tests/MaterializedViewGeneratorTests.cs | Adds generator tests for emitted factory source and diagnostics. |
| test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs | Extends attribute coverage tests to include new MV attributes. |
| test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs | Updates pattern catalog expectations for the new pattern. |
| test/PatternKit.Examples.Tests/MaterializedViewDemo/OrderMaterializedViewDemoTests.cs | Adds example-level tests validating fluent/generated read model behavior. |
| test/PatternKit.Examples.Tests/DependencyInjection/PatternKitExampleDependencyInjectionTests.cs | Verifies DI-registered MV example is resolvable and runnable. |
| src/PatternKit.Generators/MaterializedViews/MaterializedViewGenerator.cs | Implements the incremental generator and diagnostics PKMV001-003. |
| src/PatternKit.Generators/AnalyzerReleases.Unshipped.md | Registers new analyzer diagnostic IDs for the MV generator. |
| src/PatternKit.Generators.Abstractions/MaterializedViews/MaterializedViewAttributes.cs | Adds generator-facing attribute definitions for MV factories/handlers. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs | Adds MV to the pattern coverage catalog with doc/source/test links. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs | Adds MV to the example catalog metadata. |
| src/PatternKit.Examples/MaterializedViewDemo/OrderMaterializedViewDemo.cs | Introduces the order MV demo (fluent + generated) and DI registrations. |
| src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs | Wires MV example into the shared example DI registration surface. |
| src/PatternKit.Core/Application/MaterializedViews/MaterializedView.cs | Adds the MV runtime interface + fluent builder + ordered projection engine. |
| docs/patterns/toc.yml | Adds MV to the Application Architecture pattern TOC. |
| docs/patterns/application/materialized-view.md | Adds MV pattern documentation and usage example. |
| docs/guides/pattern-coverage.md | Adds MV to the pattern coverage guide table. |
| docs/generators/toc.yml | Adds MV generator doc to generator TOC. |
| docs/generators/materialized-view.md | Adds MV generator documentation, example, and diagnostic list. |
| docs/generators/index.md | Adds MV to the generator index table. |
| docs/examples/toc.yml | Adds MV example doc to examples TOC. |
| docs/examples/order-materialized-view-pattern.md | Adds production-shaped MV example documentation and usage snippet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #270 +/- ##
==========================================
+ Coverage 90.49% 96.01% +5.52%
==========================================
Files 356 360 +4
Lines 31830 32159 +329
Branches 4475 4523 +48
==========================================
+ Hits 28804 30878 +2074
+ Misses 1361 1281 -80
+ Partials 1665 0 -1665
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
Closes #265
Local validation
MaterializedViewGeneratorTests|FullyQualifiedNameAbstractionsAttributeCoverageTests" /p:BuildProjectReferences=false /p:UseSharedCompilation=falseNote: local examples build still hits the known Roslyn analyzer/compiler mismatch (CS9057) before generated example types are emitted; hosted CI remains authoritative for examples.