From 80668a07bdeb6d96fc3f6adda9a0797e51db7bbb Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 24 Jul 2026 05:38:36 -0400 Subject: [PATCH] =?UTF-8?q?feat(health):=200.2.0=20=E2=80=94=20optional=20?= =?UTF-8?q?per-entry=20`data`=20+=20Akka=20cluster-view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 0 of docs/plans/2026-07-22-overview-dashboard-impl-plan.md: give the canonical health JSON a structured channel so the family overview dashboard can read each Akka cluster's current leader. - ZbHealthWriter: optional `"data": {...}` per entry, sourced from HealthReportEntry.Data, emitted only when non-empty. Per-property JsonIgnore (NOT a global DefaultIgnoreCondition) so `"description": null` still renders — payloads from data-less checks stay byte-identical to 0.1.0. - AkkaClusterHealthCheck: BuildClusterData publishes this node's own view — leader (omitted while unknown), selfAddress, selfRoles (sorted), memberCount, unreachableCount — on every result path. The startup-safety paths (no ActorSystem / cluster inaccessible) stay description-only. - Tests: writer data emit/omit (raw-JSON assert on the omit case), and a real single-node self-joined cluster via Akka.TestKit.Xunit2 for the data values. 70 tests green (25/39/6). - Version 0.1.0 -> 0.2.0; 3 packages published to the Gitea feed and restore-verified from a scratch consumer, which serves data.leader live. --- ZB.MOM.WW.Health/CLAUDE.md | 12 +- ZB.MOM.WW.Health/Directory.Build.props | 2 +- ZB.MOM.WW.Health/README.md | 32 ++++-- .../AkkaClusterHealthCheck.cs | 48 +++++++- .../src/ZB.MOM.WW.Health/ZbHealthWriter.cs | 22 +++- .../AkkaClusterDataTests.cs | 107 ++++++++++++++++++ .../AkkaClusterStatusPolicyTests.cs | 2 + .../ZB.MOM.WW.Health.Akka.Tests.csproj | 1 + .../ResponseWriterTests.cs | 58 +++++++++- ...overview-dashboard-impl-plan.md.tasks.json | 25 ++++ 10 files changed, 281 insertions(+), 28 deletions(-) create mode 100644 ZB.MOM.WW.Health/tests/ZB.MOM.WW.Health.Akka.Tests/AkkaClusterDataTests.cs create mode 100644 docs/plans/2026-07-22-overview-dashboard-impl-plan.md.tasks.json diff --git a/ZB.MOM.WW.Health/CLAUDE.md b/ZB.MOM.WW.Health/CLAUDE.md index 10b2633..f00befc 100644 --- a/ZB.MOM.WW.Health/CLAUDE.md +++ b/ZB.MOM.WW.Health/CLAUDE.md @@ -4,7 +4,7 @@ Health-check libraries for the **ZB.MOM.WW SCADA family** (OtOpcUa, MxAccessGate The library normalizes the three-tier health endpoint convention (`/health/ready`, `/health/active`, `/healthz`) and provides reusable probe implementations so the three sister projects share a common surface without duplicating probe logic. -**Built at 0.1.0. NOT yet adopted by the three apps.** Adoption is tracked in `~/Desktop/scadaproj/components/health/GAPS.md`. +**Built at 0.2.0 and published to the Gitea NuGet feed. Adopted by all four apps** — adoption is tracked in `~/Desktop/scadaproj/components/health/GAPS.md`. --- @@ -46,14 +46,14 @@ dotnet test ZB.MOM.WW.Health.slnx dotnet pack ZB.MOM.WW.Health.slnx -c Release -o ./artifacts ``` -All three test assemblies run offline: +All three test assemblies run offline (the cluster-data tests form a single-node in-process Akka cluster on a loopback port): | Assembly | Tests | |---|---| -| `ZB.MOM.WW.Health.Tests` | 20 | -| `ZB.MOM.WW.Health.Akka.Tests` | 32 | +| `ZB.MOM.WW.Health.Tests` | 25 | +| `ZB.MOM.WW.Health.Akka.Tests` | 39 | | `ZB.MOM.WW.Health.EntityFrameworkCore.Tests` | 6 | -| **Total** | **58** | +| **Total** | **70** | `GeneratePackageOnBuild` is off — pack explicitly with the command above. @@ -61,7 +61,7 @@ All three test assemblies run offline: ## Status -Built at **0.1.0** and published to the Gitea NuGet feed. **Not yet adopted** by the three apps — adoption is tracked in the component backlog: +Built at **0.2.0** and published to the Gitea NuGet feed. **Adopted** by all four apps — adoption is tracked in the component backlog: - `~/Desktop/scadaproj/components/health/GAPS.md` — adoption order, effort, and risk diff --git a/ZB.MOM.WW.Health/Directory.Build.props b/ZB.MOM.WW.Health/Directory.Build.props index 4b5ab79..88c5a32 100644 --- a/ZB.MOM.WW.Health/Directory.Build.props +++ b/ZB.MOM.WW.Health/Directory.Build.props @@ -5,7 +5,7 @@ enable enable latest - 0.1.0 + 0.2.0 true