Skip to content

feat: add external configuration store pattern support#280

Merged
JerrettDavis merged 2 commits into
mainfrom
feat/external-configuration-store-pattern
May 21, 2026
Merged

feat: add external configuration store pattern support#280
JerrettDavis merged 2 commits into
mainfrom
feat/external-configuration-store-pattern

Conversation

@JerrettDavis
Copy link
Copy Markdown
Owner

Closes #275

Adds the External Configuration Store cloud architecture pattern with:

  • runtime fluent ExternalConfigurationStore API
  • [GenerateExternalConfigurationStore] source generator and diagnostics
  • production-shaped tenant feature settings example with IServiceCollection registration
  • docs, catalog entries, and TinyBDD coverage

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Test Results

713 tests   713 ✅  27s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 4bbfbe2.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

🔍 PR Validation Results

Version: ``

✅ Validation Steps

  • Build solution
  • Run tests
  • Build documentation
  • Dry-run NuGet packaging

📊 Artifacts

Dry-run artifacts have been uploaded and will be available for 7 days.


This comment was automatically generated by the PR validation workflow.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 98.35526% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.02%. Comparing base (2c61836) to head (4bbfbe2).

Files with missing lines Patch % Lines
...ators/Cloud/ExternalConfigurationStoreGenerator.cs 97.08% 4 Missing ⚠️
...nStoreDemo/TenantExternalConfigurationStoreDemo.cs 97.72% 1 Missing ⚠️
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     
Flag Coverage Δ
unittests 96.02% <98.35%> (+5.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +28 to +32
/// <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)
Comment on lines +26 to +30
/// <summary>Provider registry used by source-generated static loader methods.</summary>
public static class TenantConfigurationProviderRegistry
{
public static TenantConfigurationProvider Provider { get; set; } = new();
}
@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/21/2026 - 21:29:44
  Coverage date: 05/21/2026 - 21:28:26 - 05/21/2026 - 21:29:33
  Parser: MultiReport (9x Cobertura)
  Assemblies: 4
  Classes: 1088
  Files: 467
  Line coverage: 94.8%
  Covered lines: 33215
  Uncovered lines: 1809
  Coverable lines: 35024
  Total lines: 77938
  Branch coverage: 76.6% (9656 of 12604)
  Covered branches: 9656
  Total branches: 12604
  Method coverage: 96.5% (6266 of 6491)
  Full method coverage: 88.4% (5744 of 6491)
  Covered methods: 6266
  Fully covered methods: 5744
  Total methods: 6491

PatternKit.Core                                                                                                    96.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionLayer<T1, T2>                                                90.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionResult<T>                                                     100%
  PatternKit.Application.AuditLog.AuditLogAppendResult<T>                                                          85.7%
  PatternKit.Application.AuditLog.InMemoryAuditLog<T1, T2>                                                         95.4%
  PatternKit.Application.DataMapping.DataMapper<T1, T2>                                                            94.6%
  PatternKit.Application.DataMapping.DataMapperError                                                                 90%
  PatternKit.Application.DataMapping.DataMapperResult<T>                                                           84.6%
  PatternKit.Application.DomainEvents.DomainEventDispatcher<T>                                                     95.4%
  PatternKit.Application.DomainEvents.DomainEventDispatchResult                                                     100%
  PatternKit.Application.EventSourcing.EventStoreAppendResult                                                       100%
  PatternKit.Application.EventSourcing.InMemoryEventStore<T1, T2>                                                  97.9%
  PatternKit.Application.EventSourcing.StoredEvent<T1, T2>                                                           80%
  PatternKit.Application.FeatureToggles.FeatureToggleDecision                                                      87.5%
  PatternKit.Application.FeatureToggles.FeatureToggleRule<T>                                                        100%
  PatternKit.Application.FeatureToggles.FeatureToggleSet<T>                                                        96.9%
  PatternKit.Application.IdentityMap.IdentityMap<T1, T2>                                                            100%
  PatternKit.Application.IdentityMap.IdentityMapResult<T>                                                          92.8%
  PatternKit.Application.MaterializedViews.MaterializedView<T1, T2>                                                98.4%
  PatternKit.Application.Repository.InMemoryRepository<T1, T2>                                                     92.8%
  PatternKit.Application.Repository.RepositoryResult<T>                                                            93.3%
  PatternKit.Application.ServiceLayer.ServiceLayerOperation<T1, T2>                                                96.7%
  PatternKit.Application.ServiceLayer.ServiceLayerResult<T>                                                        94.7%
  PatternKit.Application.ServiceLayer.ServiceLayerRule<T>                                                           100%
  PatternKit.Application.Specification.Specification<T>                                                             100%
  PatternKit.Application.Specification.SpecificationRegistry<T>                                                    93.3%
  PatternKit.Application.TableDataGateway.InMemoryTableDataGateway<T1, T2>                                           86%
  PatternKit.Application.TableDataGateway.TableGatewayResult<T>                                                    82.3%
  PatternKit.Application.TransactionScript.TransactionScript<T1, T2>                                                 97%
  PatternKit.Application.TransactionScript.TransactionScriptError                                                    90%
  PatternKit.Application.TransactionScript.TransactionScriptResult<T>                                               100%
  PatternKit.Application.UnitOfWork.UnitOfWork                                                                     90.9%
  PatternKit.Application.UnitOfWork.UnitOfWorkResult                                                               94.7%
  PatternKit.Application.UnitOfWork.UnitOfWorkRollbackResult                                                        100%
  PatternKit.Application.UnitOfWork.UnitOfWorkStep                                                                  100%
  PatternKit.Behavioral.Chain.ActionChain<T>                                                                        100%
  PatternKit.Behavioral.Chain.AsyncActionChain<T>                                                                   100%
  PatternKit.Behavioral.Chain.AsyncResultChain<T1, T2>                                                             97.7%
  PatternKit.Behavioral.Chain.ResultChain<T1, T2>                                                                   100%

@JerrettDavis JerrettDavis merged commit 7010836 into main May 21, 2026
12 checks passed
@JerrettDavis JerrettDavis deleted the feat/external-configuration-store-pattern branch May 21, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add External Configuration Store cloud architecture pattern

2 participants