Skip to content

feat: add health endpoint monitoring pattern#306

Merged
JerrettDavis merged 1 commit into
mainfrom
feat/health-endpoint-monitoring-pattern
May 22, 2026
Merged

feat: add health endpoint monitoring pattern#306
JerrettDavis merged 1 commit into
mainfrom
feat/health-endpoint-monitoring-pattern

Conversation

@JerrettDavis
Copy link
Copy Markdown
Owner

Closes #302.

Adds Health Endpoint Monitoring runtime, generator, TinyBDD coverage, production-shaped IServiceCollection/ASP.NET Core example, docs, and catalog entries.

Local validation passed for focused core and generator builds/tests across net8/net9/net10. Local full examples tests still hit the known analyzer/compiler mismatch before this slice runs; hosted CI validates the full examples graph.

Copilot AI review requested due to automatic review settings May 22, 2026 05:15
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ 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

Test Results

  1 files    1 suites   2m 11s ⏱️
926 tests 926 ✅ 0 💤 0 ❌
931 runs  931 ✅ 0 💤 0 ❌

Results for commit dfaa499.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

❌ Patch coverage is 92.57812% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.00%. Comparing base (dc27f4c) to head (dfaa499).

Files with missing lines Patch % Lines
...intMonitoringDemo/FulfillmentHealthEndpointDemo.cs 84.61% 8 Missing ⚠️
...intMonitoring/HealthEndpointMonitoringGenerator.cs 92.79% 8 Missing ⚠️
...e/Cloud/HealthEndpointMonitoring/HealthEndpoint.cs 94.82% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #306      +/-   ##
==========================================
+ Coverage   90.31%   96.00%   +5.68%     
==========================================
  Files         428      432       +4     
  Lines       35980    36236     +256     
  Branches     5100     5137      +37     
==========================================
+ Hits        32497    34788    +2291     
+ Misses       1536     1448      -88     
+ Partials     1947        0    -1947     
Flag Coverage Δ
unittests 96.00% <92.57%> (+5.68%) ⬆️

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.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 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.

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 the Health Endpoint Monitoring pattern across runtime, generator, example/demo, tests, and documentation, integrating it into the PatternKit pattern/example catalogs and production-readiness coverage.

Changes:

  • Introduces a fluent HealthEndpoint<TContext> runtime API and accompanying report/check result types.
  • Adds a Roslyn incremental generator ([GenerateHealthEndpoint] / [HealthEndpointCheck]) plus generator tests and abstractions attribute coverage.
  • Adds a production-shaped DI + ASP.NET Core minimal API example (and tests), plus docs and catalog/toc updates.

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/Cloud/HealthEndpointMonitoring/HealthEndpointTests.cs Adds TinyBDD runtime coverage for fluent health endpoint evaluation and validation behavior.
test/PatternKit.Generators.Tests/HealthEndpointMonitoringGeneratorTests.cs Adds generator tests validating emitted factory code ordering, escaping, and diagnostics.
test/PatternKit.Generators.Tests/AbstractionsAttributeCoverageTests.cs Extends attribute coverage tests for new generator attributes and their defaults/guards.
test/PatternKit.Examples.Tests/ProductionReadiness/PatternKitPatternCatalogTests.cs Updates production-readiness catalog assertions for the newly added cloud pattern.
test/PatternKit.Examples.Tests/HealthEndpointMonitoringDemo/FulfillmentHealthEndpointDemoTests.cs Adds end-to-end tests for fluent vs generated endpoints, DI import, and ASP.NET Core mapping.
src/PatternKit.Generators/HealthEndpointMonitoring/HealthEndpointMonitoringGenerator.cs Implements the incremental generator that produces a HealthEndpoint<TContext> factory from static check methods.
src/PatternKit.Generators/AnalyzerReleases.Unshipped.md Registers new generator diagnostics (PKHEM001-003).
src/PatternKit.Generators.Abstractions/Cloud/HealthEndpointMonitoringAttributes.cs Adds generator attribute definitions for endpoint generation and check methods.
src/PatternKit.Examples/ProductionReadiness/PatternKitPatternCatalog.cs Registers the new pattern and its runtime/generator/example/doc/test artifacts in the catalog.
src/PatternKit.Examples/ProductionReadiness/PatternKitExampleCatalog.cs Registers the new fulfillment health endpoint monitoring example descriptor.
src/PatternKit.Examples/HealthEndpointMonitoringDemo/FulfillmentHealthEndpointDemo.cs Adds the demo: fluent + generated endpoints, DI registration, and minimal API route mapping.
src/PatternKit.Examples/DependencyInjection/PatternKitExampleServiceCollectionExtensions.cs Wires the new demo into the aggregate examples registration surface.
src/PatternKit.Core/Cloud/HealthEndpointMonitoring/HealthEndpoint.cs Adds the runtime implementation (endpoint, builder, report, check result).
docs/patterns/toc.yml Adds the new cloud pattern to the docs table of contents.
docs/patterns/cloud/health-endpoint-monitoring.md Adds the pattern doc page with fluent + generated usage pointers.
docs/guides/pattern-coverage.md Updates pattern coverage guide table with the new pattern/generator.
docs/generators/toc.yml Adds generator doc entry to TOC.
docs/generators/index.md Adds generator entry to the generator index table.
docs/generators/health-endpoint-monitoring.md Adds generator documentation and lists diagnostics.
docs/examples/toc.yml Adds example doc entry to TOC.
docs/examples/index.md Adds the example to the examples index list.
docs/examples/fulfillment-health-endpoint-monitoring.md Adds the example documentation page with DI + ASP.NET Core usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/22/2026 - 05:20:32
  Coverage date: 05/22/2026 - 05:18:32 - 05/22/2026 - 05:20:22
  Parser: MultiReport (9x Cobertura)
  Assemblies: 4
  Classes: 1255
  Files: 527
  Line coverage: 94.8%
  Covered lines: 35748
  Uncovered lines: 1922
  Coverable lines: 37670
  Total lines: 83322
  Branch coverage: 76.4% (10435 of 13642)
  Covered branches: 10435
  Total branches: 13642
  Method coverage: 96.3% (6910 of 7172)
  Full method coverage: 88.5% (6349 of 7172)
  Covered methods: 6910
  Fully covered methods: 6349
  Total methods: 7172

PatternKit.Core                                                                                                    96.1%
  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 0f1ee8c into main May 22, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the feat/health-endpoint-monitoring-pattern branch May 22, 2026 05:25
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 Health Endpoint Monitoring cloud architecture pattern

2 participants