dotnet: carve backend-neutral analytics abstractions (HOL-25)#105
Merged
Conversation
Introduces HoldFast.Analytics, a new project that holds the seven domain-store interfaces and their associated DTOs: - ILogStore (6 methods) - ITraceStore (5 methods) - ISessionAnalyticsStore (5 methods) - IErrorAnalyticsStore (6 methods) - IMetricStore (2 methods) - IEventFieldStore (2 methods) - IAlertStateStore (4 methods) Together these cover the same 30-odd-method surface as the legacy IClickHouseService, just split along domain lines so a future Postgres backend (HOL-26+) can replace one slice at a time without touching the 12 caller projects. What this PR explicitly does NOT do: - No Postgres code (deferred to HOL-26 onward) - No schema or query rewrites - ClickHouseService keeps its 1060 lines of SQL verbatim and now just implements all eight interfaces; DI hands back the same instance for every request - No removal of IClickHouseService - it stays as a working API alongside the seven new interfaces; call sites migrate incrementally in follow-up PRs and the legacy interface gets deleted in HOL-32 What this PR does change: - New project HoldFast.Analytics, depends only on HoldFast.Domain - All read/write models, CursorHelper, and pagination types moved from HoldFast.Data.ClickHouse to HoldFast.Analytics (namespace updated across 32 callers; mechanical sed) - HoldFast.Data.ClickHouse now references HoldFast.Analytics - Program.cs registers ClickHouseService as the singleton for all eight interfaces (legacy IClickHouseService + the seven new domain stores) - New mockability tests in HoldFast.Shared.Tests/Analytics/ proving the seam: a fake ILogStore can substitute for the real impl without any ClickHouse dependency Test coverage: 3,031 tests pass (was 3,027; +4 mockability tests). Smoke: solution builds with 0 errors / 0 new warnings. Refs HOL-25. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 of the Postgres-migration EPIC: introduce
HoldFast.Analytics, a new project holding seven domain-store interfaces (and their DTOs) carved out of the legacy 25-methodIClickHouseService. The seam unblocks HOL-26+ (Postgres impl) without touching any of the 12 caller projects again.What this PR does
HoldFast.Analytics, depends only onHoldFast.Domain— no client SDKs (the whole point of the seam)ILogStore(6 methods)ITraceStore(5)ISessionAnalyticsStore(5)IErrorAnalyticsStore(6)IMetricStore(2)IEventFieldStore(2)IAlertStateStore(4)CursorHelper+ pagination types moved fromHoldFast.Data.ClickHouse→HoldFast.Analytics. Mechanical namespace update across 32 caller files.ClickHouseServicenow implements all 8 interfaces (legacyIClickHouseService+ the 7 new ones). Same 1060 lines of SQL verbatim, no behavior change.ClickHouseServicesingleton, wired to all 8 interfaces viasp.GetRequiredService<ClickHouseService>().tests/HoldFast.Shared.Tests/Analytics/MockableStoreTests.cs): prove a fakeILogStorecan substitute the real impl without any ClickHouse dependency. This was the missing test capability before HOL-25 —IClickHouseService's 25-method surface made mocking impractical.What this PR explicitly does NOT do
ClickHouseServiceis byte-identicalIClickHouseService— it stays alongside the new interfaces. Callers migrate incrementally in follow-up PRs; legacy interface is deleted in HOL-32Test plan
dotnet build— 0 errors, 0 new warnings (only pre-existing HotChocolate CVE warning)dotnet test— 3,031 pass (was 3,027; +4 new mockability tests)using HoldFast.Data.ClickHouse.Models;→using HoldFast.Analytics.Models;updatesMockableStoreTestsproves: fake ILogStore substitutes real impl, writes are recorded, all 7 interfaces compile independently, abstractions live in the right assemblyStats
51 files changed, +543 / -54
Closes HOL-25. First step of the Postgres-migration EPIC; HOL-26 (PG schema port) is next.
🤖 Generated with Claude Code