feat: add external configuration store pattern support#280
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Test Results713 tests 713 ✅ 27s ⏱️ Results for commit 4bbfbe2. ♻️ 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 #280 +/- ##
==========================================
+ Coverage 90.45% 96.02% +5.57%
==========================================
Files 380 384 +4
Lines 33338 33640 +302
Branches 4673 4716 +43
==========================================
+ Hits 30156 32303 +2147
+ Misses 1437 1337 -100
+ Partials 1745 0 -1745
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:
|
There was a problem hiding this comment.
Pull request overview
Adds a new “External Configuration Store” cloud architecture pattern to PatternKit, including a typed runtime store, a Roslyn source generator, a production-shaped DI example, and updated catalog/docs/tests to ensure coverage.
Changes:
- Introduces
ExternalConfigurationStore<TSettings>runtime API with loader, validation rules, and optional time-based caching. - Adds
[GenerateExternalConfigurationStore]generator + supporting attributes/diagnostics, plus generator test coverage. - Registers and documents a tenant-focused example (fluent + generated + DI import), and updates catalogs/TOCs/coverage checks.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/PatternKit.Tests/Cloud/ExternalConfigurationStore/ExternalConfigurationStoreTests.cs | Adds TinyBDD coverage for runtime store behavior (load/validate/cache and builder argument checks). |
| test/PatternKit.Generators.Tests/ExternalConfigurationStoreGeneratorTests.cs | Adds Roslyn generator tests for output + diagnostics (PKECS001–PKECS004). |
| test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs | Extends attribute coverage tests to include new cloud generator attributes and validates basic defaults/guards. |
| test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs | Updates pattern catalog expectations to include “External Configuration Store” and adjusts cloud pattern count. |
| test/PatternKit.Examples.Tests/ExternalConfigurationStoreDemo/TenantExternalConfigurationStoreDemoTests.cs | Adds example-level tests for fluent path, generated path, and DI import paths. |
| test/PatternKit.Examples.Tests/DependencyInjection/PatternKitExampleDependencyInjectionTests.cs | Ensures the new example is registered and usable via the aggregate AddPatternKitExamples() path. |
| src/PatternKit.Generators/Cloud/ExternalConfigurationStoreGenerator.cs | Implements incremental generator to emit a typed store factory from one loader + ordered validators. |
| src/PatternKit.Generators/AnalyzerReleases.Unshipped.md | Registers new generator diagnostic IDs (PKECS001–PKECS004). |
| src/PatternKit.Generators.Abstractions/Cloud/ExternalConfigurationStoreAttributes.cs | Adds generator attribute surface: [GenerateExternalConfigurationStore], [ExternalConfigurationLoader], [ExternalConfigurationValidator]. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs | Adds the new pattern entry to the catalog with docs/source/tests/generator/example references. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs | Adds “Tenant External Configuration Store” example descriptor + integration surface flags. |
| src/PatternKit.Examples/ExternalConfigurationStoreDemo/TenantExternalConfigurationStoreDemo.cs | Implements tenant settings demo (provider, fluent store, generated store annotations, runner, DI wiring). |
| src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs | Registers the new example into the DI composition pipeline and exposes a typed example record. |
| src/PatternKit.Core/Cloud/ExternalConfigurationStore/ExternalConfigurationStore.cs | Adds the core runtime abstraction: snapshot/result types + fluent builder + caching/validation pipeline. |
| docs/patterns/toc.yml | Adds External Configuration Store to the cloud patterns TOC. |
| docs/patterns/cloud/external-configuration-store.md | Adds pattern documentation and a minimal fluent usage snippet. |
| docs/guides/pattern-coverage.md | Updates pattern coverage guide table to include External Configuration Store. |
| docs/generators/toc.yml | Adds generator docs TOC entry for External Configuration Store. |
| docs/generators/index.md | Adds generator index table entry for External Configuration Store. |
| docs/generators/external-configuration-store.md | Adds generator usage documentation and required loader/validator signatures. |
| docs/examples/toc.yml | Adds the tenant external configuration store example to the examples TOC. |
| docs/examples/tenant-external-configuration-store.md | Adds example documentation summary and pointers to implementation/tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// <summary>Gets validated configuration, reusing the cached snapshot while it remains fresh.</summary> | ||
| public async ValueTask<ExternalConfigurationResult<TSettings>> GetAsync(CancellationToken cancellationToken = default) | ||
| { | ||
| var cached = GetFreshCachedSnapshot(); | ||
| if (cached is not null) |
| /// <summary>Provider registry used by source-generated static loader methods.</summary> | ||
| public static class TenantConfigurationProviderRegistry | ||
| { | ||
| public static TenantConfigurationProvider Provider { get; set; } = new(); | ||
| } |
Code Coverage |
Closes #275
Adds the External Configuration Store cloud architecture pattern with: