refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
| Field | Value |
|
||||
|-------|-------|
|
||||
| Module | `src/ScadaLink.AuditLog` |
|
||||
| Module | `src/ZB.MOM.WW.ScadaBridge.AuditLog` |
|
||||
| Design doc | `docs/requirements/Component-AuditLog.md` |
|
||||
| Status | Reviewed |
|
||||
| Last reviewed | 2026-05-28 |
|
||||
@@ -66,7 +66,7 @@ chain doesn't reject a central composition root that mistakenly calls the site b
|
||||
| Severity | Medium |
|
||||
| Category | Design-document adherence |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Site/Telemetry/ISiteStreamAuditClient.cs:45`, `src/ScadaLink.AuditLog/Site/Telemetry/ClusterClientSiteAuditClient.cs:86`, `src/ScadaLink.AuditLog/Central/AuditLogIngestActor.cs:198` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/Telemetry/ISiteStreamAuditClient.cs:45`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/Telemetry/ClusterClientSiteAuditClient.cs:86`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditLogIngestActor.cs:198` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -78,7 +78,7 @@ interface; `ClusterClientSiteAuditClient.IngestCachedTelemetryAsync` builds the
|
||||
`IngestCachedTelemetryCommand`; the proto carries `CachedTelemetryBatch`;
|
||||
`AuditLogIngestActor.OnCachedTelemetryAsync` performs the dual `InsertIfNotExists` +
|
||||
`UpsertAsync` inside a `BeginTransactionAsync`. But a `grep` for callers of
|
||||
`IngestCachedTelemetryAsync` in `src/ScadaLink.AuditLog` shows only the interface
|
||||
`IngestCachedTelemetryAsync` in `src/ZB.MOM.WW.ScadaBridge.AuditLog` shows only the interface
|
||||
declaration and the two implementations — nothing produces a `CachedTelemetryBatch` for
|
||||
the site to push. The `SiteAuditTelemetryActor.OnDrainAsync` only calls
|
||||
`IngestAuditEventsAsync` (the audit-only path); cached-call audit rows written by
|
||||
@@ -108,17 +108,17 @@ previously-unreachable `IngestCachedTelemetryAsync` client path now carries
|
||||
cached-call lifecycle rows from the site SQLite hot-path through to the central
|
||||
`AuditLogIngestActor.OnCachedTelemetryAsync` dual-write transaction. Changes:
|
||||
|
||||
- **`ISiteAuditQueue`** (`src/ScadaLink.Commons/Interfaces/Services/ISiteAuditQueue.cs`):
|
||||
- **`ISiteAuditQueue`** (`src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/Services/ISiteAuditQueue.cs`):
|
||||
added `ReadPendingCachedTelemetryAsync(int, CancellationToken)` returning
|
||||
rows in `AuditForwardState.Pending` whose `Kind` is one of `CachedSubmit`,
|
||||
`ApiCallCached`, `DbWriteCached`, `CachedResolve`. Updated `ReadPendingAsync`
|
||||
XML doc to call out the partition.
|
||||
- **`SqliteAuditWriter`** (`src/ScadaLink.AuditLog/Site/SqliteAuditWriter.cs`):
|
||||
- **`SqliteAuditWriter`** (`src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/SqliteAuditWriter.cs`):
|
||||
implemented `ReadPendingCachedTelemetryAsync` with a `Kind IN (...)` filter
|
||||
reusing the existing `_readConnection` / `_readLock` decoupling; modified
|
||||
`ReadPendingAsync` to add the symmetric `Kind NOT IN (...)` predicate so the
|
||||
audit-only drain no longer double-emits cached rows.
|
||||
- **`SiteAuditTelemetryActor`** (`src/ScadaLink.AuditLog/Site/Telemetry/SiteAuditTelemetryActor.cs`):
|
||||
- **`SiteAuditTelemetryActor`** (`src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/Telemetry/SiteAuditTelemetryActor.cs`):
|
||||
added an optional `IOperationTrackingStore?` constructor parameter, a sibling
|
||||
`CachedDrain` self-tick message, and an `OnCachedDrainAsync` handler running
|
||||
in parallel with the existing audit-only drain. The cached-drain reads the
|
||||
@@ -130,12 +130,12 @@ cached-call lifecycle rows from the site SQLite hot-path through to the central
|
||||
blocks the rest of the batch; rows stay Pending and reconciliation /
|
||||
retention handles them. The lifecycle CTS (AuditLog-010) gates both drains
|
||||
uniformly.
|
||||
- **`AkkaHostedService`** (`src/ScadaLink.Host/Actors/AkkaHostedService.cs`):
|
||||
- **`AkkaHostedService`** (`src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs`):
|
||||
resolves `IOperationTrackingStore` via `GetService` (site-only registration)
|
||||
and threads it through the actor's `Props.Create`. Central composition
|
||||
roots and tests that don't register the tracking store get the legacy
|
||||
audit-only behaviour — the cached scheduler is never armed.
|
||||
- **Tests** (`tests/ScadaLink.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs`):
|
||||
- **Tests** (`tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs`):
|
||||
added three regression tests asserting (1) cached rows route through
|
||||
`IngestCachedTelemetryAsync` and NOT `IngestAuditEventsAsync`, (2) an
|
||||
orphan row with no tracking snapshot is logged + skipped without crashing
|
||||
@@ -163,11 +163,11 @@ cached-call lifecycle rows from the site SQLite hot-path through to the central
|
||||
is shared so `PostStop` cancels in-flight cached lookups + pushes at the
|
||||
same instant as audit-only drains.
|
||||
|
||||
Build: `dotnet build ScadaLink.slnx` — 0 warnings, 0 errors.
|
||||
Tests: `dotnet test tests/ScadaLink.AuditLog.Tests` — 250 passed, 1 failed
|
||||
Build: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` — 0 warnings, 0 errors.
|
||||
Tests: `dotnet test tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests` — 250 passed, 1 failed
|
||||
(`PartitionPurgeTests.EndToEnd_OldestPartition_PurgedViaActor_NewerKept` —
|
||||
pre-existing MS-SQL date-sensitive flake, called out in the prompt as
|
||||
acceptable). `dotnet test tests/ScadaLink.SiteRuntime.Tests` — all 302
|
||||
acceptable). `dotnet test tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests` — all 302
|
||||
passed.
|
||||
|
||||
### AuditLog-002 — `SupervisorStrategy` comments claim Resume semantics but code returns the default Restart decider
|
||||
@@ -177,7 +177,7 @@ passed.
|
||||
| Severity | Low |
|
||||
| Category | Akka.NET conventions |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Central/AuditLogIngestActor.cs:99-103`, `src/ScadaLink.AuditLog/Central/AuditLogPurgeActor.cs:109-115`, `src/ScadaLink.AuditLog/Central/SiteAuditReconciliationActor.cs:315-321` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditLogIngestActor.cs:99-103`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditLogPurgeActor.cs:109-115`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/SiteAuditReconciliationActor.cs:315-321` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -224,7 +224,7 @@ override as a children-only forward-compat placeholder, and state the actual
|
||||
| Severity | Low |
|
||||
| Category | Concurrency & thread safety |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Central/AuditLogIngestActor.cs:133`, `src/ScadaLink.AuditLog/Central/AuditLogPurgeActor.cs:139`, `src/ScadaLink.AuditLog/Central/SiteAuditReconciliationActor.cs:178` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditLogIngestActor.cs:133`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditLogPurgeActor.cs:139`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/SiteAuditReconciliationActor.cs:178` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -267,7 +267,7 @@ dispose asynchronously across every audit ingest path.
|
||||
| Severity | Medium |
|
||||
| Category | Error handling & resilience |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Central/SiteAuditReconciliationActor.cs:233-265` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/SiteAuditReconciliationActor.cs:233-265` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -318,7 +318,7 @@ now tracks `_failedInsertAttempts: Dictionary<Guid, int>` and a per-tick
|
||||
The in-memory counter resets on singleton restart, which is safe because the
|
||||
cursor also resets and the next tick re-pulls everything. Tests for both the
|
||||
retry-hold and permanent-abandon paths should land alongside the existing
|
||||
reconciliation tests in `tests/ScadaLink.AuditLog.Tests/Central/` (deferred to
|
||||
reconciliation tests in `tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/` (deferred to
|
||||
the next coverage sweep — the logic is straightforward and the build/integration
|
||||
tests already exercise the success path).
|
||||
|
||||
@@ -329,7 +329,7 @@ tests already exercise the success path).
|
||||
| Severity | Medium |
|
||||
| Category | Performance & resource management |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Site/SqliteAuditWriter.cs:597-657` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/SqliteAuditWriter.cs:597-657` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -380,7 +380,7 @@ behind every batch INSERT under `_writeLock`).
|
||||
| Severity | Low |
|
||||
| Category | Concurrency & thread safety |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Site/SqliteAuditWriter.cs:697-700` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/SqliteAuditWriter.cs:697-700` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -426,7 +426,7 @@ documents the choice. Behaviour for context-free callers is unchanged.
|
||||
| Severity | Low |
|
||||
| Category | Code organization & conventions |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/ServiceCollectionExtensions.cs:148-218` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/ServiceCollectionExtensions.cs:148-218` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -477,10 +477,10 @@ resolution instead.
|
||||
| Severity | Low |
|
||||
| Category | Security |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Site/FallbackAuditWriter.cs:51-77`, `src/ScadaLink.AuditLog/Central/CentralAuditWriter.cs:77-104`, `src/ScadaLink.AuditLog/Central/AuditLogIngestActor.cs:125,155` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/FallbackAuditWriter.cs:51-77`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/CentralAuditWriter.cs:77-104`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditLogIngestActor.cs:125,155` |
|
||||
|
||||
**Resolution (2026-05-28):** New `SafeDefaultAuditPayloadFilter` in
|
||||
`src/ScadaLink.AuditLog/Payload/` — a stateless singleton that performs HTTP
|
||||
`src/ZB.MOM.WW.ScadaBridge.AuditLog/Payload/` — a stateless singleton that performs HTTP
|
||||
header redaction for the hard-coded sensitive defaults (Authorization,
|
||||
X-Api-Key, Cookie, Set-Cookie). The three writer-chain sites
|
||||
(`FallbackAuditWriter`, `CentralAuditWriter`, `AuditLogIngestActor` —
|
||||
@@ -528,7 +528,7 @@ _Unresolved._
|
||||
| Severity | Low |
|
||||
| Category | Documentation & comments |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Site/SqliteAuditWriter.cs:706-740` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/SqliteAuditWriter.cs:706-740` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -572,7 +572,7 @@ the loop has drained (in the second lock block). Behaviour unchanged.
|
||||
| Severity | Low |
|
||||
| Category | Concurrency & thread safety |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/Site/Telemetry/SiteAuditTelemetryActor.cs:92,107,124`, `src/ScadaLink.AuditLog/Central/SiteAuditReconciliationActor.cs:228` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/Site/Telemetry/SiteAuditTelemetryActor.cs:92,107,124`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/SiteAuditReconciliationActor.cs:228` |
|
||||
|
||||
**Description**
|
||||
|
||||
@@ -614,7 +614,7 @@ existing top-level catch swallows the `OperationCanceledException`.
|
||||
| Severity | Low |
|
||||
| Category | Code organization & conventions |
|
||||
| Status | Resolved |
|
||||
| Location | `src/ScadaLink.AuditLog/ServiceCollectionExtensions.cs:53-55, 263-276, 301-346` |
|
||||
| Location | `src/ZB.MOM.WW.ScadaBridge.AuditLog/ServiceCollectionExtensions.cs:53-55, 263-276, 301-346` |
|
||||
|
||||
**Description**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user