docs: add GoF pattern coverage catalog#208
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Test Results 1 files 1 suites 2m 41s ⏱️ Results for commit 5cc4b15. |
🔍 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. |
Code Coverage |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #208 +/- ##
==========================================
+ Coverage 91.82% 96.64% +4.81%
==========================================
Files 254 255 +1
Lines 23498 23842 +344
Branches 3269 3270 +1
==========================================
+ Hits 21578 23041 +1463
+ Misses 857 801 -56
+ Partials 1063 0 -1063
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 “source-of-truth” GoF (23 patterns) coverage catalog to the PatternKit.Examples production-readiness surface, plus documentation and CI validation to ensure each pattern has the expected fluent/docs/tests/examples (and explicitly tracked generator gaps).
Changes:
- Introduces
PatternKitPatternCatalog/IPatternKitPatternCatalogwith per-pattern implementation paths and integration notes, plusIServiceCollectionregistration. - Adds TinyBDD tests that verify the catalog covers all 23 canonical GoF patterns and that referenced repo paths exist (allowing only the explicitly tracked generator gaps).
- Adds a new docs guide page for “Pattern Coverage” and updates existing docs to include/consume the new catalog.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs | Adds TinyBDD coverage to validate the GoF catalog contents, file-path existence, and DI registration. |
| src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs | Implements the GoF pattern coverage catalog model + static catalog entries + DI extension. |
| src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs | Wires the new pattern catalog into the “production-ready integrations” DI bundle. |
| docs/guides/toc.yml | Adds the new “Pattern Coverage” guide to the guides ToC. |
| docs/guides/pattern-coverage.md | Documents the catalog’s purpose and current GoF coverage matrix. |
| docs/examples/production-ready-integrations.md | Updates docs to show resolving IPatternKitPatternCatalog alongside the example catalog. |
Comments suppressed due to low confidence (1)
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs:138
ValidatePatternonly validates generator docs/source/test paths when all three are present (HasSourceGeneratedPath). If a pattern accidentally has a partially-filled generator path (e.g., docs set but tests missing) while also havingTrackingIssueUrlset, the test will treat it as an approved tracked gap and will not report the partial path configuration. Consider explicitly detecting and failing on incomplete generator path configurations (any-but-not-all of the generator paths set), and also failing if a tracked gap includes any generator path values.
if (implementation.HasSourceGeneratedPath)
{
foreach (var issue in ValidatePath(repositoryRoot, pattern.Name, "generator docs", implementation.GeneratorDocumentationPath!))
yield return issue;
foreach (var issue in ValidatePath(repositoryRoot, pattern.Name, "generator source", implementation.GeneratorSourcePath!))
yield return issue;
foreach (var issue in ValidatePath(repositoryRoot, pattern.Name, "generator tests", implementation.GeneratorTestPath!))
yield return issue;
}
else if (implementation.HasTrackedGeneratorGap)
{
yield return $"{pattern.Name} has a tracked source-generated gap: {implementation.TrackingIssueUrl}";
}
else
{
yield return $"{pattern.Name} is missing a source-generated path and a tracking issue.";
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .When("resolving the catalog", provider => | ||
| { | ||
| using (provider) | ||
| return provider.GetRequiredService<IPatternKitPatternCatalog>(); | ||
| }) | ||
| .Then("the catalog resolves all GoF patterns", catalog => | ||
| ScenarioExpect.Equal(CanonicalGofPatterns.Length, catalog.Patterns.Count)) | ||
| .And("all patterns include user-facing integration notes", catalog => | ||
| ScenarioExpect.True(catalog.Patterns.All(static pattern => pattern.IntegrationNotes.Count > 0))) |
| public static class PatternKitPatternCatalogServiceCollectionExtensions | ||
| { | ||
| public static IServiceCollection AddPatternKitPatternCatalog(this IServiceCollection services) | ||
| { | ||
| services.AddSingleton<IPatternKitPatternCatalog, PatternKitPatternCatalog>(); | ||
| return services; | ||
| } |
Summary\n- add a production-readiness catalog for the canonical 23 GoF patterns\n- document fluent, source-generated, test, and real-world example paths\n- add TinyBDD coverage for the matrix and IServiceCollection registration\n- track remaining generator gaps in #206 and #207\n\n## Validation\n- git diff --check\n- catalog path existence check\n- dotnet test test/PatternKit.Examples.Tests/PatternKit.Examples.Tests.csproj -c Release --no-restore (blocked locally by existing CS9057 compiler/analyzer mismatch; CI has the authoritative SDK)