feat: add Read-Through and Write-Through Cache patterns#457
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 Read-Through and Write-Through Cache support across the runtime library, source generator surface, examples, docs, benchmarks, and production-readiness catalogs.
Changes:
- Introduces
ReadWriteThroughCachePolicy<TResult>for cache-owned reads, write-through updates, invalidation, TTL, and shared cache-store support. - Adds
[GenerateReadWriteThroughCachePolicy], generator diagnostics/output tests, and generated factory documentation. - Adds product catalog examples, DI registration, catalog entries, benchmark coverage rows, and TinyBDD coverage.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/PatternKit.Core/Cloud/ReadWriteThroughCache/ReadWriteThroughCachePolicy.cs |
Adds runtime read/write-through cache policy and result model. |
src/PatternKit.Generators.Abstractions/ReadWriteThroughCache/ReadWriteThroughCacheAttributes.cs |
Adds generator attribute abstraction. |
src/PatternKit.Generators/ReadWriteThroughCache/ReadWriteThroughCachePolicyGenerator.cs |
Adds source generator for cache policy factories. |
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md |
Registers new generator diagnostics. |
src/PatternKit.Examples/ReadWriteThroughCacheDemo/ProductCatalogReadWriteThroughCacheDemo.cs |
Adds product catalog runtime/generated/DI example. |
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs |
Wires the new example into aggregate DI registration. |
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs |
Adds Read-Through and Write-Through Cache catalog entries. |
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs |
Adds example catalog descriptor. |
benchmarks/PatternKit.Benchmarks/Cloud/ReadWriteThroughCacheBenchmarks.cs |
Adds construction/execution benchmarks. |
test/PatternKit.Tests/Cloud/ReadWriteThroughCache/ReadWriteThroughCachePolicyTests.cs |
Adds runtime policy behavior tests. |
test/PatternKit.Generators.Tests/ReadWriteThroughCachePolicyGeneratorTests.cs |
Adds generator output/diagnostic tests. |
test/PatternKit.Generators.Tests/AbstractionsTests.cs |
Adds abstraction constructor/usage tests. |
test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs |
Adds abstraction coverage entries. |
test/PatternKit.Examples.Tests/ReadWriteThroughCacheDemo/ProductCatalogReadWriteThroughCacheDemoTests.cs |
Adds example and DI behavior tests. |
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs |
Updates pattern counts and expected catalog names. |
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitBenchmarkCoverageTests.cs |
Updates benchmark route totals and humanization. |
README.md |
Updates pattern counts and benchmark matrix rows. |
docs/index.md |
Updates public pattern counts/table. |
docs/patterns/toc.yml |
Adds pattern documentation TOC entry. |
docs/patterns/cloud/read-write-through-cache.md |
Adds pattern documentation. |
docs/generators/index.md |
Adds generator index entry. |
docs/generators/toc.yml |
Adds generator TOC entry. |
docs/generators/read-write-through-cache.md |
Adds generator documentation. |
docs/examples/toc.yml |
Adds example TOC entry. |
docs/examples/product-catalog-read-write-through-cache.md |
Adds example documentation. |
docs/guides/pattern-coverage.md |
Updates pattern coverage guide. |
docs/guides/benchmarks.md |
Adds benchmark guide rows. |
docs/guides/benchmark-results.md |
Updates benchmark result rows and coverage totals. |
💡 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("{"); | ||
| sb.Append(" public static global::PatternKit.Cloud.ReadWriteThroughCache.ReadWriteThroughCachePolicy<").Append(resultTypeName).Append("> ").Append(factoryMethodName).AppendLine("()"); |
Test Results 12 files 12 suites 11m 34s ⏱️ Results for commit 4391b20. ♻️ 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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #457 +/- ##
==========================================
+ Coverage 96.64% 96.82% +0.17%
==========================================
Files 563 567 +4
Lines 45742 45979 +237
Branches 3011 6611 +3600
==========================================
+ Hits 44208 44519 +311
+ Misses 1534 1460 -74
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:
|
6379ba2 to
4391b20
Compare
Code Coverage |
Summary
Closes #450
Verification
ReadWriteThroughCachePolicyGeneratorTests|FullyQualifiedNameAbstractions" -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"ReadWriteThroughCacheDemo|FullyQualifiedNameProductionReadiness|FullyQualifiedName~DependencyInjection" -p:TestTfmsInParallel=false --logger "console;verbosity=minimal"