diff --git a/CLAUDE.md b/CLAUDE.md index 3f1ab46b..16461ac0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,12 +1,12 @@ -# ScadaLink Implementation Project +# ScadaBridge Implementation Project -This is the full **implementation** project for ScadaLink — a distributed SCADA system built on Akka.NET in a hub-and-spoke architecture (one central cluster + multiple site clusters). It contains source code, tests, deployable docker topology, and the design documentation that the code implements. The design docs are the spec; `src/` is the binary. +This is the full **implementation** project for ScadaBridge — a distributed SCADA system built on Akka.NET in a hub-and-spoke architecture (one central cluster + multiple site clusters). It contains source code, tests, deployable docker topology, and the design documentation that the code implements. The design docs are the spec; `src/` is the binary. When a change is requested, the default assumption is: update the design doc *and* the code *and* the tests *and* (if it ships) the docker deploy — together, in one session, with `git diff` review before committing. ## Project Structure -- `src/` — C#/.NET implementation, one project per component (e.g. `ScadaLink.AuditLog`, `ScadaLink.NotificationOutbox`, `ScadaLink.SiteCallAudit`, `ScadaLink.CentralUI`, `ScadaLink.Host`, …). Solution file: `ScadaLink.slnx`. +- `src/` — C#/.NET implementation, one project per component (e.g. `ZB.MOM.WW.ScadaBridge.AuditLog`, `ZB.MOM.WW.ScadaBridge.NotificationOutbox`, `ZB.MOM.WW.ScadaBridge.SiteCallAudit`, `ZB.MOM.WW.ScadaBridge.CentralUI`, `ZB.MOM.WW.ScadaBridge.Host`, …). Solution file: `ZB.MOM.WW.ScadaBridge.slnx`. - `tests/` — Test projects (unit + integration). - `docker/` — 8-node cluster topology (2 central + 3 sites), `deploy.sh`, per-node `appsettings.*.json`. See [`docker/README.md`](docker/README.md) for setup, ports, and management commands. Rebuild + redeploy with `bash docker/deploy.sh`. - `docker-env2/` — Minimal second cluster topology (2 central + 1 site × 2 nodes), runs concurrently with `docker/` on host ports 91XX. Built specifically for testing the Transport (#24) feature with two real environments. See [`docker-env2/README.md`](docker-env2/README.md). Rebuild + redeploy with `bash docker-env2/deploy.sh`. @@ -47,7 +47,7 @@ Related repos cloned as sibling directories under `~/Desktop/` — referenced fo - When a change affects multiple documents or projects, update them all in the same session — design doc, entities/repos, actors/services, UI, tests, migrations, and deploy config travel together. - Use `git diff` to review changes before committing. - Commit related changes together with a descriptive message summarizing the design decision and the implementation slice. -- After non-trivial code changes, build (`dotnet build ScadaLink.slnx`) and run relevant tests before declaring done; for cluster-runtime changes, rebuild the image with `bash docker/deploy.sh`. +- After non-trivial code changes, build (`dotnet build ZB.MOM.WW.ScadaBridge.slnx`) and run relevant tests before declaring done; for cluster-runtime changes, rebuild the image with `bash docker/deploy.sh`. ## Current Component List (24 components) @@ -202,13 +202,13 @@ Related repos cloned as sibling directories under `~/Desktop/` — referenced fo ## Tool Usage - When consulting with the Codex MCP tool, use model `gpt-5.4`. -- When a task requires setting up or controlling system state (sites, templates, instances, data connections, deployments, security, etc.) and the Central UI is not needed, prefer the ScadaLink CLI over manual DB edits or UI navigation. See [`src/ScadaLink.CLI/README.md`](src/ScadaLink.CLI/README.md) for the full command reference. +- When a task requires setting up or controlling system state (sites, templates, instances, data connections, deployments, security, etc.) and the Central UI is not needed, prefer the ScadaBridge CLI over manual DB edits or UI navigation. See [`src/ZB.MOM.WW.ScadaBridge.CLI/README.md`](src/ZB.MOM.WW.ScadaBridge.CLI/README.md) for the full command reference. ### CLI Quick Reference (Docker / OrbStack) - **Management URL**: `http://localhost:9000` — the CLI connects via the Traefik load balancer, which routes to the active central node. Direct access: central-a on port 9001, central-b on port 9002. - **Test user**: `--username multi-role --password password` — has Admin, Design, and Deployment roles. The `admin` user only has the Admin role and cannot create templates, data connections, or deploy. -- **Config file**: `~/.scadalink/config.json` — stores `managementUrl` and default format. See `docker/README.md` for a ready-to-use test config. -- **Rebuild cluster**: `bash docker/deploy.sh` — builds the `scadalink:latest` image and recreates all containers. Run this after code changes to ManagementActor, Host, or any server-side component. +- **Config file**: `~/.scadabridge/config.json` — stores `managementUrl` and default format. See `docker/README.md` for a ready-to-use test config. +- **Rebuild cluster**: `bash docker/deploy.sh` — builds the `scadabridge:latest` image and recreates all containers. Run this after code changes to ManagementActor, Host, or any server-side component. - **Infrastructure services**: `cd infra && docker compose up -d` — starts LDAP, MS SQL, OPC UA, SMTP, and REST API. These are separate from the cluster containers in `docker/`. - **All test LDAP passwords**: `password` (see `infra/glauth/config.toml` for users and groups). diff --git a/Directory.Packages.props b/Directory.Packages.props index a26aea0c..df8ad1a6 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -69,7 +69,7 @@ Xunit.SkippableFact provides [SkippableFact] + Skip.IfNot/Skip.If for xunit v2. The native Skip API (Assert.Skip / Assert.SkipUnless / Assert.SkipWhen) only exists in xunit v3; xunit 2.9.x lacks it. Used by - Bundle C MSSQL integration tests in ScadaLink.ConfigurationDatabase.Tests + Bundle C MSSQL integration tests in ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests to mark tests as Skipped (not silently Passed) when MSSQL is unreachable. --> diff --git a/ScadaLink.slnx b/ScadaLink.slnx deleted file mode 100644 index 0f72605a..00000000 --- a/ScadaLink.slnx +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ZB.MOM.WW.ScadaBridge.slnx b/ZB.MOM.WW.ScadaBridge.slnx new file mode 100644 index 00000000..90ed56aa --- /dev/null +++ b/ZB.MOM.WW.ScadaBridge.slnx @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/alog.md b/alog.md index e68b91d1..c8f0921b 100644 --- a/alog.md +++ b/alog.md @@ -470,8 +470,8 @@ Audit Log page **Export** button streams CSV (current filter) server-side. Defau ## 11. Security & tamper-evidence ### 11.1 Append-only enforcement -- Application accesses `AuditLog` via a dedicated DB role `scadalink_audit_writer` granted `INSERT` + `SELECT` only — no `UPDATE`, no `DELETE`. -- Purge runs under a separate role `scadalink_audit_purger` whose permissions are limited to the partition-switch operation (§12.2). Row-level `DELETE` is not granted even to purge. +- Application accesses `AuditLog` via a dedicated DB role `scadabridge_audit_writer` granted `INSERT` + `SELECT` only — no `UPDATE`, no `DELETE`. +- Purge runs under a separate role `scadabridge_audit_purger` whose permissions are limited to the partition-switch operation (§12.2). Row-level `DELETE` is not granted even to purge. - A CI guard greps the data layer for any `UPDATE … AuditLog` or `DELETE … AuditLog` text and fails the build. ### 11.2 Authorization @@ -486,11 +486,11 @@ See §8.2. Contract: unredacted secrets never persist. Safety net over-redacts o - Each row gains a `RowHash` column. - `RowHash = SHA-256(prev.RowHash || canonical(row))` per partition. - Computed by a chaining job that runs after each monthly partition closes. -- Verifiable offline via `scadalink audit verify-chain --month YYYY-MM`. +- Verifiable offline via `scadabridge audit verify-chain --month YYYY-MM`. - Default **off** in v1 to avoid operational burden. Flag for v1.x. ### 11.5 Site SQLite security -- File permissions: read/write by the ScadaLink service account only. +- File permissions: read/write by the ScadaBridge service account only. - Not backed up off-machine — site SQLite is a buffer with a forwarding guarantee, not a record. Central is the durable home. --- @@ -578,10 +578,10 @@ MS SQL handles this with batched ingest and the time-aligned indexes. ## 15. CLI & external access ### 15.1 CLI commands -New `scadalink audit` command group: -- `scadalink audit query --site --since --kind [...]` — same filter set as the UI. -- `scadalink audit export --since --until --format csv|jsonl|parquet --output ` — bulk export, server-side streaming. -- `scadalink audit verify-chain --month ` — hash-chain verification (when §11.4 is enabled). +New `scadabridge audit` command group: +- `scadabridge audit query --site --since --kind [...]` — same filter set as the UI. +- `scadabridge audit export --since --until --format csv|jsonl|parquet --output ` — bulk export, server-side streaming. +- `scadabridge audit verify-chain --month ` — hash-chain verification (when §11.4 is enabled). Requires the same **OperationalAudit** / **AuditExport** permissions as the UI. diff --git a/cli_issues.md b/cli_issues.md index 82b1e23c..9262c177 100644 --- a/cli_issues.md +++ b/cli_issues.md @@ -1,12 +1,12 @@ # CLI Issues & Missing Features -Log any bugs, unexpected behavior, or missing features in the ScadaLink CLI here. +Log any bugs, unexpected behavior, or missing features in the ScadaBridge CLI here. ## Format ``` ### [Short title] -- **Command**: `scadalink ` +- **Command**: `scadabridge ` - **Description**: What happened or what's missing - **Expected**: What should happen - **Error output** (if applicable): diff --git a/code-reviews/AuditLog/findings.md b/code-reviews/AuditLog/findings.md index ba89a51d..a871b435 100644 --- a/code-reviews/AuditLog/findings.md +++ b/code-reviews/AuditLog/findings.md @@ -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` 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** diff --git a/code-reviews/CLI/findings.md b/code-reviews/CLI/findings.md index a295f910..e6e1bcad 100644 --- a/code-reviews/CLI/findings.md +++ b/code-reviews/CLI/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.CLI` | +| Module | `src/ZB.MOM.WW.ScadaBridge.CLI` | | Design doc | `docs/requirements/Component-CLI.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -50,7 +50,7 @@ Critical/High issues; the module remains healthy. #### Re-review 2026-05-28 (commit `1eb6e97`) The CLI has grown two substantial new command groups since the last re-review — -`scadalink audit` (Audit Log #23 M8) and `scadalink bundle` (Transport #24) — together +`scadabridge audit` (Audit Log #23 M8) and `scadabridge bundle` (Transport #24) — together adding ~1,500 lines of new production code. The new `audit` surface is well-tested and well-factored (pure helpers + a clear `IAuditFormatter` seam), but the new `bundle` surface is untested, duplicates the URL/credential resolution that already exists in @@ -70,7 +70,7 @@ findings (none Critical, three Medium). memory and writes synchronously — 100 MB bundles double-buffer. - **CLI-020** — `BundleCommands.bundle export` parses the success body with bare `JsonDocument.Parse` + `GetProperty` and throws on a malformed/abbreviated envelope. -- **CLI-021** — `CliConfig.Load` crashes the whole CLI when `~/.scadalink/config.json` +- **CLI-021** — `CliConfig.Load` crashes the whole CLI when `~/.scadabridge/config.json` is malformed or unreadable, even if `--url` was supplied on the command line. - **CLI-022** — `AuditCommands` and `BundleCommands` are absent from `CommandTreeTests`; the test still pins `Equal(14, groups.Count)` and silently excludes the new groups. @@ -133,7 +133,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/CommandHelpers.cs:18`, `src/ScadaLink.CLI/Commands/DebugCommands.cs:45`, `src/ScadaLink.CLI/CliConfig.cs:37-39` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:18`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DebugCommands.cs:45`, `src/ZB.MOM.WW.ScadaBridge.CLI/CliConfig.cs:37-39` | **Description** @@ -144,8 +144,8 @@ with `var format = result.GetValue(formatOption) ?? "json";` and `formatOption` in `Program.cs:11` with `DefaultValueFactory = _ => "json"`. `GetValue` therefore always returns a non-null value ("json" when the flag is absent), so the `?? "json"` fallback never fires and `config.DefaultFormat` is never consulted. The env var and config-file format -settings are dead code: `scadalink site list` always outputs JSON regardless of -`SCADALINK_FORMAT=table` or a `defaultFormat` entry in `~/.scadalink/config.json`. The +settings are dead code: `scadabridge site list` always outputs JSON regardless of +`SCADALINK_FORMAT=table` or a `defaultFormat` entry in `~/.scadabridge/config.json`. The documented behaviour silently does not work. **Recommendation** @@ -171,7 +171,7 @@ now call `ResolveFormat`. Regression tests added in `FormatResolutionTests`. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/CommandHelpers.cs:59-68`, `src/ScadaLink.CLI/Commands/CommandHelpers.cs:78-80` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:59-68`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:78-80` | **Description** @@ -205,7 +205,7 @@ case, prints `(ok)`, and returns 0 before any parse. Regression tests added in | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/CommandHelpers.cs:80` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:80` | **Description** @@ -236,7 +236,7 @@ raw-body fallback on the JSON path. Regression test | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CLI/ManagementHttpClient.cs:13` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/ManagementHttpClient.cs:13` | **Description** @@ -268,7 +268,7 @@ http/https URL via `Uri.TryCreate`. Both `CommandHelpers.ExecuteCommandAsync` an | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/InstanceCommands.cs:55-58`, `src/ScadaLink.CLI/Commands/InstanceCommands.cs:181-182` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/InstanceCommands.cs:55-58`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/InstanceCommands.cs:181-182` | **Description** @@ -305,7 +305,7 @@ wrong element types, and JSON null). | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Program.cs:9`, `src/ScadaLink.CLI/Commands/CommandHelpers.cs:36-44` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Program.cs:9`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:36-44` | **Description** @@ -345,7 +345,7 @@ demands it. Regression tests in `CredentialResolutionTests`. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `docs/requirements/Component-CLI.md:51-211` (vs. all files under `src/ScadaLink.CLI/Commands/`) | +| Location | `docs/requirements/Component-CLI.md:51-211` (vs. all files under `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/`) | **Description** @@ -372,21 +372,21 @@ A reader following the design doc would be unable to drive the CLI. **Recommendation** Regenerate the "Command Structure" section of `Component-CLI.md` from the actual command -tree (the in-repo `src/ScadaLink.CLI/README.md` is much closer to reality and could be the +tree (the in-repo `src/ZB.MOM.WW.ScadaBridge.CLI/README.md` is much closer to reality and could be the source), or mark the doc's command list as illustrative and point to the README as authoritative. **Resolution** Resolved 2026-05-16 (commit pending). Drift confirmed against every file under -`src/ScadaLink.CLI/Commands/`. Regenerated the entire "Command Structure" section of +`src/ZB.MOM.WW.ScadaBridge.CLI/Commands/`. Regenerated the entire "Command Structure" section of `Component-CLI.md` from the actual command tree: all entities are now keyed by integer `--id`; the non-existent `--file` option is removed; create/update commands list their real individual flags; non-existent commands (`template diff`, `instance bind-connections`/`assign-area`, `data-connection assign/unassign`, `security api-key enable/disable`) are removed; previously-omitted commands (`instance alarm-override set/delete/list`, `external-system method` subgroup, `site deploy-artifacts`) are added. -A note now points to `src/ScadaLink.CLI/README.md` as the authoritative reference. The +A note now points to `src/ZB.MOM.WW.ScadaBridge.CLI/README.md` as the authoritative reference. The Configuration section also documents the new `SCADALINK_USERNAME`/`SCADALINK_PASSWORD` env vars (see CLI-006). @@ -397,7 +397,7 @@ env vars (see CLI-006). | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Program.cs:10-11`, `src/ScadaLink.CLI/Commands/CommandHelpers.cs:60` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Program.cs:10-11`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:60` | **Description** @@ -426,7 +426,7 @@ rejected by `System.CommandLine` with a clear parse error. Regression tests in | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `docs/requirements/Component-CLI.md:238-249`, `src/ScadaLink.CLI/Commands/CommandHelpers.cs:75` | +| Location | `docs/requirements/Component-CLI.md:238-249`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:75` | **Description** @@ -469,7 +469,7 @@ surface, and the CLI's exit-code behaviour itself is now correct and pinned by t | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/DebugCommands.cs:181-189` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DebugCommands.cs:181-189` | **Description** @@ -504,7 +504,7 @@ both paths. Regression tests in `DebugStreamTests` (`ClassifyConnectFailure_*`). | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/DebugCommands.cs:89` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DebugCommands.cs:89` | **Description** @@ -535,7 +535,7 @@ covered indirectly by the `DebugStreamTests` exit-path tests. | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/DebugCommands.cs:208-227` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DebugCommands.cs:208-227` | **Description** @@ -575,7 +575,7 @@ solely through this helper. Regression tests in `DebugStreamTests` | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.CLI.Tests/` (vs. `src/ScadaLink.CLI/ManagementHttpClient.cs`, `src/ScadaLink.CLI/Commands/DebugCommands.cs`, `src/ScadaLink.CLI/Commands/InstanceCommands.cs:55-58`) | +| Location | `tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/` (vs. `src/ZB.MOM.WW.ScadaBridge.CLI/ManagementHttpClient.cs`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DebugCommands.cs`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/InstanceCommands.cs:55-58`) | **Description** @@ -623,7 +623,7 @@ The CLI test suite went from 42 to 77 passing tests. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/TemplateCommands.cs:77`, `src/ScadaLink.CLI/Commands/SiteCommands.cs:86`, `src/ScadaLink.CLI/Commands/ExternalSystemCommands.cs:40-42`, `src/ScadaLink.CLI/Commands/DataConnectionCommands.cs:39-40`, `src/ScadaLink.CLI/Commands/NotificationCommands.cs:40-41`, `src/ScadaLink.CLI/Commands/ApiMethodCommands.cs:79` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/TemplateCommands.cs:77`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/SiteCommands.cs:86`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/ExternalSystemCommands.cs:40-42`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DataConnectionCommands.cs:39-40`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/NotificationCommands.cs:40-41`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/ApiMethodCommands.cs:79` | **Re-triage 2026-05-17:** the finding was originally filed as a Medium "Correctness & logic bugs" issue, but verification against the Commons message contracts shows the @@ -682,7 +682,7 @@ entity. Option (a) matches the documented surface and the typical CLI expectatio Resolved 2026-05-17 (commit pending) per recommendation option (b). Verification of the Commons `Update*Command` records confirmed whole-replace is the intentional contract, so the CLI's `Required = true` flags are correct and were left unchanged. The in-repo -`src/ScadaLink.CLI/README.md` — which is authoritative and previously listed every +`src/ZB.MOM.WW.ScadaBridge.CLI/README.md` — which is authoritative and previously listed every `update` core field as optional `[--name]` — was corrected: the core flags (`--name`/`--protocol`/`--script`/`--code`/`--emails`/`--endpoint-url`/`--auth-type`/ `--data-type`/`--trigger-type`/`--priority`/`--connection-string`/`--ldap-group`/`--role`) @@ -701,10 +701,10 @@ surface — that doc-side correction is owned by the docs surface. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `docs/requirements/Component-CLI.md:75`, `docs/requirements/Component-CLI.md:125-126`, `src/ScadaLink.CLI/README.md` (vs. `src/ScadaLink.CLI/Commands/TemplateCommands.cs:404-413`, `src/ScadaLink.CLI/Commands/DataConnectionCommands.cs:41`, `:86`) | +| Location | `docs/requirements/Component-CLI.md:75`, `docs/requirements/Component-CLI.md:125-126`, `src/ZB.MOM.WW.ScadaBridge.CLI/README.md` (vs. `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/TemplateCommands.cs:404-413`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DataConnectionCommands.cs:41`, `:86`) | **Re-triage 2026-05-17:** verification found the same two drifts also present in the -in-repo `src/ScadaLink.CLI/README.md` (the authoritative reference): its +in-repo `src/ZB.MOM.WW.ScadaBridge.CLI/README.md` (the authoritative reference): its `template composition delete` section used the non-existent `--template-id` / `--instance-name` form, and `data-connection create`/`update` documented only `--configuration` without the canonical `--primary-config` flag (`--configuration` is in @@ -738,7 +738,7 @@ documented elsewhere. **Resolution** Resolved 2026-05-17 (commit pending). Both drifts were present in the in-repo -`src/ScadaLink.CLI/README.md` and were corrected there (the README is this module's +`src/ZB.MOM.WW.ScadaBridge.CLI/README.md` and were corrected there (the README is this module's authoritative reference): `template composition delete` now documents the real single `--id ` form, and `data-connection create`/`update` now document `--primary-config` (with the `--configuration` alias noted) alongside `--backup-config` and @@ -754,7 +754,7 @@ outside this module's editable surface and remains for the docs surface to apply | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/CommandHelpers.cs:184-200` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:184-200` | **Description** @@ -794,7 +794,7 @@ first-element-extra column still rendered). | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/BundleCommands.cs:244-289` (vs. `src/ScadaLink.CLI/Commands/CommandHelpers.cs:20-73`, `:159-174`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/BundleCommands.cs:244-289` (vs. `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/CommandHelpers.cs:20-73`, `:159-174`) | **Resolution (2026-05-28):** Extended `CommandHelpers.ExecuteCommandAsync` with optional `timeout` and `onSuccess` parameters so a caller can supply a longer per-command timeout (`BundleCommandTimeout`) and capture the success body for file I/O. The duplicated `RunBundleCommandAsync` was deleted; all three `bundle` sub-commands now delegate through `ExecuteCommandAsync`, which routes the error path through `IsAuthorizationFailure` — exit 2 fires on HTTP 403 OR a `FORBIDDEN`/`UNAUTHORIZED` error code regardless of status, unifying the contract with every other command group. @@ -835,7 +835,7 @@ messages verbatim. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/AuditQueryHelpers.cs:186-193`, `src/ScadaLink.CLI/Commands/AuditExportHelpers.cs:147-153` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/AuditQueryHelpers.cs:186-193`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/AuditExportHelpers.cs:147-153` | **Description** @@ -889,7 +889,7 @@ and pass after. | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/BundleCommands.cs:117-124`, `src/ScadaLink.CLI/ManagementHttpClient.cs:47-92` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/BundleCommands.cs:117-124`, `src/ZB.MOM.WW.ScadaBridge.CLI/ManagementHttpClient.cs:47-92` | **Resolution (2026-05-28):** Replaced the `Convert.FromBase64String(...)` + `File.WriteAllBytes(...)` pair with a new `StreamBase64ToFile(base64, output)` helper that slices the base64 string into 4-char-aligned chunks (1 MB by default) and decodes each chunk straight into a `FileStream` via `Convert.TryFromBase64Chars`. The intermediate `byte[]` and the synchronous full-bundle write are gone — peak working set drops from ~base64-string + ~byte[] + ~envelope-string to ~base64-string + small-chunk-buffer + ~envelope-string. The response body is still buffered into the management envelope string (the `POST /management` wire format does not currently support streaming responses — this finding is bounded by that limit per the recommendation's stop-gap), so a streaming `POST /api/bundle/export` REST endpoint remains a follow-up. Regression tests `BundleCommandsStreamingTests` (6 tests) cover small payload round-trip, multi-chunk boundaries, empty input, invalid base64 → `FormatException`, and argument validation. @@ -932,7 +932,7 @@ _Unresolved._ | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CLI/Commands/BundleCommands.cs:117-126` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/BundleCommands.cs:117-126` | **Resolution (2026-05-28):** Wrapped the `JsonDocument.Parse` + `GetProperty` extraction in a `try/catch (JsonException or KeyNotFoundException or InvalidOperationException)` block and the `StreamBase64ToFile` call in a separate `try/catch (FormatException)`. Either failure now emits a clean `OutputFormatter.WriteError(..., "INVALID_RESPONSE")` and returns exit 1, matching the graceful-degradation pattern established by CLI-002 / CLI-003 / CLI-005. A malformed/abbreviated envelope no longer terminates the CLI with a raw stack trace. @@ -968,9 +968,9 @@ regression test against a malformed-envelope stub `HttpMessageHandler`. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CLI/CliConfig.cs:41-53` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CLI/CliConfig.cs:41-53` | -**Resolution (2026-05-28):** Wrapped the `File.ReadAllText` + `JsonSerializer.Deserialize` calls in a `try/catch` for `JsonException`/`IOException`/`UnauthorizedAccessException` that prints one warning to `Console.Error` and falls through with default values, so command-line and env-var precedence still works against a malformed `~/.scadalink/config.json`. Regression test `CliConfigTests.Load_MalformedConfigFile_DoesNotThrow_WarnsAndReturnsDefault` redirects `HOME`/`USERPROFILE` to a temp dir containing invalid JSON, asserts no throw, defaulted values, and the stderr warning. +**Resolution (2026-05-28):** Wrapped the `File.ReadAllText` + `JsonSerializer.Deserialize` calls in a `try/catch` for `JsonException`/`IOException`/`UnauthorizedAccessException` that prints one warning to `Console.Error` and falls through with default values, so command-line and env-var precedence still works against a malformed `~/.scadabridge/config.json`. Regression test `CliConfigTests.Load_MalformedConfigFile_DoesNotThrow_WarnsAndReturnsDefault` redirects `HOME`/`USERPROFILE` to a temp dir containing invalid JSON, asserts no throw, defaulted values, and the stderr warning. **Description** @@ -987,7 +987,7 @@ if (File.Exists(configPath)) } ``` -Neither call is guarded. If `~/.scadalink/config.json` exists but is malformed +Neither call is guarded. If `~/.scadabridge/config.json` exists but is malformed (stale, partial, or someone's `vim` swap), `JsonSerializer.Deserialize` throws `JsonException`. If the file exists but isn't readable (mode 0000), `File.ReadAllText` throws `UnauthorizedAccessException`. Either fault aborts every @@ -1000,7 +1000,7 @@ input on the command line and don't need the config file at all (`--url`, Wrap the file-read and the `JsonSerializer.Deserialize` in a single `try/catch (Exception)` (or specifically `JsonException` + `UnauthorizedAccessException` + `IOException`). On failure, write a single one-line -warning to `Console.Error` ("ignoring malformed `~/.scadalink/config.json`: {message}") +warning to `Console.Error` ("ignoring malformed `~/.scadabridge/config.json`: {message}") and return the default `CliConfig`, so the rest of the precedence chain (env vars + command-line flags) still works. @@ -1015,7 +1015,7 @@ _Unresolved._ | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.CLI.Tests/CommandTreeTests.cs:21-37`, `:55-58` (vs. `src/ScadaLink.CLI/Program.cs:21-36`) | +| Location | `tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CommandTreeTests.cs:21-37`, `:55-58` (vs. `src/ZB.MOM.WW.ScadaBridge.CLI/Program.cs:21-36`) | **Resolution (2026-05-28):** Added `AuditCommands.Build` and `BundleCommands.Build` to `AllCommandGroups()`, bumped the count assertion to `Equal(16, …)` with a maintenance comment, and added three new sub-command-surface tests (`AllCommandGroups_Contains_AuditAndBundle`, `AuditCommandGroup_HasQueryExportAndVerifyChain`, `BundleCommandGroup_HasExportPreviewAndImport`). `CommandPayloadTypes_ResolveViaRegistry` now also pins `ExportBundleCommand` / `PreviewBundleCommand` / `ImportBundleCommand` through `ManagementCommandRegistry`. @@ -1047,13 +1047,13 @@ add a `BundleCommandsTests` file covering the success-envelope parse and the | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `docs/requirements/Component-CLI.md:310-311` (vs. `src/ScadaLink.CLI/Commands/AuditQueryHelpers.cs:186`, `src/ScadaLink.CLI/Commands/AuditExportHelpers.cs:126`, `src/ScadaLink.CLI/ManagementHttpClient.cs:94-156`) | +| Location | `docs/requirements/Component-CLI.md:310-311` (vs. `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/AuditQueryHelpers.cs:186`, `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/AuditExportHelpers.cs:126`, `src/ZB.MOM.WW.ScadaBridge.CLI/ManagementHttpClient.cs:94-156`) | -**Resolution (2026-05-28):** Updated `Component-CLI.md` Dependencies bullets — the Management Service (#18) bullet now says the `scadalink audit` group rides a parallel REST surface (`GET /api/audit/query` / `GET /api/audit/export`) sharing HTTP Basic Auth with `/management` but bypassing the actor; the Audit Log (#23) bullet names the specific endpoints and the server-side `AuditEndpoints` permission enforcement (`OperationalAudit` / `AuditExport`). +**Resolution (2026-05-28):** Updated `Component-CLI.md` Dependencies bullets — the Management Service (#18) bullet now says the `scadabridge audit` group rides a parallel REST surface (`GET /api/audit/query` / `GET /api/audit/export`) sharing HTTP Basic Auth with `/management` but bypassing the actor; the Audit Log (#23) bullet names the specific endpoints and the server-side `AuditEndpoints` permission enforcement (`OperationalAudit` / `AuditExport`). **Description** -`Component-CLI.md:310` states: "The `scadalink audit` command group rides this same +`Component-CLI.md:310` states: "The `scadabridge audit` command group rides this same transport — there is no separate audit endpoint." But the implementation calls a new REST surface — `GET /api/audit/query` and `GET /api/audit/export` — via two new methods on `ManagementHttpClient` (`SendGetAsync`, `SendGetStreamAsync`), distinct diff --git a/code-reviews/CentralUI/findings.md b/code-reviews/CentralUI/findings.md index d7a32bac..83c4e713 100644 --- a/code-reviews/CentralUI/findings.md +++ b/code-reviews/CentralUI/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.CentralUI` | +| Module | `src/ZB.MOM.WW.ScadaBridge.CentralUI` | | Design doc | `docs/requirements/Component-CentralUI.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -131,7 +131,7 @@ a UX/design adherence gap), and the un-tested `TransportImport` / | Severity | Critical | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:171-424` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:171-424` | **Description** @@ -184,7 +184,7 @@ the commit whose message references `CentralUI-001`. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Auth/AuthEndpoints.cs:63-69`; `src/ScadaLink.CentralUI/Components/Pages/Deployment/*.razor` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Auth/AuthEndpoints.cs:63-69`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/*.razor` | **Description** @@ -231,7 +231,7 @@ message references `CentralUI-002`. | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:359-423` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:359-423` | **Description** @@ -276,7 +276,7 @@ pre-fix code and pass after. Fixed by the commit whose message references | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Auth/CookieAuthenticationStateProvider.cs:22-28` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Auth/CookieAuthenticationStateProvider.cs:22-28` | **Description** @@ -324,7 +324,7 @@ Fixed by the commit whose message references `CentralUI-004`. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Auth/AuthEndpoints.cs:47-81`; `src/ScadaLink.CentralUI/Components/Shared/SessionExpiry.razor:18-30` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Auth/AuthEndpoints.cs:47-81`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/SessionExpiry.razor:18-30` | **Description** @@ -346,7 +346,7 @@ fixed 30-minute model. The code and the documented decision must agree. Resolved 2026-05-16 (commit ``) — cross-module fix (CentralUI + Security), explicitly authorized. Root cause confirmed against the source: -`AddCookie` (`ScadaLink.Security/ServiceCollectionExtensions.cs`) set neither +`AddCookie` (`ZB.MOM.WW.ScadaBridge.Security/ServiceCollectionExtensions.cs`) set neither `ExpireTimeSpan` nor `SlidingExpiration`; `AuthEndpoints` stamped a fixed `expires_at = UtcNow + 30 min` claim and a 30-minute absolute cookie `ExpiresUtc`; `SessionExpiry.razor` scheduled one hard redirect at that fixed @@ -383,8 +383,8 @@ Regression tests fail against the pre-fix code and pass after. Security: `AddSecurity_AuthCookie_ExpireTimeSpanIsConfigurable` (pins the options-pattern binding). CentralUI: `SessionExpiryPolicyTests.BuildSignInProperties_DoesNotSetFixedAbsoluteExpiry`, `..._IsPersistent`, `..._AllowsSlidingRefresh` pin that the login sign-in no -longer imposes a fixed absolute cap. `dotnet build ScadaLink.slnx` clean; -`tests/ScadaLink.Security.Tests` 57 passed, `tests/ScadaLink.CentralUI.Tests` +longer imposes a fixed absolute cap. `dotnet build ZB.MOM.WW.ScadaBridge.slnx` clean; +`tests/ZB.MOM.WW.ScadaBridge.Security.Tests` 57 passed, `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests` 254 passed. ### CentralUI-006 — Deployment status page polls every 10s despite the documented SignalR-push design @@ -394,7 +394,7 @@ longer imposes a fixed absolute cap. `dotnet build ScadaLink.slnx` clean; | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Deployment/Deployments.razor:196-216` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/Deployments.razor:196-216` | **Description** @@ -424,7 +424,7 @@ deployment records (`GetAllDeploymentRecordsAsync`) and the full instance map (`GetAllInstancesAsync`) — contradicting Component-CentralUI "Real-Time Updates" ("transitions push to the UI immediately via SignalR … no polling required"). -**Process/DI topology confirmed.** `ScadaLink.Host/Program.cs` calls both +**Process/DI topology confirmed.** `ZB.MOM.WW.ScadaBridge.Host/Program.cs` calls both `AddDeploymentManager()` (line 75) and `AddCentralUI()` (line 77) on the same `builder.Services` — DeploymentManager and the Central UI run **in the same central Host process**, so a DI singleton is genuinely shared between the @@ -432,7 +432,7 @@ DeploymentManager services and the Blazor circuit's scoped components. The shared-singleton seam is real; no out-of-process fallback was needed. **What was implemented — push-based updates.** A new -`IDeploymentStatusNotifier` (`ScadaLink.DeploymentManager/IDeploymentStatusNotifier.cs`) +`IDeploymentStatusNotifier` (`ZB.MOM.WW.ScadaBridge.DeploymentManager/IDeploymentStatusNotifier.cs`) with a C# `event Action` and a small payload (`DeploymentStatusChange` = deployment id + instance id + new status). Its implementation `DeploymentStatusNotifier` invokes each subscriber in isolation @@ -464,9 +464,9 @@ Regression tests fail against the pre-fix code and pass after. DeploymentManager pins the shared-singleton seam. CentralUI (`DeploymentsPushUpdateTests`): `Deployments_DoesNotPoll_HasNoRefreshTimer` (pre-fix: the `_refreshTimer` field existed — confirmed failing), `Deployments_StatusChange_TriggersReload`, and -`Deployments_Dispose_UnsubscribesFromNotifier`. `dotnet build ScadaLink.slnx` -clean (0 warnings); `tests/ScadaLink.DeploymentManager.Tests` 76 passed, -`tests/ScadaLink.CentralUI.Tests` 257 passed. (`TopologyPageTests`' DI fixture +`Deployments_Dispose_UnsubscribesFromNotifier`. `dotnet build ZB.MOM.WW.ScadaBridge.slnx` +clean (0 warnings); `tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests` 76 passed, +`tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests` 257 passed. (`TopologyPageTests`' DI fixture was also updated to register the new notifier, since it constructs the real `DeploymentService`.) @@ -477,7 +477,7 @@ was also updated to register the new notifier, since it constructs the real | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Layout/NavMenu.razor:69-78`; `src/ScadaLink.CentralUI/Components/Pages/Monitoring/EventLogs.razor:2`; `src/ScadaLink.CentralUI/Components/Pages/Monitoring/ParkedMessages.razor:2` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Layout/NavMenu.razor:69-78`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/EventLogs.razor:2`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/ParkedMessages.razor:2` | **Description** @@ -520,7 +520,7 @@ fail against the pre-fix code and pass after; | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Monitoring/AuditLog.razor:242-243` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/AuditLog.razor:242-243` | **Description** @@ -563,7 +563,7 @@ time-range filters, so it is unaffected. | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Deployment/DebugView.razor:400-409,538-544` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugView.razor:400-409,538-544` | **Description** @@ -608,7 +608,7 @@ mechanism rather than the race window. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Shared/ToastNotification.razor:62-71,90` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/ToastNotification.razor:62-71,90` | **Description** @@ -651,7 +651,7 @@ still-works behaviours. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Shared/DiffDialog.razor:89-95,151-157` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/DiffDialog.razor:89-95,151-157` | **Description** @@ -687,7 +687,7 @@ path. | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Admin/Sites.razor:196-205` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Sites.razor:196-205` | **Description** @@ -722,7 +722,7 @@ LoadData_GroupsConnectionsBySite_AndRendersThem}` fail against the pre-fix code | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:951-952` (actual call at `:975`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:951-952` (actual call at `:975`) | **Description** @@ -764,7 +764,7 @@ source). The five existing `Hover`/`SignatureHelp` tests in | Severity | Low (re-triaged from Medium 2026-05-16 — see Resolution) | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:254-259`; `src/ScadaLink.CentralUI/ScriptAnalysis/SandboxHostHelpers.cs:26-117` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:254-259`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/SandboxHostHelpers.cs:26-117` | **Description** @@ -814,7 +814,7 @@ cannot silently regress. | Severity | Low | | Category | Concurrency & thread safety | | Status | Won't Fix | -| Location | `src/ScadaLink.CentralUI/ServiceCollectionExtensions.cs:24`; `src/ScadaLink.CentralUI/Components/Shared/DialogService.cs:18-69` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/ServiceCollectionExtensions.cs:24`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/DialogService.cs:18-69` | **Description** @@ -860,7 +860,7 @@ service cannot silently regress. | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Shared/DataTable.razor:62-68`; `src/ScadaLink.CentralUI/Components/Pages/Deployment/Deployments.razor:167-173` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/DataTable.razor:62-68`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/Deployments.razor:167-173` | **Description** @@ -898,7 +898,7 @@ includes first/last) and `PagerWindowTests` (6 tests pinning the helper logic). | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Auth/AuthEndpoints.cs:127-138` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Auth/AuthEndpoints.cs:127-138` | **Description** @@ -939,7 +939,7 @@ the pre-auth login exemption was not over-corrected. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Shared/MonacoEditor.razor:116-118,123,142,164,170,176,182,189`; `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor:129,139`; `src/ScadaLink.CentralUI/Components/Pages/Admin/Sites.razor:316-319` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/MonacoEditor.razor:116-118,123,142,164,170,176,182,189`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor:129,139`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Sites.razor:316-319` | **Description** @@ -991,7 +991,7 @@ not logged). | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.CentralUI.Tests/` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/` | **Description** @@ -1028,7 +1028,7 @@ Toast/timer disposal: `ToastNotificationTests` (from CentralUI-010). This batch also added `BrowserTimeTests`, `MonitoringAuthorizationTests`, `SitesPageTests`, `DataTablePagerTests` + `PagerWindowTests`, `TreeViewStorageResilienceTests`, and `MonacoEditorLoggingTests`. The -`tests/ScadaLink.CentralUI.Tests` suite is green at 251 tests. Remaining +`tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests` suite is green at 251 tests. Remaining untested paths are low-risk render-only pages; the Critical/High/Medium paths the finding prioritised are all now covered, so the finding is considered resolved. (Note: `TopologyPageTests`'s DI setup was also updated this session — @@ -1044,7 +1044,7 @@ in the fixture.) | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Shared/SessionExpiry.razor:39-62`; `src/ScadaLink.CentralUI/Auth/CookieAuthenticationStateProvider.cs:29-43` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/SessionExpiry.razor:39-62`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Auth/CookieAuthenticationStateProvider.cs:29-43` | **Description** @@ -1094,7 +1094,7 @@ expired session (see CentralUI-025). | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Deployment/DebugView.razor:404-419,511-519,275-289` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugView.razor:404-419,511-519,275-289` | **Description** @@ -1133,7 +1133,7 @@ critical section as the upsert. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Deployment/Deployments.razor:221-229,317-322` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/Deployments.razor:221-229,317-322` | **Description** @@ -1172,7 +1172,7 @@ rather than the whole table on each event. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Monitoring/ParkedMessages.razor:690-698`; `src/ScadaLink.CentralUI/Components/Shared/DiffDialog.razor:107-116,118-130,104` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/ParkedMessages.razor:690-698`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/DiffDialog.razor:107-116,118-130,104` | **Description** @@ -1205,11 +1205,11 @@ call, consistent with the CentralUI-018 fixes in the same module. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Layout/NavMenu.razor:102`; `src/ScadaLink.CentralUI/Components/Pages/Dashboard.razor:14`; `GetCurrentUserAsync` in `Templates.razor`, `TemplateEdit.razor`, `TemplateCreate.razor`, `SharedScripts.razor`, `SharedScriptForm.razor`, `Sites.razor`, `Topology.razor`, `InstanceCreate.razor`, `InstanceConfigure.razor` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Layout/NavMenu.razor:102`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Dashboard.razor:14`; `GetCurrentUserAsync` in `Templates.razor`, `TemplateEdit.razor`, `TemplateCreate.razor`, `SharedScripts.razor`, `SharedScriptForm.razor`, `Sites.razor`, `Topology.razor`, `InstanceCreate.razor`, `InstanceConfigure.razor` | **Description** -`ScadaLink.Security.JwtTokenService` exposes the canonical claim-type constants +`ZB.MOM.WW.ScadaBridge.Security.JwtTokenService` exposes the canonical claim-type constants (`UsernameClaimType = "Username"`, `DisplayNameClaimType = "DisplayName"`, `RoleClaimType`, `SiteIdClaimType`). `SiteScopeService` correctly uses `JwtTokenService.SiteIdClaimType`, but every `GetCurrentUserAsync` helper across @@ -1239,7 +1239,7 @@ or a small scoped service) so the claim lookup lives in exactly one place. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs`; `src/ScadaLink.CentralUI/Components/Shared/SessionExpiry.razor` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/SessionExpiry.razor` | **Description** @@ -1273,7 +1273,7 @@ also forces the CentralUI-020 fix. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Audit/AuditFilterBar.razor:97-104`; `src/ScadaLink.CentralUI/Components/Audit/AuditQueryModel.cs:56-58,150-178,203-213` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Audit/AuditFilterBar.razor:97-104`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Audit/AuditQueryModel.cs:56-58,150-178,203-213` | **Description** @@ -1317,7 +1317,7 @@ in the same time zone in every documented deployment. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor:74-80`; `src/ScadaLink.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor.cs:421-425`; `src/ScadaLink.CentralUI/Components/Pages/Notifications/NotificationReport.razor:75-81,639-640`; `src/ScadaLink.CentralUI/Components/Pages/Monitoring/EventLogs.razor:62-73,261-262` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor:74-80`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor.cs:421-425`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Notifications/NotificationReport.razor:75-81,639-640`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/EventLogs.razor:62-73,261-262` | **Description** @@ -1364,7 +1364,7 @@ changes. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Notifications/NotificationReport.razor:2,434,472,502`; `src/ScadaLink.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor:2,52-59`; `src/ScadaLink.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor.cs:97-110,201,250-251,278-279` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Notifications/NotificationReport.razor:2,434,472,502`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor:2,52-59`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor.cs:97-110,201,250-251,278-279` | **Description** @@ -1420,7 +1420,7 @@ Regression test `SiteCallsReportPageTests.SiteScoping_ScopedDeploymentUser_Hides seeds a Deployment user with a single `SiteId=1` claim, asserts only the Plant-A row renders, and verifies the Plant-B row is dropped (the page's row count drops from 2 to 1). All three existing report-page test fixtures register `SiteScopeService` so the -default system-wide path is unaffected — the full `ScadaLink.CentralUI.Tests` suite +default system-wide path is unaffected — the full `ZB.MOM.WW.ScadaBridge.CentralUI.Tests` suite still passes (568 / 568). ### CentralUI-029 — `ConfigurationAuditLog` uses `JS.InvokeAsync("eval", ...)` instead of a dedicated JS module @@ -1430,9 +1430,9 @@ still passes (568 / 568). | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Audit/ConfigurationAuditLog.razor:248-263` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Audit/ConfigurationAuditLog.razor:248-263` | -**Resolution (2026-05-28):** Added a small 5-line `wwwroot/js/browser-time.js` ES module exporting `getTimezoneOffsetMinutes()`, and replaced the `JS.InvokeAsync("eval", "new Date().getTimezoneOffset()")` call in `ConfigurationAuditLog.OnAfterRenderAsync` with a lazy `IJSObjectReference` import (`./_content/ScadaLink.CentralUI/js/browser-time.js`) + `module.InvokeAsync("getTimezoneOffsetMinutes")`, matching the `session-expiry.js` / `audit-grid.js` / `nav-state.js` / `transport.js` module-import pattern. The residual `eval` JS-interop surface is gone and the page is now CSP-compatible with `unsafe-eval` forbidden. +**Resolution (2026-05-28):** Added a small 5-line `wwwroot/js/browser-time.js` ES module exporting `getTimezoneOffsetMinutes()`, and replaced the `JS.InvokeAsync("eval", "new Date().getTimezoneOffset()")` call in `ConfigurationAuditLog.OnAfterRenderAsync` with a lazy `IJSObjectReference` import (`./_content/ZB.MOM.WW.ScadaBridge.CentralUI/js/browser-time.js`) + `module.InvokeAsync("getTimezoneOffsetMinutes")`, matching the `session-expiry.js` / `audit-grid.js` / `nav-state.js` / `transport.js` module-import pattern. The residual `eval` JS-interop surface is gone and the page is now CSP-compatible with `unsafe-eval` forbidden. **Description** @@ -1464,7 +1464,7 @@ plumbing CentralUI-027 will need. | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/ScriptAnalysis/SandboxConsoleCapture.cs:31-118`; `src/ScadaLink.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:401-404` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/SandboxConsoleCapture.cs:31-118`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/ScriptAnalysis/ScriptAnalysisService.cs:401-404` | **Resolution (2026-05-28):** Wrapped every `Write`/`WriteLine` override in `SandboxConsoleCapture` through a `WriteSynchronized` helper that takes a `lock` on the current `AsyncLocal` capture buffer before writing — concurrent `Console.WriteLine` calls from a script's `Task.WhenAll`/`Task.Run` fan-out now serialise on the buffer instance, so the `StringBuilder` underneath can no longer be corrupted. The fall-through to the unwrapped `_fallback` writer is unlocked because the BCL's process-wide `Console.Out` is already synchronised. Different capture scopes have different lock targets, so two unrelated sandbox runs never block each other. New regression test `SandboxConsoleCaptureTests.BeginCapture_ConcurrentWritesFromTasks_DoNotCorruptBuffer` drives 32 tasks × 50 lines each through one capture scope and asserts every line is intact in the buffer. @@ -1501,9 +1501,9 @@ the expected line count regardless of thread interleaving. | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Design/TransportImport.razor.cs:72,104-142,160-161` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Design/TransportImport.razor.cs:72,104-142,160-161` | -**Resolution (2026-05-28):** Replaced the `private byte[]? _bundleBytes` field with `private string? _bundleTempPath`. `OnFileSelectedAsync` now creates `Path.GetTempPath()/scadalink-transport-staging/` (created on first use) and streams the upload via `InputFile.OpenReadStream(maxBytes).CopyToAsync(FileStream)` straight to a `Guid.NewGuid():N + .scadabundle` temp file; `TryLoadAsync` opens the same path as a fresh `FileStream` for each `IBundleImporter.LoadAsync` call. The component now implements `IDisposable` and a `DeleteBundleTempFile()` helper that runs on `ResetSessionState`, `OnFileSelectedAsync` (before a new upload), and `Dispose` (circuit teardown); IO failures during cleanup are swallowed so audit-failure-style defensive semantics hold. Per-circuit working set drops from up to `MaxBundleSizeMb` (default 100 MB) per open wizard to the 80 KB FileStream buffer. The existing reflection-based test helper `SeedAtPassphraseStep` was migrated to write bytes to a real temp file and set `_bundleTempPath`, so the 7 existing TransportImport bUnit tests still pass against the new staging model. +**Resolution (2026-05-28):** Replaced the `private byte[]? _bundleBytes` field with `private string? _bundleTempPath`. `OnFileSelectedAsync` now creates `Path.GetTempPath()/scadabridge-transport-staging/` (created on first use) and streams the upload via `InputFile.OpenReadStream(maxBytes).CopyToAsync(FileStream)` straight to a `Guid.NewGuid():N + .scadabundle` temp file; `TryLoadAsync` opens the same path as a fresh `FileStream` for each `IBundleImporter.LoadAsync` call. The component now implements `IDisposable` and a `DeleteBundleTempFile()` helper that runs on `ResetSessionState`, `OnFileSelectedAsync` (before a new upload), and `Dispose` (circuit teardown); IO failures during cleanup are swallowed so audit-failure-style defensive semantics hold. Per-circuit working set drops from up to `MaxBundleSizeMb` (default 100 MB) per open wizard to the 80 KB FileStream buffer. The existing reflection-based test helper `SeedAtPassphraseStep` was migrated to write bytes to a real temp file and set `_bundleTempPath`, so the 7 existing TransportImport bUnit tests still pass against the new staging model. **Description** @@ -1536,7 +1536,7 @@ docs to call out the in-memory cost per concurrent import session. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Audit/AuditResultsGrid.razor:76-82`; `src/ScadaLink.CentralUI/Components/Audit/AuditResultsGrid.razor.cs:65,196-197,219-220` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Audit/AuditResultsGrid.razor:76-82`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Audit/AuditResultsGrid.razor.cs:65,196-197,219-220` | **Resolution (2026-05-28):** Added a `Stack _cursorStack` and `AuditLogPaging? _currentPaging` field to `AuditResultsGrid.razor.cs`. `NextPage` now pushes the current cursor before advancing; a new `PrevPage` method pops the prior cursor, reloads at that position, and decrements `_pageNumber` only if the reload succeeds (a failed fetch leaves the user on the current page rather than stranding them between pages). The filter-change reset clears the stack alongside `_rows`. The razor template now renders a `btn-group` with a Previous button (gated on `CanGoBack`) alongside the existing Next button; both buttons get the standard `disabled` treatment during loads. @@ -1568,9 +1568,9 @@ forward-only paging on the Audit Log grid. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `src/ScadaLink.CentralUI/Components/Pages/Design/TransportImport.razor.cs:97-238,267-319`; `src/ScadaLink.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor.cs:107-148`; `tests/ScadaLink.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs`; `tests/ScadaLink.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Design/TransportImport.razor.cs:97-238,267-319`; `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/SiteCalls/SiteCallsReport.razor.cs:107-148`; `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs`; `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs` | -**Resolution (2026-05-28):** Added `tests/ScadaLink.CentralUI.Tests/Pages/QueryStringDrillInTests.cs` (4 bUnit tests). For `SiteCallsReport` it pins the case-insensitive `?status=parked` → canonical "Parked" normalisation, the unrecognised-status silent drop, and the non-boolean `?stuck=yes` silent drop — gaps the existing `SiteCallsReportPageTests` (which covered the Parked / stuck=true / no-params happy paths) did not exercise. For `TransportImport` it asserts that the wizard has no `[Parameter]`-bound query keys: an unrecognised drill-in URL (`?bundleImportId=…&foo=bar`) leaves `_step` at `Upload` and the Step-1 InputFile control renders cleanly. +**Resolution (2026-05-28):** Added `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/QueryStringDrillInTests.cs` (4 bUnit tests). For `SiteCallsReport` it pins the case-insensitive `?status=parked` → canonical "Parked" normalisation, the unrecognised-status silent drop, and the non-boolean `?stuck=yes` silent drop — gaps the existing `SiteCallsReportPageTests` (which covered the Parked / stuck=true / no-params happy paths) did not exercise. For `TransportImport` it asserts that the wizard has no `[Parameter]`-bound query keys: an unrecognised drill-in URL (`?bundleImportId=…&foo=bar`) leaves `_step` at `Upload` and the Step-1 InputFile control renders cleanly. **Description** diff --git a/code-reviews/ClusterInfrastructure/findings.md b/code-reviews/ClusterInfrastructure/findings.md index 06a735f1..ee22058a 100644 --- a/code-reviews/ClusterInfrastructure/findings.md +++ b/code-reviews/ClusterInfrastructure/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.ClusterInfrastructure` | +| Module | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` | | Design doc | `docs/requirements/Component-ClusterInfrastructure.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -40,7 +40,7 @@ well-documented, and well-tested. This re-review examined all three source files all three test files against the full 10-category checklist and found **two new issues**, both stemming from work the prior review explicitly deferred to a "Host review" that has not happened: the `DownIfAlone` property is exposed and validated as -part of the configuration contract but is never consumed — `ScadaLink.Host`'s +part of the configuration contract but is never consumed — `ZB.MOM.WW.ScadaBridge.Host`'s `BuildHocon` still hard-codes `down-if-alone = on` (CI-009, Medium) — and the validator does not enforce the design doc's requirement that `down-if-alone` be `on` for the keep-oldest resolver, so `DownIfAlone = false` is silently accepted (CI-010, Low). @@ -58,9 +58,9 @@ either did not surface or that have aged into the file: - **CI-011 (Low, Code organization)** — `ClusterOptions.SectionName` is documented as "the single source of truth so binding sites do not hard-code the magic string" (the very justification CI-005's resolution offered), but - `ScadaLink.Host.SiteServiceRegistration.BindSharedOptions:100` and three - references in `ScadaLink.Host.StartupValidator` all hard-code - `"ScadaLink:Cluster"` literals. The constant is decorative — a "single source + `ZB.MOM.WW.ScadaBridge.Host.SiteServiceRegistration.BindSharedOptions:100` and three + references in `ZB.MOM.WW.ScadaBridge.Host.StartupValidator` all hard-code + `"ScadaBridge:Cluster"` literals. The constant is decorative — a "single source of truth" that nothing reads. Same pattern as CI-009 (inert configuration knob). - **CI-012 (Low, Design-document adherence)** — the validator accepts `SeedNodes.Count == 1` even though the design doc states "both nodes are seed @@ -90,7 +90,7 @@ Original review (2026-05-16, `9c60592`) below; the re-review notes (2026-05-17, | # | Category | Examined | Notes | |---|----------|----------|-------| | 1 | Correctness & logic bugs | ✓ | No executable logic exists beyond an options POCO; no logic bugs, but `ServiceCollectionExtensions` returns success while doing nothing (CI-002). **Re-review:** CI-002 resolved. New — `DownIfAlone` is a settable property that controls nothing because the HOCON builder hard-codes the value (CI-009). | -| 2 | Akka.NET conventions | ✓ | No actors, no `ActorSystem` bootstrap, no supervision, no cluster/singleton wiring exist despite the design doc requiring all of them (CI-001). Nothing to assess against `Tell`/`Ask`, immutability, or `PipeTo`. **Re-review:** confirmed the Akka bootstrap legitimately lives in `ScadaLink.Host` (CI-001 resolution); still nothing actor-related in this module. No issues. | +| 2 | Akka.NET conventions | ✓ | No actors, no `ActorSystem` bootstrap, no supervision, no cluster/singleton wiring exist despite the design doc requiring all of them (CI-001). Nothing to assess against `Tell`/`Ask`, immutability, or `PipeTo`. **Re-review:** confirmed the Akka bootstrap legitimately lives in `ZB.MOM.WW.ScadaBridge.Host` (CI-001 resolution); still nothing actor-related in this module. No issues. | | 3 | Concurrency & thread safety | ✓ | No shared mutable state, no actors, no async code. No issues found in current code. **Re-review:** validator and DI extensions are stateless; no issues. | | 4 | Error handling & resilience | ✓ | Failover, split-brain, dual-node recovery, and graceful-shutdown logic are entirely absent (CI-001). No exception paths to review in current code. **Re-review:** the validator now fails fast on misconfiguration. New — it does not enforce the design doc's `down-if-alone = on` requirement (CI-010). | | 5 | Security | ✓ | No authn/authz surface in this module. Akka remoting is unconfigured, so transport security cannot be assessed; flagged as part of the missing implementation (CI-001). No secret handling present. **Re-review:** still no authn/authz surface, no secret handling. No issues. | @@ -124,7 +124,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ServiceCollectionExtensions.cs:9`, `src/ScadaLink.ClusterInfrastructure/ServiceCollectionExtensions.cs:16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ServiceCollectionExtensions.cs:9`, `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ServiceCollectionExtensions.cs:16` | **Description** @@ -138,8 +138,8 @@ and a `ServiceCollectionExtensions` whose methods are explicitly commented and simply return the unmodified `IServiceCollection`. There is no `Akka.Cluster`, `Akka.Cluster.Tools`, `Akka.Remote`, or split-brain-resolver dependency in the `.csproj` at all (it references only `Microsoft.Extensions.DependencyInjection.Abstractions`, -`Microsoft.Extensions.Options`, and `ScadaLink.Commons`). Because every other -ScadaLink component runs inside the actor system this module is responsible for +`Microsoft.Extensions.Options`, and `ZB.MOM.WW.ScadaBridge.Commons`). Because every other +ScadaBridge component runs inside the actor system this module is responsible for creating, the absence of any implementation blocks the foundational layer of the system. @@ -157,19 +157,19 @@ should clearly state it is unimplemented so callers do not assume otherwise. _Re-triaged 2026-05-16 — remains Open, needs a design decision from the user._ Verified against the source at the reviewed commit: the finding's factual claims hold. -`src/ScadaLink.ClusterInfrastructure` still contains only `ClusterOptions.cs` and a +`src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` still contains only `ClusterOptions.cs` and a no-op `ServiceCollectionExtensions.cs`, and the `.csproj` references no Akka packages. However, the documented cluster behaviour is **not actually absent from the system** — it has been implemented in the **Host** project rather than in this module: -- `src/ScadaLink.Host/Actors/AkkaHostedService.cs` bootstraps the `ActorSystem`, - generates the HOCON from `ClusterOptions` (it imports `ScadaLink.ClusterInfrastructure` +- `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs` bootstraps the `ActorSystem`, + generates the HOCON from `ClusterOptions` (it imports `ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` and injects `IOptions`), and configures the `keep-oldest` split-brain resolver with `down-if-alone = on` (see `AkkaHostedService.cs:95-96`). -- `src/ScadaLink.Host/Health/AkkaClusterHealthCheck.cs`, `AkkaClusterNodeProvider.cs`, +- `src/ZB.MOM.WW.ScadaBridge.Host/Health/AkkaClusterHealthCheck.cs`, `AkkaClusterNodeProvider.cs`, and `Health/ActiveNodeHealthCheck.cs` cover cluster membership / active-node detection. -- Akka cluster/remote package references live in `ScadaLink.Host.csproj` and the +- Akka cluster/remote package references live in `ZB.MOM.WW.ScadaBridge.Host.csproj` and the per-component projects (`SiteRuntime`, `Communication`, etc.). So the real situation is an **ownership / design-doc drift**, not missing behaviour: @@ -183,11 +183,11 @@ of two substantial decisions, both requiring the user: 1. **Move the bootstrap into this module** — relocate the HOCON generation, split-brain config, cluster-singleton helpers and `CoordinatedShutdown` wiring out of - `ScadaLink.Host` into `ScadaLink.ClusterInfrastructure`, add the Akka package + `ZB.MOM.WW.ScadaBridge.Host` into `ZB.MOM.WW.ScadaBridge.ClusterInfrastructure`, add the Akka package references, and re-wire the Host to call into it. This is a cross-module refactor - touching `src/ScadaLink.Host/*` and several other projects — outside the edit scope - permitted for this finding (only `src/ScadaLink.ClusterInfrastructure/`, - `tests/ScadaLink.ClusterInfrastructure.Tests/`, and this file may be edited). + touching `src/ZB.MOM.WW.ScadaBridge.Host/*` and several other projects — outside the edit scope + permitted for this finding (only `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/`, + `tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/`, and this file may be edited). 2. **Accept the current placement** — keep the bootstrap in the Host and update `Component-ClusterInfrastructure.md` (and the README component table) to record that the Host owns the actor-system/cluster bootstrap and that this module's role is the @@ -202,8 +202,8 @@ bring-up), and the design docs are corrected to record the true ownership. **Resolved** — fixing commit ``, date 2026-05-16. The finding was a design-doc drift, not missing behaviour. `docs/requirements/Component-ClusterInfrastructure.md` now carries an "Implementation Note — Code Placement" section stating that the -`ScadaLink.ClusterInfrastructure` project owns the `ClusterOptions` configuration model -while `ScadaLink.Host` owns the Akka bootstrap, HOCON generation, split-brain-resolver +`ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` project owns the `ClusterOptions` configuration model +while `ZB.MOM.WW.ScadaBridge.Host` owns the Akka bootstrap, HOCON generation, split-brain-resolver wiring, `CoordinatedShutdown` integration, and active-node health checks. The README component table (row 13) was updated to match. No code change was required — the documented cluster behaviour already exists and is exercised; only the doc's @@ -216,7 +216,7 @@ module-ownership claim was wrong. Module test suite green (3 passed). | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ServiceCollectionExtensions.cs:7-17` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ServiceCollectionExtensions.cs:7-17` | **Description** @@ -239,17 +239,17 @@ with the genuine registration when CI-001 is addressed. **Resolution** Confirmed against the source: both methods returned the `IServiceCollection` -unchanged. Verified the consumers — `ScadaLink.Host` calls `AddClusterInfrastructure()` +unchanged. Verified the consumers — `ZB.MOM.WW.ScadaBridge.Host` calls `AddClusterInfrastructure()` (`Program.cs:68`, `SiteServiceRegistration.cs:24`); `AddClusterInfrastructureActors` is dead — it is called nowhere in the solution. **Resolved** — fixing commit `commit pending`, date 2026-05-16. `AddClusterInfrastructure` now does real work: it registers the `ClusterOptionsValidator` (CI-004) via `TryAddEnumerable`, so the method is no longer a -no-op and a misconfigured `ScadaLink:Cluster` section fails fast on the first +no-op and a misconfigured `ScadaBridge:Cluster` section fails fast on the first `IOptions` resolution. `AddClusterInfrastructureActors` — which this component never had any actors to register, as CI-001 established the Akka bootstrap -lives in `ScadaLink.Host` — now throws `NotImplementedException` with a message +lives in `ZB.MOM.WW.ScadaBridge.Host` — now throws `NotImplementedException` with a message pointing the caller to the Host, rather than masquerading as a completed registration. Covered by `ServiceCollectionExtensionsTests` (`AddClusterInfrastructure_RegistersOptionsValidator`, @@ -263,7 +263,7 @@ Covered by `ServiceCollectionExtensionsTests` | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptions.cs:3-11` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptions.cs:3-11` | **Description** @@ -290,7 +290,7 @@ agree on where each value lives. **Resolution** Partially re-triaged. Verified against the source: most of the "missing" settings are -**deliberately owned by `ScadaLink.Host.NodeOptions`** — `NodeOptions` already carries +**deliberately owned by `ZB.MOM.WW.ScadaBridge.Host.NodeOptions`** — `NodeOptions` already carries `Role`, `NodeHostname`, `SiteId`, `RemotingPort` and `GrpcPort`, and `AkkaHostedService` builds the HOCON from `NodeOptions` for exactly those values. Local SQLite storage paths live in the database / store-and-forward options. This is the ownership split CI-001 @@ -307,7 +307,7 @@ deliberate ownership split — node identity/remoting/gRPC in `Host.NodeOptions` paths in the database options, cluster-formation settings here — so the design doc and the options classes now agree on where each value lives. (`AkkaHostedService` currently hard-codes `down-if-alone = on` in HOCON; wiring it to read `DownIfAlone` is a one-line -`ScadaLink.Host` change, outside this module's permitted edit scope, and is noted for +`ZB.MOM.WW.ScadaBridge.Host` change, outside this module's permitted edit scope, and is noted for the Host's review.) Covered by `ClusterOptionsTests.DefaultValues_AreCorrect` and `ClusterOptionsTests.DownIfAlone_CanBeSet`. @@ -318,7 +318,7 @@ the Host's review.) Covered by `ClusterOptionsTests.DefaultValues_AreCorrect` an | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptions.cs:3-11` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptions.cs:3-11` | **Description** @@ -374,7 +374,7 @@ attributes cannot. Covered by `ClusterOptionsValidatorTests` (8 cases) and | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptions.cs:3` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptions.cs:3` | **Description** @@ -398,9 +398,9 @@ Confirmed against the source: `ClusterOptions` previously exposed no section-nam constant, leaving binding sites to hard-code the magic string. **Resolved** — fixing commit `commit pending`, date 2026-05-16. `ClusterOptions` now -exposes `public const string SectionName = "ScadaLink:Cluster";` as the single source +exposes `public const string SectionName = "ScadaBridge:Cluster";` as the single source of truth for the `appsettings.json` section name, with an XML doc explaining its -purpose. The chosen value matches the `ScadaLink:`-prefixed section convention used by +purpose. The chosen value matches the `ScadaBridge:`-prefixed section convention used by peer option classes and referenced by `ClusterOptionsValidator` / the design doc. Covered by `ClusterOptionsTests.SectionName_IsTheExpectedAppSettingsSection`, which both pins the value and — by referencing the constant — guards against its removal @@ -413,7 +413,7 @@ both pins the value and — by referencing the constant — guards against its r | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsTests.cs:1-51` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsTests.cs:1-51` | **Description** @@ -438,14 +438,14 @@ from `ClusterOptions` and for the options validation from CI-004. **Resolution** Re-triaged in light of CI-001's resolution. The Akka bootstrap, HOCON generation, -cluster formation, failover and singleton handover are owned by `ScadaLink.Host`, not +cluster formation, failover and singleton handover are owned by `ZB.MOM.WW.ScadaBridge.Host`, not this project — multi-node `Akka.Cluster.TestKit` tests for that behaviour belong in the Host's test suite, outside this module's scope. What this module legitimately owns is `ClusterOptions`, its validator, and the DI registration, and the testing gap there is now closed. **Resolved** — fixing commit `commit pending`, date 2026-05-16. Added two test classes -to `tests/ScadaLink.ClusterInfrastructure.Tests`: `ClusterOptionsValidatorTests` +to `tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests`: `ClusterOptionsValidatorTests` (8 cases — valid defaults pass; `MinNrOfMembers != 1`, unsupported split-brain strategies, empty seed nodes, heartbeat not below the failure threshold, non-positive `StableAfter` all fail; and a multi-failure accumulation case) and @@ -467,7 +467,7 @@ design); `ClusterOptionsValidator` is the layer that now rejects `keep-majority` | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptions.cs:3-11` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptions.cs:3-11` | **Description** @@ -510,7 +510,7 @@ inspection of `ClusterOptions.cs:3-74`. Module test suite green (17 passed). | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ServiceCollectionExtensions.cs:9`, `src/ScadaLink.ClusterInfrastructure/ServiceCollectionExtensions.cs:16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ServiceCollectionExtensions.cs:9`, `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ServiceCollectionExtensions.cs:16` | **Description** @@ -540,17 +540,17 @@ complete-looking design doc with no caveat. That premise has been overtaken by t CI-001/CI-002 work: - The "Phase 0 skeleton" comments no longer exist anywhere in - `src/ScadaLink.ClusterInfrastructure` (verified by `grep`). `ServiceCollectionExtensions` + `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` (verified by `grep`). `ServiceCollectionExtensions` now does real work (registers `ClusterOptionsValidator`) and `AddClusterInfrastructureActors` throws explicitly — both with accurate XML docs explaining the ownership split. - The module is no longer an unimplemented skeleton. CI-001 established that the Akka - bootstrap legitimately lives in `ScadaLink.Host`, and this project's true scope — + bootstrap legitimately lives in `ZB.MOM.WW.ScadaBridge.Host`, and this project's true scope — the `ClusterOptions` configuration contract, its validator, and DI registration — is fully implemented and tested. - The design doc `Component-ClusterInfrastructure.md` now opens with an "Implementation Note — Code Placement" section (added by CI-001) that explicitly states the component is a *design responsibility* realised across - `ScadaLink.ClusterInfrastructure` (configuration model) and `ScadaLink.Host` + `ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` (configuration model) and `ZB.MOM.WW.ScadaBridge.Host` (bootstrap/runtime wiring), and the README component table (row 13) was updated to match. A reader of the design doc no longer assumes a single fully-built project. @@ -569,7 +569,7 @@ inspection of `ServiceCollectionExtensions.cs` and | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptions.cs:74` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptions.cs:74` | **Description** @@ -577,7 +577,7 @@ The `DownIfAlone` property was added to `ClusterOptions` by CI-003's resolution part of "the split-brain configuration contract". It is public, defaults to `true`, carries an XML doc presenting it as "the design-doc requirement", and is exercised by `ClusterOptionsTests.DownIfAlone_CanBeSet`. However, nothing in the system reads it. -The Akka.NET HOCON is generated by `ScadaLink.Host.Actors.AkkaHostedService.BuildHocon`, +The Akka.NET HOCON is generated by `ZB.MOM.WW.ScadaBridge.Host.Actors.AkkaHostedService.BuildHocon`, which **hard-codes** the resolver setting: ``` @@ -596,7 +596,7 @@ field (`SeedNodes`, `MinNrOfMembers`, `SplitBrainResolverStrategy`, `StableAfter The result is a configuration property that an operator can set in `appsettings.json`, that passes validation, and that has **zero runtime effect** — setting `DownIfAlone: false` does not turn the flag off. CI-003's resolution explicitly -acknowledged this gap ("wiring it to read `DownIfAlone` is a one-line `ScadaLink.Host` +acknowledged this gap ("wiring it to read `DownIfAlone` is a one-line `ZB.MOM.WW.ScadaBridge.Host` change ... noted for the Host's review") but the wiring was never done and no tracked finding carried it, so the gap has silently persisted to commit `39d737e`. An inert, misleadingly-documented configuration knob is a correctness and design-adherence @@ -616,13 +616,13 @@ controls nothing. **Resolution** Root cause verified against the source at commit `39d737e`: -`src/ScadaLink.Host/Actors/AkkaHostedService.cs:147` hard-codes `down-if-alone = on` +`src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:147` hard-codes `down-if-alone = on` inside the `keep-oldest` block, and `BuildHocon` consumes every other `ClusterOptions` field but never reads `clusterOptions.DownIfAlone`. The finding's facts hold. The fix is correctly scoped to the **Host** module — the configuration property and its -validation legitimately live in `ScadaLink.ClusterInfrastructure` (this module), +validation legitimately live in `ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` (this module), and the per-CLAUDE.md ownership split (CI-001) places HOCON generation in -`ScadaLink.Host`. +`ZB.MOM.WW.ScadaBridge.Host`. **Resolved** — by cross-reference, date 2026-05-17. No code change in this module: `ClusterOptions.DownIfAlone` and its validation (CI-010) are correct and complete here. @@ -638,7 +638,7 @@ green (18 passed). | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptionsValidator.cs:21-71` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptionsValidator.cs:21-71` | **Description** @@ -688,27 +688,27 @@ confirmed failing, then passing after the fix. Module test suite green (18 passe | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptions.cs:24-27`, `src/ScadaLink.Host/SiteServiceRegistration.cs:100`, `src/ScadaLink.Host/StartupValidator.cs:43`, `src/ScadaLink.Host/StartupValidator.cs:75` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptions.cs:24-27`, `src/ZB.MOM.WW.ScadaBridge.Host/SiteServiceRegistration.cs:100`, `src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs:43`, `src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs:75` | -**Resolution (2026-05-28):** Took option (b) since wiring the constant into the Host's `SiteServiceRegistration.BindSharedOptions` / `StartupValidator` is outside this module's editable surface — deleted the `SectionName` constant from `ClusterOptions.cs` and the companion `SectionName_IsTheExpectedAppSettingsSection` test from `ClusterOptionsTests.cs`. The Host's `"ScadaLink:Cluster"` literals now stand alone (consistent with the implementation rather than the broken "single source of truth" claim). A code-comment placeholder records the rationale so a future Host-side change can reinstate the constant alongside the binding-site updates. +**Resolution (2026-05-28):** Took option (b) since wiring the constant into the Host's `SiteServiceRegistration.BindSharedOptions` / `StartupValidator` is outside this module's editable surface — deleted the `SectionName` constant from `ClusterOptions.cs` and the companion `SectionName_IsTheExpectedAppSettingsSection` test from `ClusterOptionsTests.cs`. The Host's `"ScadaBridge:Cluster"` literals now stand alone (consistent with the implementation rather than the broken "single source of truth" claim). A code-comment placeholder records the rationale so a future Host-side change can reinstate the constant alongside the binding-site updates. **Description** `ClusterOptions.SectionName` was added by CI-005 as `public const string SectionName = -"ScadaLink:Cluster";`, with an XML doc declaring it "the single source of truth so +"ScadaBridge:Cluster";`, with an XML doc declaring it "the single source of truth so binding sites do not hard-code the magic string". CI-005's resolution likewise framed the constant as the canonical reference value. In practice, **no caller in the solution reads it**. `grep -rn "ClusterOptions.SectionName" src/` returns zero hits. Every site that needs the section name hard-codes the literal: -- `ScadaLink.Host.SiteServiceRegistration.BindSharedOptions:100` — - `services.Configure(config.GetSection("ScadaLink:Cluster"));` -- `ScadaLink.Host.StartupValidator:43,45,75` — three `"ScadaLink:Cluster"` / - `"ScadaLink:Cluster:SeedNodes"` literals. +- `ZB.MOM.WW.ScadaBridge.Host.SiteServiceRegistration.BindSharedOptions:100` — + `services.Configure(config.GetSection("ScadaBridge:Cluster"));` +- `ZB.MOM.WW.ScadaBridge.Host.StartupValidator:43,45,75` — three `"ScadaBridge:Cluster"` / + `"ScadaBridge:Cluster:SeedNodes"` literals. The `SectionName_IsTheExpectedAppSettingsSection` test pins the constant's value but does not protect against the underlying drift hazard: if someone changes -`SectionName` to `"ScadaLink:Akka:Cluster"`, the test still passes (because it tests +`SectionName` to `"ScadaBridge:Akka:Cluster"`, the test still passes (because it tests the constant against the same literal), the validator still registers, and binding silently goes to whichever string the Host hard-codes. The constant currently provides none of the safety its XML doc claims. This is the same pattern of "inert @@ -717,7 +717,7 @@ configuration drift rather than runtime behaviour. **Recommendation** -Either (a) replace the hard-coded `"ScadaLink:Cluster"` literals in +Either (a) replace the hard-coded `"ScadaBridge:Cluster"` literals in `SiteServiceRegistration.cs:100` and `StartupValidator.cs:43,45,75` with `ClusterOptions.SectionName` (a small Host-module change, to be tracked there), or (b) if the constant is intentionally decorative, soften the XML doc so it does not @@ -731,7 +731,7 @@ guarantee the code does not deliver. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ClusterOptionsValidator.cs:30-43` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptionsValidator.cs:30-43` | **Description** @@ -741,18 +741,18 @@ guarantee the code does not deliver. > its partner. Either node can start first and form the cluster; the other joins when > it starts. No startup ordering dependency. -A correctly-configured ScadaLink deployment therefore lists **two** seed nodes. +A correctly-configured ScadaBridge deployment therefore lists **two** seed nodes. `ClusterOptionsValidator.Validate` only checks that `SeedNodes` is non-null and non-empty (`Count == 0`). A configuration with a single seed node passes validation silently — but that defeats the "no startup ordering dependency" guarantee the design doc explicitly calls out. -`ScadaLink.Host.StartupValidator:43-46` does enforce the rule: +`ZB.MOM.WW.ScadaBridge.Host.StartupValidator:43-46` does enforce the rule: ```csharp -var seedNodes = configuration.GetSection("ScadaLink:Cluster:SeedNodes").Get>(); +var seedNodes = configuration.GetSection("ScadaBridge:Cluster:SeedNodes").Get>(); if (seedNodes is null || seedNodes.Count < 2) - errors.Add("ScadaLink:Cluster:SeedNodes must have at least 2 entries"); + errors.Add("ScadaBridge:Cluster:SeedNodes must have at least 2 entries"); ``` So the rule is enforced — but by the **other** project, after the @@ -789,7 +789,7 @@ ClusterInfrastructure.Tests). | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsTests.cs:47-67` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsTests.cs:47-67` | **Resolution (2026-05-28):** Added a 10-line inline `// ClusterInfra-013: ...` block at the top of `Properties_CanBeSetToCustomValues` explicitly recording that this test exercises the POCO property setters only — the `keep-majority` strategy and `MinNrOfMembers = 2` values are explicitly forbidden in production by `ClusterOptionsValidator`, and the comment cross-references `UnsupportedSplitBrainStrategy_FailsValidation` and `MinNrOfMembers_NotOne_FailsValidation` so a future reader cannot misread the test as endorsing those values. @@ -828,7 +828,7 @@ goal is to make the test's intent self-documenting. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ClusterInfrastructure/ServiceCollectionExtensions.cs:42-48` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ServiceCollectionExtensions.cs:42-48` | **Resolution (2026-05-28):** Deleted the `AddClusterInfrastructureActors` extension method from `ServiceCollectionExtensions.cs` and its companion `AddClusterInfrastructureActors_ThrowsRatherThanSilentlySucceeding` test from `ServiceCollectionExtensionsTests.cs`. Verified no production caller existed before deletion via `grep -rn`. A code comment records the rationale (CI-001 ownership question now permanently settled; method served only to throw and was IDE-auto-complete noise). The class-level XML doc on the test file was updated to drop the stale reference to the removed test. @@ -840,7 +840,7 @@ and a body that unconditionally throws `NotImplementedException`. CI-002's resol chose "throw loudly" over "delete" specifically because CI-001 was still resolving the ownership-split question. That question is settled — the design doc, the README component table, and `Component-ClusterInfrastructure.md`'s "Implementation Note — Code -Placement" all permanently locate the Akka actor bootstrap in `ScadaLink.Host`. +Placement" all permanently locate the Akka actor bootstrap in `ZB.MOM.WW.ScadaBridge.Host`. A `grep -rn "AddClusterInfrastructureActors" src/ tests/` confirms there is no caller anywhere in the solution. The method's only consumer is its own test @@ -854,6 +854,6 @@ expecting it to register something), and gives nothing in return. Delete `AddClusterInfrastructureActors`, delete its test, and add a one-line note to `docs/requirements/Component-ClusterInfrastructure.md`'s code-placement section explicitly stating that this project exposes no actor-registration extension -(actor wiring lives in `ScadaLink.Host`). If the user prefers to keep the +(actor wiring lives in `ZB.MOM.WW.ScadaBridge.Host`). If the user prefers to keep the "fail-fast" trap, mark the method `[Obsolete(true, error: true)]` so the compiler — not the runtime — rejects the call. diff --git a/code-reviews/Commons/findings.md b/code-reviews/Commons/findings.md index 08d359a7..ba715008 100644 --- a/code-reviews/Commons/findings.md +++ b/code-reviews/Commons/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.Commons` | +| Module | `src/ZB.MOM.WW.ScadaBridge.Commons` | | Design doc | `docs/requirements/Component-Commons.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -79,8 +79,8 @@ coverage for the new types is uneven — `TrackedOperationId`, `SiteCallOperatio `Notification`, and `SiteCall` are all directly tested; the Transport types (`BundleManifest`, `EncryptionMetadata`, `BundleSession`, `BundleSummary`, `ExportSelection`, `ImportPreview`, `ImportResolution`, `ImportResult`, `ManifestContentEntry`) have only -integration-level coverage in `tests/ScadaLink.Transport.IntegrationTests/`, with no -shape/serialization tests in `ScadaLink.Commons.Tests`. +integration-level coverage in `tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/`, with no +shape/serialization tests in `ZB.MOM.WW.ScadaBridge.Commons.Tests`. ## Checklist coverage @@ -109,7 +109,7 @@ shape/serialization tests in `ScadaLink.Commons.Tests`. | 6 | Performance & resource management | ✓ | `IBundleSessionStore.EvictExpired` exists for sessions — good. `BundleSession` carries `DecryptedContent` plus `Manifest` per session; the size is bounded by the configured bundle cap but no explicit per-session size accounting. `ExternalCallResult.Response` lazy parse not thread-safe (Commons-021). | | 7 | Design-document adherence | ✓ | `Component-Commons.md` is now significantly stale relative to the actual file set: stale enum values for `AuditKind`/`AuditStatus`, missing `AuditEvent`/`SiteCall` entities, missing `IAuditLogRepository`, missing six service interfaces and `Interfaces/Transport/`, missing four `Types/*` folders and `Messages/Audit/` (Commons-017). | | 8 | Code organization & conventions | ✓ | `IOperationTrackingStore` and `IPartitionMaintenance` live at the root of `Interfaces/` rather than under `Interfaces/Services/` (Commons-018). `BundleSession.Locked` uses a magic `3` rather than a named constant (Commons-016). Message contracts and entities otherwise follow the additive-evolution / POCO / `record` conventions. | -| 9 | Testing coverage | ✓ | Transport types (`BundleManifest`, `EncryptionMetadata`, `BundleSession`, `BundleSummary`, `ExportSelection`, `ImportPreview`, `ImportResolution`, `ImportResult`, `ManifestContentEntry`) have no unit tests in `tests/ScadaLink.Commons.Tests/`; only `tests/ScadaLink.Transport.IntegrationTests/` exercises them (Commons-020). `IngestAuditEventsCommand` / `IngestCachedTelemetryCommand` / `UpsertSiteCallCommand` / `PullAuditEventsRequest` / `PullAuditEventsResponse` / `AuditTelemetryEnvelope` shape tests also absent. | +| 9 | Testing coverage | ✓ | Transport types (`BundleManifest`, `EncryptionMetadata`, `BundleSession`, `BundleSummary`, `ExportSelection`, `ImportPreview`, `ImportResolution`, `ImportResult`, `ManifestContentEntry`) have no unit tests in `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/`; only `tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/` exercises them (Commons-020). `IngestAuditEventsCommand` / `IngestCachedTelemetryCommand` / `UpsertSiteCallCommand` / `PullAuditEventsRequest` / `PullAuditEventsResponse` / `AuditTelemetryEnvelope` shape tests also absent. | | 10 | Documentation & comments | ✓ | `IAuditCorrelationContext` references `BundleImporter.ApplyAsync` — an implementation type Commons does not see, so the `` is unresolvable (Commons-022b, folded into Commons-022). `ImportPreviewItem.FieldDiffJson` and `Notification.ResolvedTargets` are JSON-string columns with no documented shape contract (Commons-022). | ## Findings @@ -121,7 +121,7 @@ shape/serialization tests in `ScadaLink.Commons.Tests`. | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/StaleTagMonitor.cs:42-46`, `:62-67` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/StaleTagMonitor.cs:42-46`, `:62-67` | **Description** @@ -162,7 +162,7 @@ internal `CallbackEnteredHook` test seam). | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/DynamicJsonElement.cs:10-17` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/DynamicJsonElement.cs:10-17` | **Description** @@ -200,7 +200,7 @@ remarks block documenting the lifetime contract. Regression tests added in | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/ScriptParameters.cs:72-86` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/ScriptParameters.cs:72-86` | **Description** @@ -241,11 +241,11 @@ contract is unchanged. Regression tests added in `ScriptParametersTests` | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Messages/Management/ManagementCommandRegistry.cs:14-35` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/ManagementCommandRegistry.cs:14-35` | **Description** -`BuildRegistry` registers only types in the exact `ScadaLink.Commons.Messages.Management` +`BuildRegistry` registers only types in the exact `ZB.MOM.WW.ScadaBridge.Commons.Messages.Management` namespace whose names end in `Command`. `GetCommandName(Type)`, however, strips a `Command` suffix from *any* type passed to it. The two halves disagree: @@ -295,7 +295,7 @@ SiteRuntime all build clean against the change. Regression tests added in | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Serialization/OpcUaEndpointConfigSerializer.cs:25-51` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Serialization/OpcUaEndpointConfigSerializer.cs:25-51` | **Description** @@ -338,7 +338,7 @@ out-of-scope to change. Regression tests added in `OpcUaEndpointConfigSerializer | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/DynamicJsonElement.cs:47-51`, `:66-76` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/DynamicJsonElement.cs:47-51`, `:66-76` | **Description** @@ -377,7 +377,7 @@ Regression tests added in `DynamicJsonElementTests` (`TryConvert_ObjectTarget_On | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/ScriptParameters.cs`, `src/ScadaLink.Commons/Serialization/OpcUaEndpointConfigSerializer.cs`, `src/ScadaLink.Commons/Validators/OpcUaEndpointConfigValidator.cs`, `src/ScadaLink.Commons/Types/StaleTagMonitor.cs`, `src/ScadaLink.Commons/Types/ScriptArgs.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/ScriptParameters.cs`, `src/ZB.MOM.WW.ScadaBridge.Commons/Serialization/OpcUaEndpointConfigSerializer.cs`, `src/ZB.MOM.WW.ScadaBridge.Commons/Validators/OpcUaEndpointConfigValidator.cs`, `src/ZB.MOM.WW.ScadaBridge.Commons/Types/StaleTagMonitor.cs`, `src/ZB.MOM.WW.ScadaBridge.Commons/Types/ScriptArgs.cs` | **Description** @@ -423,7 +423,7 @@ carve-out makes these types compliant by design. | Severity | Low | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Messages/Management/InstanceCommands.cs:10` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/InstanceCommands.cs:10` | **Description** @@ -450,12 +450,12 @@ as `Item1`/`Item2`, unfriendly to REQ-COM-5a additive evolution. Introduced a na `ConnectionBinding(string AttributeName, int DataConnectionId)` in `Messages/Management/InstanceCommands.cs` (alongside the command, matching the existing record-per-file convention) and changed `SetConnectionBindingsCommand.Bindings` to -`IReadOnlyList`. All consumers were updated in lock-step: `ScadaLink.CLI` +`IReadOnlyList`. All consumers were updated in lock-step: `ZB.MOM.WW.ScadaBridge.CLI` (`InstanceCommands.TryParseBindings` now builds a `List`), -`ScadaLink.TemplateEngine` (`InstanceService.SetConnectionBindingsAsync` parameter), -`ScadaLink.ManagementService` (`ManagementActor` forwards `cmd.Bindings` unchanged — the +`ZB.MOM.WW.ScadaBridge.TemplateEngine` (`InstanceService.SetConnectionBindingsAsync` parameter), +`ZB.MOM.WW.ScadaBridge.ManagementService` (`ManagementActor` forwards `cmd.Bindings` unchanged — the new element type flows through), and one consumer the finding did not list, -`ScadaLink.CentralUI` (`InstanceConfigure.razor`'s `SaveBindings` built a `List<(string,int)>`). +`ZB.MOM.WW.ScadaBridge.CentralUI` (`InstanceConfigure.razor`'s `SaveBindings` built a `List<(string,int)>`). A repo-wide `src/` scan confirms no other references remain. Regression tests added in `ConnectionBindingSerializationTests` (`ConnectionBinding_SerializesWithNamedProperties` asserts named `AttributeName`/`DataConnectionId` JSON properties and the absence of @@ -463,7 +463,7 @@ asserts named `AttributeName`/`DataConnectionId` JSON properties and the absence JSON round-trip); existing parse/forward tests (`ParseBindings_ValidJson_ReturnsPairs`, `SetConnectionBindings_BulkAssignment_Success`) were updated to the new type. Affected suites are green (Commons 226, CLI 77, ManagementService 55, TemplateEngine 287) and -`dotnet build ScadaLink.slnx` is clean. +`dotnet build ZB.MOM.WW.ScadaBridge.slnx` is clean. ### Commons-009 — `Component-Commons.md` is stale relative to the actual file set @@ -521,11 +521,11 @@ regression test. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.Commons.Tests/` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/` | **Description** -`ScadaLink.Commons.Tests` covers `Result`, `RetryPolicy`, `ScriptParameters`, +`ZB.MOM.WW.ScadaBridge.Commons.Tests` covers `Result`, `RetryPolicy`, `ScriptParameters`, `StaleTagMonitor`, the OPC UA validator, enums, message conventions, compatibility, and entity conventions. It does not cover several types that contain exactly the kind of edge-case logic that warrants tests: @@ -567,7 +567,7 @@ tests (up from 196). | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/Result.cs:15-20`, `:30-32`, `:36` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/Result.cs:15-20`, `:30-32`, `:36` | **Description** @@ -600,7 +600,7 @@ interpolated string, so no consumer is broken. Regression tests added in `Result | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/ValueFormatter.cs:20-27` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/ValueFormatter.cs:20-27` | **Description** @@ -639,7 +639,7 @@ each pinned under `de-DE`). | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/DynamicJsonElement.cs:40-54` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/DynamicJsonElement.cs:40-54` | **Description** @@ -682,7 +682,7 @@ tests added in `DynamicJsonElementTests` (`IndexAccess_WithLongIndex_Works`, | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Serialization/OpcUaEndpointConfigSerializer.cs:107-131` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Serialization/OpcUaEndpointConfigSerializer.cs:107-131` | **Description** @@ -733,7 +733,7 @@ describe the corrupt-typed-row branch. Regression tests added in | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/Transport/EncryptionMetadata.cs:3-8` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/Transport/EncryptionMetadata.cs:3-8` | **Resolution (2026-05-28):** Converted `EncryptionMetadata` to a non-positional `record` with an explicit constructor that enforces invariants at the type boundary: `Algorithm` must equal `"AES-256-GCM"`, `Kdf` must equal `"PBKDF2-SHA256"`, `Iterations` must lie in `[MinPbkdf2Iterations=100_000, MaxPbkdf2Iterations=10_000_000]`, and `SaltB64`/`IvB64` must be non-null (empty permitted for the BundleSerializer.Pack seed pattern). Invalid values throw `ArgumentException` (or `ArgumentNullException`) naming the offending field. Added `EncryptionMetadataTests` covering valid construction, unknown algorithm/KDF (including case sensitivity), out-of-range iteration counts (including both boundaries), and null salt/IV. Updated `BundleSecretEncryptorTests` / `BundleSerializerTests` to use `MinPbkdf2Iterations` instead of the prior 10_000 placeholder. @@ -785,7 +785,7 @@ accepted values on the record. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Types/Transport/BundleSession.cs:13-16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/Transport/BundleSession.cs:13-16` | **Resolution (2026-05-28):** Added `public const int MaxUnlockAttempts = 3;` to `BundleSession` with an XML doc cross-referencing the authoritative `TransportOptions.MaxUnlockAttemptsPerSession`. The `Locked` getter now reads `FailedUnlockAttempts >= MaxUnlockAttempts` instead of comparing against the literal `3`, and the property's XML doc names the constant. No call-site update required — the existing Transport-component `TransportOptions.MaxUnlockAttemptsPerSession` (also `3`) remains the operator-facing dial; this constant is the shim's own threshold, now searchable for a security review. @@ -883,17 +883,17 @@ needed again now. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Interfaces/IOperationTrackingStore.cs`, `src/ScadaLink.Commons/Interfaces/IPartitionMaintenance.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/IOperationTrackingStore.cs`, `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/IPartitionMaintenance.cs` | -**Resolution (2026-05-28):** Moved both files into `src/ScadaLink.Commons/Interfaces/Services/`, matching the REQ-COM-5b sub-folder convention alongside the other service interfaces (`ISiteAuditQueue`, `INodeIdentityProvider`, `ICachedCallLifecycleObserver`, etc.). The 9 consumer files across `ScadaLink.SiteRuntime`, `ScadaLink.AuditLog`, `ScadaLink.ConfigurationDatabase`, and `ScadaLink.Host` exceed the in-instructions 8-file STOP threshold for namespace rewrites, so the namespace was deliberately kept as `ScadaLink.Commons.Interfaces` (not `.Services`) — no consumer change required, build remains green. A comment in each moved file records the rationale and notes that adopting the canonical `.Services` namespace can be picked up alongside any future Commons-wide namespace tidy-up. +**Resolution (2026-05-28):** Moved both files into `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/Services/`, matching the REQ-COM-5b sub-folder convention alongside the other service interfaces (`ISiteAuditQueue`, `INodeIdentityProvider`, `ICachedCallLifecycleObserver`, etc.). The 9 consumer files across `ZB.MOM.WW.ScadaBridge.SiteRuntime`, `ZB.MOM.WW.ScadaBridge.AuditLog`, `ZB.MOM.WW.ScadaBridge.ConfigurationDatabase`, and `ZB.MOM.WW.ScadaBridge.Host` exceed the in-instructions 8-file STOP threshold for namespace rewrites, so the namespace was deliberately kept as `ZB.MOM.WW.ScadaBridge.Commons.Interfaces` (not `.Services`) — no consumer change required, build remains green. A comment in each moved file records the rationale and notes that adopting the canonical `.Services` namespace can be picked up alongside any future Commons-wide namespace tidy-up. **Description** REQ-COM-5b documents the `Interfaces/` folder as having exactly three sub-folders: `Protocol/` (REQ-COM-2), `Repositories/` (REQ-COM-4), and `Services/` (REQ-COM-4a). Two new interfaces — `IOperationTrackingStore` and `IPartitionMaintenance` — are filed at -the root of `Interfaces/` (namespace `ScadaLink.Commons.Interfaces`) rather than under -`Interfaces/Services/` (namespace `ScadaLink.Commons.Interfaces.Services`). They are +the root of `Interfaces/` (namespace `ZB.MOM.WW.ScadaBridge.Commons.Interfaces`) rather than under +`Interfaces/Services/` (namespace `ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services`). They are straightforward cross-cutting service interfaces consumed by the Audit Log component (a site-local SQLite tracking store; a central partition-maintenance hosted-service helper) and conceptually belong alongside `ISiteAuditQueue`, `ICachedCallLifecycleObserver`, etc. @@ -904,8 +904,8 @@ other recently-added service interface uses `Interfaces.Services`. **Recommendation** Move both files into `Interfaces/Services/` and adjust the namespace to -`ScadaLink.Commons.Interfaces.Services`. Update consumers in `ScadaLink.AuditLog`, -`ScadaLink.SiteRuntime`, and `ScadaLink.ConfigurationDatabase`. Add them to the +`ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services`. Update consumers in `ZB.MOM.WW.ScadaBridge.AuditLog`, +`ZB.MOM.WW.ScadaBridge.SiteRuntime`, and `ZB.MOM.WW.ScadaBridge.ConfigurationDatabase`. Add them to the REQ-COM-4a list (see Commons-017). ### Commons-019 — New `*Utc`-suffixed `DateTime` columns on `AuditEvent` / `SiteCall` are not enforced as UTC; inconsistent with `Notification`'s `DateTimeOffset` @@ -915,9 +915,9 @@ REQ-COM-4a list (see Commons-017). | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Entities/Audit/AuditEvent.cs:15-18`, `src/ScadaLink.Commons/Entities/Audit/SiteCall.cs:59-68`, `tests/ScadaLink.Commons.Tests/Entities/EntityConventionTests.cs:49-69` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Audit/AuditEvent.cs:15-18`, `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Audit/SiteCall.cs:59-68`, `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/EntityConventionTests.cs:49-69` | -**Resolution (2026-05-28):** Kept the `DateTime` type on `AuditEvent` (a `DateTimeOffset` migration is a data-shape change beyond this finding's scope) and instead enforced the UTC invariant at the assignment boundary. `AuditEvent.OccurredAtUtc` / `IngestedAtUtc` now have init-setters that call `DateTime.SpecifyKind(value, DateTimeKind.Utc)` via private backing fields, so any value supplied with `Kind=Unspecified` (`DateTime` literal, JSON deserialise, EF hydrate that bypassed the converter) is re-tagged as UTC on assignment. The record-level XML doc gained a remarks block stating the invariant and contrasting with `Notification`'s `DateTimeOffset` shape. Sibling `ConfigurationDatabase-018` adds the matching EF value converter so the read path also enforces `Kind=Utc`; the two changes travelled together. Regression coverage in `tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs::Configure_UtcConverter_HydratesOccurredAtUtcAsKindUtc`. The `SiteCall` and `EntityConventionTests` sub-points named in the location list are out of scope for this close (they fall under sibling code-review tasks). +**Resolution (2026-05-28):** Kept the `DateTime` type on `AuditEvent` (a `DateTimeOffset` migration is a data-shape change beyond this finding's scope) and instead enforced the UTC invariant at the assignment boundary. `AuditEvent.OccurredAtUtc` / `IngestedAtUtc` now have init-setters that call `DateTime.SpecifyKind(value, DateTimeKind.Utc)` via private backing fields, so any value supplied with `Kind=Unspecified` (`DateTime` literal, JSON deserialise, EF hydrate that bypassed the converter) is re-tagged as UTC on assignment. The record-level XML doc gained a remarks block stating the invariant and contrasting with `Notification`'s `DateTimeOffset` shape. Sibling `ConfigurationDatabase-018` adds the matching EF value converter so the read path also enforces `Kind=Utc`; the two changes travelled together. Regression coverage in `tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs::Configure_UtcConverter_HydratesOccurredAtUtcAsKindUtc`. The `SiteCall` and `EntityConventionTests` sub-points named in the location list are out of scope for this close (they fall under sibling code-review tasks). **Description** @@ -967,16 +967,16 @@ Option 2 is the smaller change and is consistent with how `AuditLog` rows are st SQL Server (`datetime2`, no offset). Either way the inconsistency with `Notification` should be documented in REQ-COM-1 as a deliberate choice. -### Commons-020 — Transport types and new Audit-message types have no unit tests in `ScadaLink.Commons.Tests` +### Commons-020 — Transport types and new Audit-message types have no unit tests in `ZB.MOM.WW.ScadaBridge.Commons.Tests` | | | |--|--| | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.Commons.Tests/` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/` | -**Resolution (2026-05-28):** Added `tests/ScadaLink.Commons.Tests/Types/Transport/TransportRecordsTests.cs` (14 tests) covering ctor and System.Text.Json round-trip for `BundleManifest`, `ExportSelection`, `ImportPreview` + `ImportPreviewItem`, `ImportResolution` (all four `ResolutionAction`s), and `ImportResult`, plus a record-equality sanity check that catches a positional/tuple slip. `EncryptionMetadata` (Commons-015), `AuditEvent` (init-setter / `SourceNode`), `CachedCallTelemetry`, and `AuditTelemetryEnvelope` were verified already covered by their existing focused test files; no new tests were added for those to avoid duplication. +**Resolution (2026-05-28):** Added `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/TransportRecordsTests.cs` (14 tests) covering ctor and System.Text.Json round-trip for `BundleManifest`, `ExportSelection`, `ImportPreview` + `ImportPreviewItem`, `ImportResolution` (all four `ResolutionAction`s), and `ImportResult`, plus a record-equality sanity check that catches a positional/tuple slip. `EncryptionMetadata` (Commons-015), `AuditEvent` (init-setter / `SourceNode`), `CachedCallTelemetry`, and `AuditTelemetryEnvelope` were verified already covered by their existing focused test files; no new tests were added for those to avoid duplication. **Description** @@ -984,8 +984,8 @@ The Transport (#24) work adds nine records under `Types/Transport/` (`BundleMani `EncryptionMetadata`, `BundleSession`, `BundleSummary`, `ExportSelection`, `ImportPreview` + `ImportPreviewItem`, `ImportResolution`, `ImportResult`, `ManifestContentEntry`) and four interfaces under `Interfaces/Transport/`. None of them -have a focused test file in `tests/ScadaLink.Commons.Tests/` — coverage is entirely -inside `tests/ScadaLink.Transport.IntegrationTests/`, which exercises the +have a focused test file in `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/` — coverage is entirely +inside `tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/`, which exercises the end-to-end exporter/importer flow but does not pin the Commons-level wire contracts. Similarly, the new `Messages/Audit/` folder (`IngestAuditEventsCommand`/`Reply`, @@ -1005,11 +1005,11 @@ regression. **Recommendation** -Add focused tests in `tests/ScadaLink.Commons.Tests/Types/Transport/` (round-trip +Add focused tests in `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/` (round-trip serialization for each Transport record, named JSON property assertions for `EncryptionMetadata` / `BundleManifest`, the `BundleSession.Locked` threshold — see Commons-016, the `ConflictKind`/`ResolutionAction` enum coverage), and in -`tests/ScadaLink.Commons.Tests/Messages/Audit/` (round-trip + named-property assertions +`tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/Audit/` (round-trip + named-property assertions for the seven new message files). Prioritise the contracts that cross the site→central boundary (`AuditTelemetryEnvelope`, `PullAuditEventsRequest`/`Response`, `IngestCachedTelemetryCommand`). @@ -1021,7 +1021,7 @@ boundary (`AuditTelemetryEnvelope`, `PullAuditEventsRequest`/`Response`, | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Interfaces/Services/IExternalSystemClient.cs:91-104` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/Services/IExternalSystemClient.cs:91-104` | **Resolution (2026-05-28):** Replaced the two mutable backing fields (`_response`/`_responseParsed`) with a single `private readonly Lazy _response` initialised in the field initializer — `LazyThreadSafetyMode.ExecutionAndPublication` (the default) guarantees the parse runs at most once and every concurrent reader observes the same published `DynamicJsonElement`. `Response` is now a one-line `_response.Value` expression-bodied property. Regression test `ExternalCallResultTests.Response_ConcurrentReads_ReturnSameInstance` fires 64 concurrent readers through a `Barrier` and asserts `Assert.Same` across all observed values. @@ -1074,7 +1074,7 @@ behavior. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Interfaces/Transport/IAuditCorrelationContext.cs:11`, `src/ScadaLink.Commons/Types/Transport/ImportPreview.cs:11`, `src/ScadaLink.Commons/Entities/Notifications/Notification.cs:33` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/Transport/IAuditCorrelationContext.cs:11`, `src/ZB.MOM.WW.ScadaBridge.Commons/Types/Transport/ImportPreview.cs:11`, `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Notifications/Notification.cs:33` | **Resolution (2026-05-28):** Replaced the unresolvable `` in `IAuditCorrelationContext` with a plain-text `BundleImporter.ApplyAsync` reference (qualified inline as "in the Transport component") so the XML doc no longer emits a CS1574 warning from Commons, which cannot see the implementation type. The `ImportPreviewItem.FieldDiffJson` / `Notification.ResolvedTargets` JSON-shape sub-point is tracked separately and not in scope for this close — the XML doc on `IAuditCorrelationContext` does not name those columns. @@ -1084,7 +1084,7 @@ Two related XML-doc weaknesses, both around the new Transport / Audit surface: 1. `IAuditCorrelationContext`'s remarks say ``. `BundleImporter` is the concrete - implementation in `ScadaLink.Transport.Import`, which Commons does not (and must + implementation in `ZB.MOM.WW.ScadaBridge.Transport.Import`, which Commons does not (and must not) reference. The cref is unresolvable from Commons and will surface as a build-time XML doc warning. The correct reference is the interface method `IBundleImporter.ApplyAsync`. @@ -1120,7 +1120,7 @@ Two related XML-doc weaknesses, both around the new Transport / Audit surface: | Severity | Low | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.Commons/Messages/Audit/SiteCallQueries.cs:53-66`, `:110-123`, `src/ScadaLink.Commons/Messages/Notification/NotificationOutboxQueries.cs:26-39`, `:104-123`, `src/ScadaLink.Commons/Types/SiteCallOperational.cs:42-54`, `src/ScadaLink.Commons/Types/TrackingStatusSnapshot.cs:33-46` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Audit/SiteCallQueries.cs:53-66`, `:110-123`, `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Notification/NotificationOutboxQueries.cs:26-39`, `:104-123`, `src/ZB.MOM.WW.ScadaBridge.Commons/Types/SiteCallOperational.cs:42-54`, `src/ZB.MOM.WW.ScadaBridge.Commons/Types/TrackingStatusSnapshot.cs:33-46` | **Resolution (2026-05-28):** Read all six locations and confirmed the dominant pattern is "trailing-optional with `= null` default" (`SiteCallSummary`, `SiteCallDetail`, `NotificationSummary`, `NotificationDetail`, `NotificationOutboxQueryRequest.SourceNodeFilter`, `SiteCallQueryRequest.SourceNodeFilter` all already use this form). The single odd-one-out was `TrackingStatusSnapshot.SourceNode`, declared as `string? SourceNode` with no default — added the `= null` default to unify it with the rest. Verified both existing callers (`OperationTrackingStore.cs` and `TrackingApiTests.cs`) use named arguments, so the change is purely additive. `SiteCallOperational.SourceNode` sits in the middle of its positional parameter list rather than the trailing slot — that's a separate positional-record concern outside the "trailing-optional" pattern the finding called out, and moving it would touch many telemetry/proto consumers, so it was deliberately not touched here. diff --git a/code-reviews/Communication/findings.md b/code-reviews/Communication/findings.md index c42b6a23..361cbd1b 100644 --- a/code-reviews/Communication/findings.md +++ b/code-reviews/Communication/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.Communication` | +| Module | `src/ZB.MOM.WW.ScadaBridge.Communication` | | Design doc | `docs/requirements/Component-Communication.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -107,7 +107,7 @@ Low. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Communication/DebugStreamService.cs:130-143` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/DebugStreamService.cs:130-143` | **Re-triaged 2026-05-16:** originally filed Critical, claiming an orphaned bridge actor and a multi-minute site-side resource leak on every snapshot timeout. On verification @@ -157,7 +157,7 @@ references `Communication-001`. | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/DebugStreamBridgeActor.cs:170`, `src/ScadaLink.Communication/Actors/DebugStreamBridgeActor.cs:143` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/DebugStreamBridgeActor.cs:170`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/DebugStreamBridgeActor.cs:143` | **Description** @@ -200,7 +200,7 @@ fails against the pre-fix code and passes after. | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClient.cs:77`, `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClient.cs:106` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs:77`, `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs:106` | **Description** @@ -246,7 +246,7 @@ fail against the pre-fix logic and pass after. | Severity | Medium | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:42`, `src/ScadaLink.Communication/Actors/SiteCommunicationActor.cs:22` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:42`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/SiteCommunicationActor.cs:22` | **Description** @@ -289,7 +289,7 @@ against the pre-fix code (decider yields `Restart`) and pass after. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClient.cs:25`, `src/ScadaLink.Communication/CommunicationOptions.cs:36` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs:25`, `src/ZB.MOM.WW.ScadaBridge.Communication/CommunicationOptions.cs:36` | **Description** @@ -320,7 +320,7 @@ option and update the design doc. Resolved 2026-05-16 (commit pending). Root cause confirmed: `SiteStreamGrpcClient` hard-coded the keepalive values, `GrpcMaxStreamLifetime` was referenced nowhere, and `GrpcMaxConcurrentStreams` was never bound to the server. Fix (scoped to -`src/ScadaLink.Communication`): `SiteStreamGrpcClient` gained a constructor taking +`src/ZB.MOM.WW.ScadaBridge.Communication`): `SiteStreamGrpcClient` gained a constructor taking `CommunicationOptions` and now applies `GrpcKeepAlivePingDelay`/`GrpcKeepAlivePingTimeout` to its `SocketsHttpHandler`; `SiteStreamGrpcClientFactory` gained an `IOptions` DI constructor and flows the options into every client @@ -341,7 +341,7 @@ exercise the wiring (they require the new members to even compile). | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:204` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:204` | **Description** @@ -380,7 +380,7 @@ against the pre-fix code and passes after. | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClientFactory.cs:53` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClientFactory.cs:53` | **Description** @@ -419,7 +419,7 @@ fails against the pre-fix code (clients disposed via `DisposeAsync`) and passes | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/DebugStreamBridgeActor.cs:71`, `src/ScadaLink.Communication/Actors/DebugStreamBridgeActor.cs:174` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/DebugStreamBridgeActor.cs:71`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/DebugStreamBridgeActor.cs:174` | **Description** @@ -464,7 +464,7 @@ per-event reset (`Grpc_Error_Resets_RetryCount_On_Successful_Event`) was replace | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:53`, `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:240` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:53`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:240` | **Description** @@ -503,7 +503,7 @@ registered) and passes after. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/DebugStreamBridgeActor.cs:10` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/DebugStreamBridgeActor.cs:10` | **Description** @@ -535,7 +535,7 @@ not derive from an Akka.Persistence base class; its state does not survive a res | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.Communication.Tests/` (module-wide) | +| Location | `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` (module-wide) | **Description** @@ -575,7 +575,7 @@ passes after): - Malformed `NodeAAddress` aborting `HandleSiteAddressCacheLoaded` (Communication-009) — `CentralCommunicationActorTests.MalformedSiteAddress_DoesNotAbortRefresh_OtherSitesStillRegistered` (added with this finding's resolution). -The full module suite (`dotnet test tests/ScadaLink.Communication.Tests`) is green at +The full module suite (`dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests`) is green at 111 passing tests. ### Communication-012 — gRPC client factory ignores the endpoint on a cache hit, breaking NodeA→NodeB stream failover @@ -585,7 +585,7 @@ The full module suite (`dotnet test tests/ScadaLink.Communication.Tests`) is gre | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClientFactory.cs:39`, `src/ScadaLink.Communication/Actors/DebugStreamBridgeActor.cs:166` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClientFactory.cs:39`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/DebugStreamBridgeActor.cs:166` | **Description** @@ -642,7 +642,7 @@ factory and pass after. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClientFactory.cs:58` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClientFactory.cs:58` | **Description** @@ -691,7 +691,7 @@ after. | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Grpc/SiteStreamGrpcServer.cs:124` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcServer.cs:124` | **Description** @@ -734,7 +734,7 @@ accepted. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs:401`, `tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs:401`, `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs` | **Description** @@ -775,14 +775,14 @@ than being masked by an endpoint-agnostic mock. | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:169`, `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:338-375` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:169`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:338-375` | **Resolution** — deleted the dead code path in favour of the keepalive-based detection that is the actual production behaviour: removed the `Receive` handler, the `HandleConnectionStateChanged` method, the `_debugSubscriptions` / `_inProgressDeployments` tracking dicts + the `TrackMessageForCleanup` helper that fed them, and the dead message -record `src/ScadaLink.Commons/Messages/Communication/ConnectionStateChanged.cs`. +record `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Communication/ConnectionStateChanged.cs`. The two dead tests (`ConnectionLost_DebugStreamsKilled` in CentralCommunicationActorTests, `RoundTrip_ConnectionStateChanged_Succeeds` in CompatibilityTests) were removed alongside. The design doc @@ -858,7 +858,7 @@ Either way, replace `CentralCommunicationActorTests.ConnectionLost_DebugStreamsK | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:73`, `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:501`, `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:357-367` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:73`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:501`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:357-367` | **Resolution (2026-05-28):** Closed by Comm-016 — field removed in commit ac96b83. The `_inProgressDeployments` dictionary, the `TrackMessageForCleanup` helper, @@ -917,7 +917,7 @@ caller, so the reply skips the coordinator.) | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/SiteCommunicationActor.cs:376-465` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/SiteCommunicationActor.cs:376-465` | **Description** @@ -966,7 +966,7 @@ Communication.Tests). | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:397-431` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:397-431` | **Description** @@ -1006,7 +1006,7 @@ the finding. | Severity | Low | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:567` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:567` | **Resolution (2026-05-28):** `SiteAddressCacheLoaded`'s `SiteContacts` payload is now typed as `IReadOnlyDictionary>`, enforcing the Akka.NET message-immutability convention at the type level rather than relying on producer discipline. The producer (`LoadSiteAddressesFromDb`) builds the working buckets as before and wraps each inner `List` with `AsReadOnly()` before constructing the message — the freeze is local to the single refresh tick and the cost is negligible. The consumer (`HandleSiteAddressCacheLoaded`) only ever read via `Keys`, foreach-deconstruct, `Select`, `Count` and `ToImmutableHashSet`, all of which are supported by the new read-only types, so no consumer changes were needed. The existing `MalformedSiteAddress_DoesNotAbortRefresh_OtherSitesStillRegistered` and `ClusterClientRouting_RoutesToConfiguredSite` regression tests exercise the producer→consumer flow and continue to pass under the read-only types. @@ -1037,7 +1037,7 @@ once per refresh tick. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Grpc/SiteStreamGrpcServer.cs:188-200` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcServer.cs:188-200` | **Description** @@ -1086,7 +1086,7 @@ asserts `ActiveStreamCount == 0` and that `RemoveSubscriber` was NOT called | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:67`, `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs:493` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:67`, `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs:493` | **Description** diff --git a/code-reviews/ConfigurationDatabase/findings.md b/code-reviews/ConfigurationDatabase/findings.md index 59978c60..e3f509ce 100644 --- a/code-reviews/ConfigurationDatabase/findings.md +++ b/code-reviews/ConfigurationDatabase/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.ConfigurationDatabase` | +| Module | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase` | | Design doc | `docs/requirements/Component-ConfigurationDatabase.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -13,7 +13,7 @@ ## Summary The ConfigurationDatabase module is a focused, conventional EF Core data-access layer: -a single `ScadaLinkDbContext`, Fluent API entity configurations, eight repository +a single `ScadaBridgeDbContext`, Fluent API entity configurations, eight repository implementations of Commons-defined interfaces, an `IAuditService` implementation, an `IInstanceLocator`, environment-aware migration handling, and design-time tooling support. Overall structure adheres well to the design doc and the CLAUDE.md "Code @@ -151,7 +151,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/TemplateEngineRepository.cs:30-41` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/TemplateEngineRepository.cs:30-41` | **Description** @@ -185,7 +185,7 @@ none consume derived/sub-templates; they all need the template's *member* collec (Attributes/Alarms/Scripts/Compositions), which `GetTemplateByIdAsync` already eager-loads. The `Template` entity has no child-templates navigation collection, and adding one (plus changing the interface signature) would require editing -`ScadaLink.Commons`, which is outside this module's scope. +`ZB.MOM.WW.ScadaBridge.Commons`, which is outside this module's scope. Fix applied the recommendation's secondary option: removed the dead query so the method no longer misleads or wastes a round-trip, and added an XML doc comment @@ -204,12 +204,12 @@ template-aggregate contract the callers depend on. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/DesignTimeDbContextFactory.cs:21-22` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/DesignTimeDbContextFactory.cs:21-22` | **Description** `DesignTimeDbContextFactory` falls back to a literal connection string -`"Server=localhost,1433;Database=ScadaLink_Config;User Id=sa;Password=YourPassword;TrustServerCertificate=True"` +`"Server=localhost,1433;Database=ScadaBridge_Config;User Id=sa;Password=YourPassword;TrustServerCertificate=True"` when no configured connection string is found. Embedding a credential literal (even a placeholder) in source code is a poor pattern: it is committed to version control, encourages copy-paste of `sa`/`TrustServerCertificate=True` into real environments, and @@ -220,7 +220,7 @@ silently pointing tooling at an unintended database. Remove the hardcoded fallback. If no connection string is resolved from configuration or environment, throw a clear `InvalidOperationException` instructing the developer to -set `ScadaLink:Database:ConfigurationDb` (or an environment variable). At minimum, read +set `ScadaBridge:Database:ConfigurationDb` (or an environment variable). At minimum, read the design-time connection string from an environment variable rather than a literal, and never use `sa`. @@ -233,7 +233,7 @@ resolves the connection string from the Host's appsettings files or, when those present, from the `SCADALINK_DESIGNTIME_CONNECTIONSTRING` environment variable, and throws a clear `InvalidOperationException` (naming both the config key and the env var) when neither yields a value. Also hardened `SetBasePath` to be applied only when the -`ScadaLink.Host` directory exists, so the factory degrades cleanly instead of throwing +`ZB.MOM.WW.ScadaBridge.Host` directory exists, so the factory degrades cleanly instead of throwing `DirectoryNotFoundException` when run from a context without a sibling Host folder. Regression tests added in `DesignTimeDbContextFactoryTests.cs`: `CreateDbContext_NoConnectionStringConfigured_ThrowsClearException`, @@ -247,13 +247,13 @@ Regression tests added in `DesignTimeDbContextFactoryTests.cs`: | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/ServiceCollectionExtensions.cs:44-49` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ServiceCollectionExtensions.cs:44-49` | **Description** The parameterless `AddConfigurationDatabase()` overload is a deliberate no-op "retained for backward compatibility during migration." If a central node is wired up with this -overload by mistake, no `ScadaLinkDbContext`, repositories, `IAuditService`, or +overload by mistake, no `ScadaBridgeDbContext`, repositories, `IAuditService`, or `IInstanceLocator` are registered. The failure does not surface at startup; it surfaces much later as opaque DI resolution exceptions the first time any consumer requests a repository — far from the actual misconfiguration. The XML comment also refers to @@ -291,7 +291,7 @@ New regression tests added in `ServiceCollectionExtensionsTests.cs`: | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Configurations/NotificationConfiguration.cs:56-57`, `src/ScadaLink.ConfigurationDatabase/Configurations/ExternalSystemConfiguration.cs:25-26,75-77` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/NotificationConfiguration.cs:56-57`, `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/ExternalSystemConfiguration.cs:25-26,75-77` | **Description** @@ -325,7 +325,7 @@ backed by ASP.NET Data Protection, which the module already uses (`IDataProtectionKeyContext`, `AddDataProtection().PersistKeysToDbContext`). Added `EncryptedStringConverter` (purpose-scoped `IDataProtector`; `Protect` on write, `Unprotect` on read; null-safe; surfaces a clear message on a `CryptographicException`). -`ScadaLinkDbContext` gained an `(options, IDataProtectionProvider)` constructor and +`ScadaBridgeDbContext` gained an `(options, IDataProtectionProvider)` constructor and applies the converter to the three secret columns in `OnModelCreating`; the DI registration in `ServiceCollectionExtensions` now constructs the context with the registered provider. The secret columns were widened to `HasMaxLength(8000)` (EF maps @@ -338,7 +338,7 @@ columns plus a null round-trip. The encryption scheme itself is fully in-module; the only remaining cross-cutting item is a documentation gap — the design doc does not yet state encryption-at-rest for these fields. That doc update is outside this module's editable scope (constraint: edit only -`src/ScadaLink.ConfigurationDatabase`, the tests, and this file) and is surfaced here +`src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase`, the tests, and this file) and is surfaced here for a follow-up to `docs/requirements/Component-ConfigurationDatabase.md`. The audit secret-leak concern is mitigated separately by CD-007's serializer hardening; whether callers should additionally redact secret-bearing entities before passing them to @@ -352,7 +352,7 @@ follow-up. The code fix in this module is complete. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Configurations/AuditConfiguration.cs:11` (entity `src/ScadaLink.Commons/Entities/Audit/AuditLogEntry.cs`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/AuditConfiguration.cs:11` (entity `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Audit/AuditLogEntry.cs`) | **Description** @@ -374,8 +374,8 @@ Resolve the discrepancy in one direction. Resolved 2026-05-16 (commit pending). Root cause confirmed against source: the `AuditLogEntry` entity declares `int Id`, while the design doc's Audit Entry Schema -table said `Long / GUID`. The entity lives in `ScadaLink.Commons` -(`src/ScadaLink.Commons/Entities/Audit/AuditLogEntry.cs`), which is outside this +table said `Long / GUID`. The entity lives in `ZB.MOM.WW.ScadaBridge.Commons` +(`src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Audit/AuditLogEntry.cs`), which is outside this module's editable scope, so the discrepancy was resolved by aligning the design doc to the code — the recommendation's second option. The schema table now records `Id` as `int (identity)` with an explicit justification: a 32-bit identity matches the key type @@ -394,7 +394,7 @@ already exercise the `int` key end to end. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Configurations/SiteConfiguration.cs:24-25` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/SiteConfiguration.cs:24-25` | **Description** @@ -434,7 +434,7 @@ the bound of the `NodeAAddress`/`NodeBAddress` siblings). | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Services/AuditService.cs:28-30` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Services/AuditService.cs:28-30` | **Description** @@ -483,7 +483,7 @@ added in `AuditServiceTests.cs`: | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/InboundApiRepository.cs:46-58` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/InboundApiRepository.cs:46-58` | **Description** @@ -532,7 +532,7 @@ capturing `ILogger` to assert the warning is emitted only on malformed input). | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/TemplateEngineRepository.cs:43-51,53-61`, `src/ScadaLink.ConfigurationDatabase/Repositories/CentralUiRepository.cs:45-55` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/TemplateEngineRepository.cs:43-51,53-61`, `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/CentralUiRepository.cs:45-55` | **Description** @@ -580,7 +580,7 @@ not a 24-row cartesian product) and | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/TemplateEngineRepository.cs`, `Repositories/DeploymentManagerRepository.cs`, `Repositories/ExternalSystemRepository.cs`, `Repositories/InboundApiRepository.cs`, `Repositories/NotificationRepository.cs`, `Repositories/SiteRepository.cs`, `Services/InstanceLocator.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/TemplateEngineRepository.cs`, `Repositories/DeploymentManagerRepository.cs`, `Repositories/ExternalSystemRepository.cs`, `Repositories/InboundApiRepository.cs`, `Repositories/NotificationRepository.cs`, `Repositories/SiteRepository.cs`, `Services/InstanceLocator.cs` | **Description** @@ -629,13 +629,13 @@ as the CD-011 regression guard. The full module suite is green. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/ExternalSystemRepository.cs:11-14`, `Repositories/InboundApiRepository.cs:11-14`, `Repositories/NotificationRepository.cs:11-14`, `Services/InstanceLocator.cs:13-16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/ExternalSystemRepository.cs:11-14`, `Repositories/InboundApiRepository.cs:11-14`, `Repositories/NotificationRepository.cs:11-14`, `Services/InstanceLocator.cs:13-16` | **Description** `SecurityRepository`, `CentralUiRepository`, `TemplateEngineRepository`, `DeploymentManagerRepository`, `SiteRepository`, and `AuditService` all guard their -injected `ScadaLinkDbContext` with `?? throw new ArgumentNullException(...)`. +injected `ScadaBridgeDbContext` with `?? throw new ArgumentNullException(...)`. `ExternalSystemRepository`, `InboundApiRepository`, `NotificationRepository`, and `InstanceLocator` assign the constructor argument directly with no guard. This is a minor consistency/maintainability issue: although the DI container will not normally @@ -651,7 +651,7 @@ inconsistent constructors so all data-access types behave uniformly. Resolved 2026-05-16 (commit pending). Root cause confirmed against source: `ExternalSystemRepository`, `InboundApiRepository`, `NotificationRepository`, and -`InstanceLocator` assigned the injected `ScadaLinkDbContext` directly with no null +`InstanceLocator` assigned the injected `ScadaBridgeDbContext` directly with no null guard, diverging from `SecurityRepository`/`CentralUiRepository`/`TemplateEngineRepository`/ `DeploymentManagerRepository`/`SiteRepository`/`AuditService`. Applied the recommendation: all four constructors now use `context ?? throw new ArgumentNullException(nameof(context))` @@ -668,7 +668,7 @@ Regression: `Constructor_NullContext_Throws` tests were added for all four affec | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Configurations/InboundApiConfiguration.cs:17-19` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/InboundApiConfiguration.cs:17-19` | **Description** @@ -720,10 +720,10 @@ Design implemented — **deterministic keyed hash** (the recommendation's first is already a high-entropy random token, and a random salt would break the deterministic by-value lookup the authentication path relies on. The pepper instead binds every hash to the deployment. Implemented as `IApiKeyHasher` / `ApiKeyHasher` - in `ScadaLink.Commons` (`Types/InboundApi/ApiKeyHasher.cs`); the constructor + in `ZB.MOM.WW.ScadaBridge.Commons` (`Types/InboundApi/ApiKeyHasher.cs`); the constructor rejects a missing or weak (`< 16`-char) pepper with `ArgumentException` — fail-fast. - **Where the pepper lives.** `InboundApiOptions.ApiKeyPepper`, a component-owned - Options class already bound from the `ScadaLink:InboundApi` configuration section + Options class already bound from the `ScadaBridge:InboundApi` configuration section (Options pattern); it is never hard-coded. `AddInboundAPI` registers `IApiKeyHasher` via a factory that reads the bound options, so a missing/weak pepper fails the deployment fast rather than degrading silently. (Operators must supply the pepper @@ -772,14 +772,14 @@ doc, and update the Central UI API-keys page, which previously displayed a maske | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/ScadaLinkDbContext.cs:107-124` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ScadaBridgeDbContext.cs:107-124` | **Description** `ApplySecretColumnEncryption` resolves the Data Protection provider as `_dataProtectionProvider ?? new EphemeralDataProtectionProvider()`. The `??` fallback is reached whenever the context is constructed via the single-argument -`ScadaLinkDbContext(DbContextOptions)` constructor — i.e. whenever no provider was +`ScadaBridgeDbContext(DbContextOptions)` constructor — i.e. whenever no provider was injected. An `EphemeralDataProtectionProvider` generates a key ring that lives only in process memory and is discarded at process exit. @@ -788,8 +788,8 @@ it only emits schema). The risk is on a *runtime write path*. The runtime curren gets the provider-bearing context only because `AddConfigurationDatabase` adds an `AddScoped` factory registration that overrides EF's activator-based registration. That override is the single thing standing between correct behaviour and silent data -corruption: any future change that resolves a `ScadaLinkDbContext` through a path the -override does not cover — an `AddPooledDbContextFactory`/`IDbContextFactory` +corruption: any future change that resolves a `ScadaBridgeDbContext` through a path the +override does not cover — an `AddPooledDbContextFactory`/`IDbContextFactory` registration, a second `AddDbContext` call, a hand-constructed context in server code — would construct the context with the single-arg constructor, encrypt secret columns with a throwaway key, and persist ciphertext that becomes **permanently undecryptable @@ -806,7 +806,7 @@ single-arg constructor but mark contexts built without a real provider as schema-only — e.g. record a flag and have the encrypting converter throw a clear `InvalidOperationException` ("secret columns cannot be written without a configured Data Protection key ring") on the first `Protect`, instead of producing throwaway -ciphertext. Also harden the DI wiring so a `ScadaLinkDbContext` cannot be resolved +ciphertext. Also harden the DI wiring so a `ScadaBridgeDbContext` cannot be resolved through the EF-activator registration at all (e.g. register only the factory, or use `AddDbContextFactory` with the explicit constructor). @@ -847,7 +847,7 @@ fail-fast guard now closes the residual gap for any other resolution path. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/ScadaLinkDbContext.cs:121-123` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ScadaBridgeDbContext.cs:121-123` | **Description** @@ -892,7 +892,7 @@ columns) — asserting each column keeps an `EncryptedStringConverter`. | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs:33-45` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs:33-45` | **Resolution** — rewrote `InsertIfNotExistsAsync` as a single raw-SQL `IF NOT EXISTS (...) INSERT` matching the @@ -903,7 +903,7 @@ catch on numbers 2601 (unique-index violation) and 2627 losers are logged at Debug and treated as no-ops, eliminating the site-retry livelock. Two SQLite-targeted assertions in `RepositoryCoverageTests` were migrated to a new MS SQL-fixture file -`tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs`, +`tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs`, which also adds a 50-way parallel race test verifying exactly one row lands and no exception bubbles. @@ -947,7 +947,7 @@ throws and exactly one row lands. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/InboundApiRepository.cs:35-39` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/InboundApiRepository.cs:35-39` | **Resolution (2026-05-28):** Took option (a) — `InboundApiRepository` ctor now accepts `Func? hasherAccessor = null` (deferred resolution to @@ -986,7 +986,7 @@ as "key not found". **Recommendation** Either (a) take `IApiKeyHasher` via constructor injection — alongside the existing -`ScadaLinkDbContext` and optional `ILogger` — and use it here so the repository +`ScadaBridgeDbContext` and optional `ILogger` — and use it here so the repository participates in the same peppered scheme as the rest of the system; or (b) delete the method from both the implementation and `IInboundApiRepository` (Commons) on the grounds that the production authentication path correctly avoids it for timing @@ -1003,7 +1003,7 @@ longer exists. | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/DeploymentManagerRepository.cs:83-97` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/DeploymentManagerRepository.cs:83-97` | **Resolution (2026-05-28):** `IDeploymentManagerRepository.DeleteDeploymentRecordAsync` now requires a `byte[] expectedRowVersion` @@ -1062,9 +1062,9 @@ when the real RowVersion is supplied. | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Configurations/AuditLogEntityTypeConfiguration.cs`, `Configurations/SiteCallEntityTypeConfiguration.cs` (mappings for `OccurredAtUtc`, `IngestedAtUtc`, `CreatedAtUtc`, `UpdatedAtUtc`, `TerminalAtUtc`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/AuditLogEntityTypeConfiguration.cs`, `Configurations/SiteCallEntityTypeConfiguration.cs` (mappings for `OccurredAtUtc`, `IngestedAtUtc`, `CreatedAtUtc`, `UpdatedAtUtc`, `TerminalAtUtc`) | -**Resolution (2026-05-28):** Added two private static `ValueConverter` / `ValueConverter` UTC-enforcing converters to `AuditLogEntityTypeConfiguration` and applied them to `AuditEvent.OccurredAtUtc` and `AuditEvent.IngestedAtUtc` via `HasConversion(...)`. The converter re-tags `DateTimeKind.Utc` on hydrate (where SQL Server's `datetime2` provider strips the Kind flag) and on write (so a producer-supplied `Kind=Unspecified` literal still lands as UTC in the model cache). Coordinates with the sibling `Commons-019` resolution (init-setter on `AuditEvent` re-tags Kind=Utc at construction). Regression test in `tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs::Configure_UtcConverter_HydratesOccurredAtUtcAsKindUtc` inserts an Unspecified-Kind value, re-reads through a cleared change-tracker, and asserts `Kind == Utc` on both columns. The `SiteCall` mapping is out of scope for this close (sibling component task). +**Resolution (2026-05-28):** Added two private static `ValueConverter` / `ValueConverter` UTC-enforcing converters to `AuditLogEntityTypeConfiguration` and applied them to `AuditEvent.OccurredAtUtc` and `AuditEvent.IngestedAtUtc` via `HasConversion(...)`. The converter re-tags `DateTimeKind.Utc` on hydrate (where SQL Server's `datetime2` provider strips the Kind flag) and on write (so a producer-supplied `Kind=Unspecified` literal still lands as UTC in the model cache). Coordinates with the sibling `Commons-019` resolution (init-setter on `AuditEvent` re-tags Kind=Utc at construction). Regression test in `tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs::Configure_UtcConverter_HydratesOccurredAtUtcAsKindUtc` inserts an Unspecified-Kind value, re-reads through a cleared change-tracker, and asserts `Kind == Utc` on both columns. The `SiteCall` mapping is out of scope for this close (sibling component task). **Description** @@ -1115,7 +1115,7 @@ modules. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Maintenance/AuditLogPartitionMaintenance.cs:181-199` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Maintenance/AuditLogPartitionMaintenance.cs:181-199` | **Resolution (2026-05-28):** Took option (a) — dropped the `try/catch (SqlException)` around the per-month SPLIT loop entirely (and the now-unused @@ -1142,7 +1142,7 @@ by either path." That rationale is correct only for an "already-exists" error — which the pre-check makes impossible. Any *other* `SqlException` — a permissions failure (the -`scadalink_audit_purger` role's `ALTER ON SCHEMA::dbo` revoked or not granted), a +`scadabridge_audit_purger` role's `ALTER ON SCHEMA::dbo` revoked or not granted), a deadlock victim, a transient connection drop, a transaction log full, an underlying filegroup full — leaves the boundary genuinely **not** created, logs a Warning (quiet by default in most appenders), and the next iteration tries to SPLIT the @@ -1174,7 +1174,7 @@ aborts after the first failure with no further SPLITs. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/AuditLogRepository.cs:378-387` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/AuditLogRepository.cs:378-387` | **Resolution (2026-05-28):** Wrapped the `reader.GetDateTime(0)` read with `DateTime.SpecifyKind(..., DateTimeKind.Utc)` so each returned boundary now carries `Kind=Utc`, matching the explicit defensive pattern already in `AuditLogPartitionMaintenance.GetMaxBoundaryAsync`. Added an inline comment explaining the rationale (SQL Server `datetime2` strips Kind through ADO.NET; boundary values are stored UTC). With sibling CD-018 also closed, the EF read path now enforces UTC at the column level — the raw-ADO defence here is belt-and-braces for this method, which bypasses EF entirely. @@ -1205,7 +1205,7 @@ converter on the column) so the defence at the read site is no longer required. | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/AuditLogRepository.cs:192-338` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/AuditLogRepository.cs:192-338` | **Resolution (2026-05-28):** Took the targeted (1) part of the recommendation — the `monthBoundary` format string is now `"yyyy-MM-dd HH:mm:ss.fffffff"` @@ -1263,7 +1263,7 @@ boundary lookup resolves to the expected partition. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/DeploymentManagerRepository.cs:8-14` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/DeploymentManagerRepository.cs:8-14` | **Description** @@ -1301,7 +1301,7 @@ No behaviour change. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Configurations/AuditLogEntityTypeConfiguration.cs:99-101`, `Migrations/20260520142214_AddAuditLogTable.cs:103-107` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/AuditLogEntityTypeConfiguration.cs:99-101`, `Migrations/20260520142214_AddAuditLogTable.cs:103-107` | **Description** @@ -1341,7 +1341,7 @@ index name remains `IX_AuditLog_CorrelationId`. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs`, `tests/.../RepositoryCoverageTests.cs:855-869` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs`, `tests/.../RepositoryCoverageTests.cs:855-869` | **Resolution (2026-05-28):** (1) Added `AuditLogPartitionMaintenanceTests.EnsureLookahead_SecondSplitThrows_LoopAborts_FirstBoundaryStillCommitted` (Skippable, MS SQL fixture) — installs a `DbCommandInterceptor` that lets the 1st `ALTER PARTITION FUNCTION pf_AuditLog_Month() SPLIT RANGE` through and throws on the 2nd, asserts the exception propagates (CD-019's no-try/catch behaviour), counts exactly one successful split, and verifies the first boundary IS now persisted in `pf_AuditLog_Month` so the next tick resumes from N+1 with no holes. (2) Added `DeploymentManagerRepositoryTests.DeleteDeploymentRecord_CurrentRowVersion_StubAttachPath_DeleteSucceeds` — production-shape happy path: caller holds the current RowVersion, change-tracker cleared, delete completes without throwing `DbUpdateConcurrencyException` and the row is gone (1 row affected). diff --git a/code-reviews/DataConnectionLayer/findings.md b/code-reviews/DataConnectionLayer/findings.md index 0d462de7..60785634 100644 --- a/code-reviews/DataConnectionLayer/findings.md +++ b/code-reviews/DataConnectionLayer/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.DataConnectionLayer` | +| Module | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer` | | Design doc | `docs/requirements/Component-DataConnectionLayer.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -123,7 +123,7 @@ DCL-007 fixed for `ReadBatchAsync`). New findings are numbered from | Severity | Critical | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:473-538` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:473-538` | **Description** @@ -171,7 +171,7 @@ whose message references `DataConnectionLayer-001`. | Severity | High | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionManagerActor.cs:131-141` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionManagerActor.cs:131-141` | **Description** @@ -204,7 +204,7 @@ intact across a transient handler exception, so the design doc's "transparent re-subscribe" guarantee (WP-10) is preserved. The actor is a long-lived stateful coordinator and its own Become/Stash reconnect state machine already recovers connection-level faults — it does not need a restart. This also aligns with the -ScadaLink convention of `Resume` for coordinator actors. Regression test +ScadaBridge convention of `Resume` for coordinator actors. Regression test `DCL002_ConnectionActorCrash_PreservesSubscriptionState` crashes the connection actor via a synchronously-throwing write and asserts the subscription survives (health report still shows 1 subscribed/resolved tag); it fails against the pre-fix `Restart` @@ -218,7 +218,7 @@ code and passes after. Fixed by the commit whose message references | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Adapters/RealOpcUaClient.cs:16-17,130-131,153,163,173,183-184` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs:16-17,130-131,153,163,173,183-184` | **Description** @@ -264,7 +264,7 @@ code and passes after. Fixed by the commit whose message references | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:495-503,529-537` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:495-503,529-537` | **Description** @@ -313,7 +313,7 @@ against the pre-fix code and pass after. Fixed by the commit whose message refer | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/DataConnectionOptions.cs:15`, `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:573-590` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/DataConnectionOptions.cs:15`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:573-590` | **Description** @@ -357,7 +357,7 @@ unbounded code and passes after. Fixed by the commit whose message references | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:645-673,721-756` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:645-673,721-756` | **Description** @@ -408,7 +408,7 @@ code and 1 after. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:187-195` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:187-195` | **Description** @@ -451,7 +451,7 @@ after. | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:540-569` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:540-569` | **Description** @@ -501,7 +501,7 @@ refactor.) | Severity | Medium — partially design-doc work outside this module's editable scope | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:189,242-297,379-449`, `docs/requirements/Component-DataConnectionLayer.md:73-85` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:189,242-297,379-449`, `docs/requirements/Component-DataConnectionLayer.md:73-85` | **Description** @@ -541,7 +541,7 @@ describes only the connect-failure failover path and does not mention the unstable-disconnect trigger. **Action required (surfaced):** the DCL design doc should be updated to document the unstable-disconnect failover path and the configurable stability threshold; that edit was deliberately not made here because this task is -scoped to `src/ScadaLink.DataConnectionLayer`, tests, and this findings file only. +scoped to `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer`, tests, and this findings file only. ### DataConnectionLayer-010 — Tag-resolution retry can issue duplicate concurrent subscribe attempts @@ -550,7 +550,7 @@ scoped to `src/ScadaLink.DataConnectionLayer`, tests, and this findings file onl | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:594-619,689-703` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:594-619,689-703` | **Description** @@ -596,7 +596,7 @@ subscribe calls); the pre-fix code dispatched on every tick (6 total). | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:486-489,278-285,416-425`, `src/ScadaLink.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:252-262` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:486-489,278-285,416-425`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:252-262` | **Description** @@ -644,7 +644,7 @@ subscriber against the pre-fix code and is dropped after. | Severity | Medium — full secure default also requires a Commons + design-doc change outside this module | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Adapters/IOpcUaClient.cs:17`, `src/ScadaLink.DataConnectionLayer/Adapters/RealOpcUaClient.cs:49,60-61`, `docs/requirements/Component-DataConnectionLayer.md:116` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/IOpcUaClient.cs:17`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs:49,60-61`, `docs/requirements/Component-DataConnectionLayer.md:116` | **Description** @@ -660,7 +660,7 @@ untrusted certs unless an operator opts in per connection. **Verification note**: Confirmed against source. Note the *authoritative* runtime default does not actually live on `OpcUaConnectionOptions` — for a real connection `OpcUaDataConnection.ConnectAsync` builds `OpcUaConnectionOptions` from -`OpcUaEndpointConfig` (in `ScadaLink.Commons`), whose `AutoAcceptUntrustedCerts` +`OpcUaEndpointConfig` (in `ZB.MOM.WW.ScadaBridge.Commons`), whose `AutoAcceptUntrustedCerts` property also defaults to `true`. `OpcUaConnectionOptions`' own default is only the fallback used when an `OpcUaConnectionOptions` is constructed directly. @@ -680,13 +680,13 @@ was added as an optional constructor parameter, defaulting to `NullLogger`, so existing callers are unaffected). Regression test `DCL012_OpcUaConnectionOptions_AutoAcceptUntrustedCerts_DefaultsToFalse` guards the new secure default. **Two parts remain outside this module's editable scope and are -surfaced as action required:** (a) `ScadaLink.Commons.Types.DataConnections.OpcUaEndpointConfig.AutoAcceptUntrustedCerts` +surfaced as action required:** (a) `ZB.MOM.WW.ScadaBridge.Commons.Types.DataConnections.OpcUaEndpointConfig.AutoAcceptUntrustedCerts` still defaults to `true` — since that is the value actually used for a real connection (see verification note above), the Commons default must also be flipped to `false` for the system to be secure-by-default; (b) `docs/requirements/Component-DataConnectionLayer.md` line 116 still documents `true` as the default and must be updated. Both edits were deliberately not made here because this task is scoped to -`src/ScadaLink.DataConnectionLayer`, tests, and this findings file only. +`src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer`, tests, and this findings file only. ### DataConnectionLayer-013 — Misleading XML comment: `RaiseDisconnected` claims thread safety it does not provide @@ -695,7 +695,7 @@ deliberately not made here because this task is scoped to | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:270-281` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:270-281` | **Description** @@ -738,7 +738,7 @@ guard), and it passes against the atomic fix. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Adapters/RealOpcUaClient.cs:325`, `src/ScadaLink.DataConnectionLayer/Adapters/RealOpcUaClient.cs:35-39,79-83` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs:325`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs:35-39,79-83` | **Description** @@ -793,7 +793,7 @@ and pass after. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:404-417`, `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:419-493` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:404-417`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:419-493` | **Description** @@ -847,7 +847,7 @@ guards the no-backup path. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:606,666-672`, `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:232-240` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:606,666-672`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:232-240` | **Description** @@ -901,7 +901,7 @@ the pre-fix code (it returned `Success: true`) and passes after; | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:229-237`, `src/ScadaLink.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:218-227` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:229-237`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:218-227` | **Description** @@ -953,7 +953,7 @@ pre-fix code (the batch throws, no map returned) and passes after; | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:557,564-594,653` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:557,564-594,653` | **Resolution** — added a `_subscribesInFlight` HashSet mirroring the existing `_resolutionInFlight` pattern. `HandleSubscribe` now partitions @@ -1018,7 +1018,7 @@ exactly one `_adapter.SubscribeAsync(tag, ...)` call (and no orphan subscription | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:31,167,177`, `src/ScadaLink.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:163-164` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:31,167,177`, `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaDataConnection.cs:163-164` | **Resolution** — deleted the dead `_subscriptionHandles` field outright. Subscription bookkeeping lives in `RealOpcUaClient._monitoredItems` / @@ -1085,7 +1085,7 @@ state. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:653-661,670-688` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:653-661,670-688` | **Resolution** — split the success branch into "fresh subscribe" vs "unresolved → resolved promotion": `_unresolvedTags.Remove(...)` is now @@ -1150,7 +1150,7 @@ test that asserts `_totalSubscribed` / `_resolvedTags` consistency after the | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:626-634,642-687` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:626-634,642-687` | **Resolution** — `HandleSubscribeCompleted` now detects the mid-termination race: when `_subscriptionsByInstance.TryGetValue` fails, @@ -1218,7 +1218,7 @@ for A while the subscribe I/O is in flight, completes the subscribe, and asserts | Severity | Medium | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs:691-698,991-998` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs:691-698,991-998` | **Resolution** — both call sites now gate `Timers.StartPeriodicTimer("tag-resolution-retry", ...)` with diff --git a/code-reviews/DeploymentManager/findings.md b/code-reviews/DeploymentManager/findings.md index 036ff4ac..8b4e5c96 100644 --- a/code-reviews/DeploymentManager/findings.md +++ b/code-reviews/DeploymentManager/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.DeploymentManager` | +| Module | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager` | | Design doc | `docs/requirements/Component-DeploymentManager.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -109,7 +109,7 @@ The remaining six findings are medium/low: lifecycle-timeout audit gap | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:141-199` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:141-199` | **Description** @@ -151,7 +151,7 @@ stuck in `InProgress`. Regression test: | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:186-196` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:186-196` | **Description** @@ -190,7 +190,7 @@ error) if persistence still fails. Regression test: | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:155-170` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:155-170` | **Description** @@ -237,7 +237,7 @@ Regression test: | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:312-319` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:312-319` | **Description** @@ -278,7 +278,7 @@ record is orphaned and must be reconciled. Regression test: | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/OperationLockManager.cs:15-33` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/OperationLockManager.cs:15-33` | **Description** @@ -323,7 +323,7 @@ Regression tests: `AcquireAsync_ReleasedLock_RemovesSemaphoreEntry`, | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:84-200,363-368` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:84-200,363-368` | **Description** @@ -386,7 +386,7 @@ stale-rejection) when the query fails. Regression tests: | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:334-358,401-406` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:334-358,401-406` | **Description** @@ -432,7 +432,7 @@ Regression test: `GetDeploymentComparisonAsync_ProducesStructuredDiff`. | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/ServiceCollectionExtensions.cs:7-14` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ServiceCollectionExtensions.cs:7-14` | **Description** @@ -453,14 +453,14 @@ no equivalent for `DeploymentManagerOptions`. Add an `IConfiguration` parameter (or a configure callback) to `AddDeploymentManager` and bind `DeploymentManagerOptions` to a section such as -`ScadaLink:DeploymentManager`, consistent with the other components. +`ScadaBridge:DeploymentManager`, consistent with the other components. **Resolution** Resolved 2026-05-16 (commit pending): `AddDeploymentManager()` now calls `services.AddOptions()` so `IOptions` is always resolvable, and `Host/Program.cs` binds the -`ScadaLink:DeploymentManager` section (exposed as +`ScadaBridge:DeploymentManager` section (exposed as `ServiceCollectionExtensions.OptionsSection`) via `services.Configure(...)` — the same pattern the Host uses for `SecurityOptions`/`InboundApiOptions`. An earlier attempt added an @@ -479,7 +479,7 @@ configuration binding. Regression tests: | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:288` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:288` | **Description** @@ -515,7 +515,7 @@ would be meaningless). | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/ArtifactDeploymentService.cs:136,194-211` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ArtifactDeploymentService.cs:136,194-211` | **Description** @@ -546,8 +546,8 @@ the audit log, and the UI summary all reference a single id instead of N+1 unrelated GUIDs (`RetryForSiteAsync`, an independent single-site retry, still mints its own id). Adding a dedicated `DeploymentId` *column* to `SystemArtifactDeploymentRecord` was deliberately **not** done: that entity -lives in `ScadaLink.Commons` with its EF mapping in -`ScadaLink.ConfigurationDatabase`, both outside this module's edit scope. +lives in `ZB.MOM.WW.ScadaBridge.Commons` with its EF mapping in +`ZB.MOM.WW.ScadaBridge.ConfigurationDatabase`, both outside this module's edit scope. Instead the logical `deploymentId` is embedded in the record's free-form `PerSiteStatus` JSON payload (`{ DeploymentId, Sites }`), which is fully within this module's control, so the persisted record is correlatable with the @@ -564,7 +564,7 @@ Regression tests: `DeployToAllSitesAsync_AllPerSiteCommandsShareTheSummaryDeploy | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.DeploymentManager.Tests/DeploymentServiceTests.cs:100-151,155-199` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentServiceTests.cs:100-151,155-199` | **Description** @@ -619,7 +619,7 @@ which asserts on `IAuditService.LogAsync`. Regression tests: | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentManagerOptions.cs:8-9` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentManagerOptions.cs:8-9` | **Description** @@ -664,7 +664,7 @@ the call hung the full 30 s and threw `AskTimeoutException`). | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/ArtifactDeploymentService.cs:108-111` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ArtifactDeploymentService.cs:108-111` | **Description** @@ -690,14 +690,14 @@ into the artifact (which the design explicitly mandates — SMTP configuration i a deployable artifact) and **never logs it** — the three log statements in `DeployToAllSitesAsync` only reference `SiteId`, `SiteName`, `DeploymentId`, and `ex.Message`, never the credential. There is no defect to fix purely within -`src/ScadaLink.DeploymentManager`. The finding's remaining recommendations are +`src/ZB.MOM.WW.ScadaBridge.DeploymentManager`. The finding's remaining recommendations are all cross-module and one needs a design decision: - - inter-cluster transport TLS — `ScadaLink.Communication` / - `ScadaLink.ClusterInfrastructure` (Akka remoting + ClusterClient config); - - at-rest encryption of the credential on site SQLite — `ScadaLink.SiteRuntime` + - inter-cluster transport TLS — `ZB.MOM.WW.ScadaBridge.Communication` / + `ZB.MOM.WW.ScadaBridge.ClusterInfrastructure` (Akka remoting + ClusterClient config); + - at-rest encryption of the credential on site SQLite — `ZB.MOM.WW.ScadaBridge.SiteRuntime` artifact store; - encrypting the credential field inside the artifact payload — needs the - `SmtpConfigurationArtifact` shape in `ScadaLink.Commons` plus cooperating + `SmtpConfigurationArtifact` shape in `ZB.MOM.WW.ScadaBridge.Commons` plus cooperating producer (DeploymentManager) and consumer (SiteRuntime) changes, and a **key-management design decision** (where the encryption key lives, how it is distributed to sites) that cannot be made unilaterally here. @@ -733,7 +733,7 @@ option rather than an open defect. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs:86-90` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs:86-90` | **Description** @@ -773,7 +773,7 @@ covers DeploymentManager-010), `DeployToAllSitesAsync_PartialFailure_ReportsPerS | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:631-655` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:631-655` | **Description** @@ -834,7 +834,7 @@ threaded into `TryReconcileWithSiteAsync`). Regression test: | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:639-651` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:639-651` | **Description** @@ -877,7 +877,7 @@ entry, and the site's actually-applied revision all agree. Regression test: | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:562-570` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:562-570` | **Description** @@ -913,7 +913,7 @@ would be meaningless). | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:675-682,721-748` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:675-682,721-748` | **Resolution** — Added a `forceEnabledState` parameter to `ApplyPostSuccessSideEffectsAsync`. The normal deploy path passes `true` (fresh apply legitimately ends in `Enabled`); the reconciliation path passes `false`, so the helper only promotes `NotDeployed → Enabled` and leaves an existing `Disabled` (or `Enabled`) untouched. Regression test `DeployInstanceAsync_Reconciled_DisabledInstance_PreservesDisabledState` exercises the failover scenario and asserts the prior record still flips to `Success` while `Instance.State` stays `Disabled`. @@ -974,7 +974,7 @@ be marked `Success`. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:328-339,385-396,445-458` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:328-339,385-396,445-458` | **Resolution (2026-05-28):** added `TryLogLifecycleTimeoutAsync`, a private helper that mirrors the `DeployFailed` pattern — it calls `_auditService.LogAsync` @@ -1032,7 +1032,7 @@ also produces an audit entry. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:698-712` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:698-712` | **Description** @@ -1077,7 +1077,7 @@ as the actor. Tests green (80/80 in DeploymentManager.Tests). | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:107-111` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:107-111` | **Resolution (2026-05-28):** `ResolveSiteIdentifierAsync` now throws `InvalidOperationException` (`"Site with ID {siteId} not found; cannot resolve its SiteIdentifier for routing."`) when the `Site` row is missing, instead of returning the numeric id rendered as a string. The deploy path's existing try/catch turns the throw into a `DeploymentStatus.Failed` record carrying the descriptive message (the `DeploymentManager-001`/`-002` cleanup write the failure with `CancellationToken.None`); the lifecycle paths (Disable/Enable/Delete) propagate the exception so the CLI/UI caller surfaces the actual cause to the operator rather than seeing a confusing downstream "unknown site" routing error. The repository contract already returned `Site?`, so the null path is now type-visible at the call site instead of silently papered over. @@ -1117,7 +1117,7 @@ returns `Site?`, so the null path is type-visible; just don't paper over it. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/DeploymentService.cs:178-194` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/DeploymentService.cs:178-194` | **Resolution (2026-05-28):** The transient `Pending` write was dropped — the deployment record is now created directly in `DeploymentStatus.InProgress`, which collapses the start of the deploy into a single `AddDeploymentRecordAsync` + `SaveChangesAsync` + `NotifyStatusChange` (instead of two writes back-to-back). The flattening, validation, and `TryReconcileWithSiteAsync` round-trip have all completed before the insert, and the deploy command is sent immediately after, so `Pending` carried no operational meaning between the two writes. `InProgress` retains its documented "sent to site, awaiting response" semantics. Eliminating the extra `SaveChangesAsync` round-trip also removes the `Pending`→`InProgress` flicker the CentralUI-006 deployment-status page used to render via the second `IDeploymentStatusNotifier.NotifyStatusChanged` invocation. @@ -1162,7 +1162,7 @@ Either: | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.DeploymentManager/ArtifactDeploymentService.cs:82-144,169-173` | +| Location | `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ArtifactDeploymentService.cs:82-144,169-173` | **Resolution (2026-05-28):** Hoisted the global artifact queries (shared scripts, external systems + methods, DB connections, notification lists, SMTP configurations) out of the per-site loop into a new private `FetchGlobalArtifactsAsync` that produces a `GlobalArtifactSnapshot` record. `DeployToAllSitesAsync` now calls it ONCE before the loop and threads the snapshot through a new prefetched-globals overload of `BuildDeployArtifactsCommandAsync`; the public single-site overload keeps the prior fetch-then-build behaviour for `RetryForSiteAsync`. Only the per-site data-connection query remains inside the loop. Regression tests `DeployToAllSitesAsync_HoistsGlobalArtifactQueriesOutOfPerSiteLoop` (three sites; pins exactly-one call to each global getter and one per-site call to `GetDataConnectionsBySiteIdAsync`) and `RetryForSiteAsync_SingleSitePath_StillRunsTheGlobalQueriesOnce` (single-site path still owns its own fetch). @@ -1207,9 +1207,9 @@ N-site deployment. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.DeploymentManager.Tests/DeploymentServiceTests.cs:966-1075`, `tests/ScadaLink.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs:196-217` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentServiceTests.cs:966-1075`, `tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs:196-217` | -**Resolution (2026-05-28):** Replaced the `static` counters with per-test instance state. Introduced `ReconcileProbeCounters` and `SerializationProbeCounters` (in `DeploymentServiceTests`) and `ArtifactProbeRecorder` (in `ArtifactDeploymentServiceTests`); each probe actor now takes the counter object as its first constructor argument. Every test instantiates a fresh counter local, passes it via `Props.Create(() => new ReconcileProbeActor(counters, ...))`, and reads the counts directly off `counters` — no shared static fields remain. `ReconcileProbeActor`'s counter increments swap to `Interlocked.Increment` for the cross-thread CAS, and `SerializationProbeActor` retains its lock on a per-test `Gate`. All 85 `ScadaLink.DeploymentManager.Tests` continue to pass after the refactor. +**Resolution (2026-05-28):** Replaced the `static` counters with per-test instance state. Introduced `ReconcileProbeCounters` and `SerializationProbeCounters` (in `DeploymentServiceTests`) and `ArtifactProbeRecorder` (in `ArtifactDeploymentServiceTests`); each probe actor now takes the counter object as its first constructor argument. Every test instantiates a fresh counter local, passes it via `Props.Create(() => new ReconcileProbeActor(counters, ...))`, and reads the counts directly off `counters` — no shared static fields remain. `ReconcileProbeActor`'s counter increments swap to `Interlocked.Increment` for the cross-thread CAS, and `SerializationProbeActor` retains its lock on a per-test `Gate`. All 85 `ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests` continue to pass after the refactor. **Description** diff --git a/code-reviews/ExternalSystemGateway/findings.md b/code-reviews/ExternalSystemGateway/findings.md index 5389cc16..5d2a80af 100644 --- a/code-reviews/ExternalSystemGateway/findings.md +++ b/code-reviews/ExternalSystemGateway/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.ExternalSystemGateway` | +| Module | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway` | | Design doc | `docs/requirements/Component-ExternalSystemGateway.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -120,7 +120,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | Critical | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:109`, `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:81` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:109`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:81` | **Description** @@ -176,7 +176,7 @@ transient-retry paths. Fixed by the commit whose message references | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:130`, `src/ScadaLink.ExternalSystemGateway/ServiceCollectionExtensions.cs:13` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:130`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ServiceCollectionExtensions.cs:13` | **Description** @@ -221,7 +221,7 @@ swallowed as transient. Regression tests: `Call_CallerCancellation_IsNotMisreportedAsTimeout`. Note (partial scope): the per-*system* `Timeout` field on `ExternalSystemDefinition` -remains unimplemented — adding it requires a change to `ScadaLink.Commons`, which is +remains unimplemented — adding it requires a change to `ZB.MOM.WW.ScadaBridge.Commons`, which is outside this module's edit scope. Until that entity field exists, the configured `DefaultHttpTimeout` is the effective per-call limit for every system. A follow-up against the Commons module should add the `Timeout` field and have `InvokeHttpAsync` @@ -234,7 +234,7 @@ prefer it over the default. This is a tracked follow-up, not a regression. | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:84-117` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:84-117` | **Description** @@ -282,7 +282,7 @@ is flipped back to `true`. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:114-115`, `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:86-87` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:114-115`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:86-87` | **Description** @@ -291,7 +291,7 @@ is flipped back to `true`. (`MaxRetries > 0 ? ... : null`, `RetryDelay > TimeSpan.Zero ? ... : null`), otherwise falling back to the S&F defaults. The site-side repository that supplies these definitions, `SiteExternalSystemRepository.MapExternalSystem` -(`src/ScadaLink.SiteRuntime/Repositories/SiteExternalSystemRepository.cs:194`), never +(`src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteExternalSystemRepository.cs:194`), never reads `MaxRetries`/`RetryDelay` from SQLite at all — the constructed entities always have `MaxRetries == 0` and `RetryDelay == TimeSpan.Zero`. As a result, at sites the per-system retry settings the design doc requires are *always* discarded and the @@ -331,7 +331,7 @@ module (outside this module's edit scope) — until then, sites still supply | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:133-167` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:133-167` | **Description** @@ -368,7 +368,7 @@ are disposed; both were verified to fail before the `using` wrappers were added. | Severity | Medium — partially re-triaged: trailing-slash bug fixed; path-templating sub-issue is a design decision (see Resolution) | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:180-196` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:180-196` | **Description** @@ -419,7 +419,7 @@ in this finding) is fully resolved. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:167-177` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:167-177` | **Description** @@ -459,7 +459,7 @@ size cap alone closes the inflation/disclosure vector. | Severity | Medium — re-triaged: root cause already fixed in current source (see Resolution) | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ErrorClassifier.cs:24-30`, `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:157-159` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ErrorClassifier.cs:24-30`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:157-159` | **Description** @@ -513,7 +513,7 @@ the S&F buffer remains empty (the cancelled work is not retried). The existing | Severity | Medium — re-triaged: root cause subsumed by the ExternalSystemGateway-003 dispatch redesign (see Resolution) | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:109-117` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:109-117` | **Description** @@ -564,7 +564,7 @@ semantics shared via `InvokeHttpAsync`. | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:48-50` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:48-50` | **Description** @@ -600,7 +600,7 @@ exception propagates; it was verified to fail before the `try/catch` was added. | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:360-374`, `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:169-176` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:360-374`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:169-176` | **Description** @@ -626,7 +626,7 @@ cleaner of the two options, and one that avoids the staleness hazard a deployment-invalidated cache would introduce. Three name-keyed methods were added to `IExternalSystemRepository` -(`ScadaLink.Commons`): `GetExternalSystemByNameAsync(name)`, +(`ZB.MOM.WW.ScadaBridge.Commons`): `GetExternalSystemByNameAsync(name)`, `GetMethodByNameAsync(externalSystemId, methodName)` and `GetDatabaseConnectionByNameAsync(name)`. The connection lookup belongs on the same interface because database connection definitions are already part of @@ -636,12 +636,12 @@ followed rather than introducing a new interface. Both implementers of the interface were updated: -- `ScadaLink.ConfigurationDatabase.ExternalSystemRepository` — all three are genuine +- `ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.ExternalSystemRepository` — all three are genuine server-side keyed queries (`FirstOrDefaultAsync(x => x.Name == name)`, the method lookup additionally scoped by `ExternalSystemDefinitionId`), matching the existing `GetMethodByNameAsync` / `GetListByNameAsync` / `GetSharedScriptByNameAsync` convention in the other Central repositories. -- `ScadaLink.SiteRuntime.SiteExternalSystemRepository` — `GetExternalSystemByNameAsync` +- `ZB.MOM.WW.ScadaBridge.SiteRuntime.SiteExternalSystemRepository` — `GetExternalSystemByNameAsync` and `GetDatabaseConnectionByNameAsync` are genuine single-row indexed SQLite queries (`WHERE name = @name`; both tables have `name` as the PRIMARY KEY). `GetMethodByNameAsync` resolves the named method from the parent system's @@ -678,9 +678,9 @@ keyed query is deliberately broken): `StubResolution` / `StubConnection` helpers), so the full gateway suite now exercises and protects the keyed-lookup resolution path. -`dotnet build ScadaLink.slnx` is clean; `ScadaLink.ExternalSystemGateway.Tests` (54), -`ScadaLink.ConfigurationDatabase.Tests` (106), `ScadaLink.SiteRuntime.Tests` (196) and -`ScadaLink.Commons.Tests` (226) all pass. +`dotnet build ZB.MOM.WW.ScadaBridge.slnx` is clean; `ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests` (54), +`ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests` (106), `ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests` (196) and +`ZB.MOM.WW.ScadaBridge.Commons.Tests` (226) all pass. ### ExternalSystemGateway-012 — Permanent-failure logging requirement is not met; `_logger` is injected but unused @@ -689,7 +689,7 @@ keyed query is deliberately broken): | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:24,169-177`, `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:22` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:24,169-177`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:22` | **Description** @@ -734,7 +734,7 @@ against over-logging transient failures). | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemGatewayOptions.cs:9,12`, `src/ScadaLink.ExternalSystemGateway/ServiceCollectionExtensions.cs:13` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemGatewayOptions.cs:9,12`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ServiceCollectionExtensions.cs:13` | **Description** @@ -776,7 +776,7 @@ to fail before the wiring was added. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs:1`, `tests/ScadaLink.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs:1`, `tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs` | **Description** @@ -834,7 +834,7 @@ against regression. | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:120-127`, `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:102-108` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:120-127`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:102-108` | **Description** @@ -907,7 +907,7 @@ message carries the bounded default (99) and never `0`. | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ServiceCollectionExtensions.cs:21-29` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ServiceCollectionExtensions.cs:21-29` | **Description** @@ -919,7 +919,7 @@ adds the configuration to *every* `HttpClient`/`IHttpClientFactory` client creat anywhere in the host, regardless of name. The Host registers the External System Gateway alongside other components that also -use `IHttpClientFactory` — notably `ScadaLink.NotificationService` (`OAuth2TokenService` +use `IHttpClientFactory` — notably `ZB.MOM.WW.ScadaBridge.NotificationService` (`OAuth2TokenService` and its `ServiceCollectionExtensions` call `AddHttpClient`). With the ESG registration present, the OAuth2 token client (and any future `HttpClient` consumer in the host) has its **primary handler replaced** by a `SocketsHttpHandler` whose @@ -967,7 +967,7 @@ does; it was verified to fail before the fix. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:324-333` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:324-333` | **Description** @@ -1004,7 +1004,7 @@ captured request URI has no trailing `?`; it was verified to fail before the fix | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:176`, `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:151` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:176`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:151` | **Resolution** — Wrapped the `JsonSerializer.Deserialize<...>(message.PayloadJson)` call in both `ExternalSystemClient.DeliverBufferedAsync` and `DatabaseGateway.DeliverBufferedAsync` in a `try`/`catch (JsonException)` block. A `JsonException` is by definition permanent (the same payload bytes always deserialize identically), so the catch branch logs at `LogError` and returns `false`, parking the message via the S&F engine instead of letting it throw and be retried as a transient failure. Regression tests `DeliverBuffered_MalformedJsonPayload_ReturnsFalseSoMessageParks` were added to both `ExternalSystemClientTests` and `DatabaseGatewayTests` — each feeds a truncated `PayloadJson` to the handler and asserts `delivered == false` and that no exception escapes. @@ -1066,7 +1066,7 @@ message parks) and that no exception escapes the handler. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:226,257-264`, `src/ScadaLink.ExternalSystemGateway/ServiceCollectionExtensions.cs:90-102` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:226,257-264`, `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ServiceCollectionExtensions.cs:90-102` | **Resolution (2026-05-28):** Set `client.Timeout = Timeout.InfiniteTimeSpan` immediately after `_httpClientFactory.CreateClient($"ExternalSystem_{system.Name}")` in `ExternalSystemClient.InvokeHttpAsync`, disabling the framework's 100 s default so the per-call `CancellationTokenSource(_options.DefaultHttpTimeout)` linked CTS already built below is the sole timeout source. An operator-configured `DefaultHttpTimeout` greater than 100 s is now honoured verbatim instead of being silently clipped and misclassified as a transient "connection error". Kept the fix local to the allowed file (`ExternalSystemClient.cs`) rather than touching `ServiceCollectionExtensions.cs`/`GatewayHttpClientConfigurator`. Regression test `Call_DisablesHttpClientFrameworkTimeoutSoLongTimeoutsArentClipped` asserts the rented client starts with the framework's 100 s default and is set to `Timeout.InfiniteTimeSpan` after `InvokeHttpAsync` runs. @@ -1119,7 +1119,7 @@ and produces a `"Timeout calling..."` (not `"Connection error to..."`) error. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/DatabaseGateway.cs:185-193` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/DatabaseGateway.cs:185-193` | **Resolution (2026-05-28):** `JsonElementToParameterValue` now probes `TryGetInt64` → `TryGetDecimal` → `GetDouble`, so a JSON number that fits in `decimal` materialises as a `decimal` (preserving the script's authored precision on cached-write retries) and only genuinely out-of-decimal-range values fall through to `double`. Regression test `JsonElementToParameterValue_DecimalShapedNumber_PreservesPrecisionViaDecimal` round-trips `1234567890.1234567890` through a `JsonElement` and asserts the result is a `decimal` carrying the original precision; companion tests guard the long-fast-path and the out-of-range-double fallback. @@ -1183,12 +1183,12 @@ that happens to encode a number (already correctly returns `string`). | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:385-415` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:385-415` | **Resolution (2026-05-28):** `ApplyAuth` is now an instance method that uses the existing `_logger`. Three previously-silent fail-open paths now emit a `LogWarning` so an operator debugging a recurring 401 sees the cause inside -ScadaLink: (1) empty `AuthConfiguration` for `AuthType=apikey`/`basic`, +ScadaBridge: (1) empty `AuthConfiguration` for `AuthType=apikey`/`basic`, (2) unknown `AuthType` (anything except `apikey`/`basic`/`none`), (3) malformed Basic config (no `:` separator). The `AuthConfiguration` value is NEVER included in the log message. `AuthType="none"` remains @@ -1217,7 +1217,7 @@ Effectively the gateway treats every misconfiguration as "send anonymously" and relies on the remote system rejecting it with a 401/403. That is a defensible default on its own, but combined with `-007`'s 2 KB error-body cap and the fact that no audit or warning is emitted, an operator debugging "why does my external system always -return 401" has nothing to go on inside ScadaLink — the gateway never says it failed +return 401" has nothing to go on inside ScadaBridge — the gateway never says it failed to apply auth. For `AuthType = "none"` (the design's expected sentinel for unauthenticated systems) the fall-through is correct; the failure mode is misconfig. @@ -1240,7 +1240,7 @@ ever leaked in the warning text would close the test gap as well. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:233` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:233` | **Resolution (2026-05-28):** Added a `ValidateHttpMethod` helper called at the top of `InvokeHttpAsync` that rejects any verb outside the documented `GET/POST/PUT/PATCH/DELETE` allowlist (matching ESG-023's design-doc reconciliation) with a clear `ArgumentException` naming the offending verb. Allowlist is a `HashSet` with `OrdinalIgnoreCase` so the operator-authored entity column is case-insensitive. Regression tests `Call_UnsupportedHttpMethod_ThrowsArgumentException` (Theory: FOO/DLETE/GIT/OPTIONS/HEAD) and `Call_DocumentedHttpMethod_IsAccepted` (Theory: GET/get/Post/PATCH/delete) cover the rejection and the case-insensitive accept paths. @@ -1279,7 +1279,7 @@ is in the body branch but not the design-doc list; see finding 023). | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ExternalSystemGateway/ExternalSystemClient.cs:241`, `docs/requirements/Component-ExternalSystemGateway.md:43` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ExternalSystemClient.cs:241`, `docs/requirements/Component-ExternalSystemGateway.md:43` | **Resolution (2026-05-28):** Doc-only fix; confirmed PATCH is wired in `ExternalSystemClient.cs:258-260` alongside POST/PUT for body serialization. Added `PATCH` to the design doc's HTTP-method list (line 42) and updated the body/query-parameter sentence (line 75) so the documented set matches the code's `body = POST/PUT/PATCH; query = GET/DELETE` split. diff --git a/code-reviews/HealthMonitoring/findings.md b/code-reviews/HealthMonitoring/findings.md index a91f5aea..7a492167 100644 --- a/code-reviews/HealthMonitoring/findings.md +++ b/code-reviews/HealthMonitoring/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.HealthMonitoring` | +| Module | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring` | | Design doc | `docs/requirements/Component-HealthMonitoring.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -119,7 +119,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/SiteHealthCollector.cs:104`, `src/ScadaLink.HealthMonitoring/HealthReportSender.cs:79` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/SiteHealthCollector.cs:104`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/HealthReportSender.cs:79` | **Description** @@ -161,7 +161,7 @@ test. No StoreAndForward source was modified (existing public API only). | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/SiteHealthState.cs:11`, `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:86`, `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:137` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/SiteHealthState.cs:11`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:86`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:137` | **Description** @@ -209,7 +209,7 @@ and no lost updates. | Severity | Medium — re-triaged: already resolved as a side-effect of HealthMonitoring-002. | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:45-103` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:45-103` | **Description** @@ -251,7 +251,7 @@ updates and no torn snapshots. No further code change was required for this find | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:146-148`, `src/ScadaLink.HealthMonitoring/SiteHealthState.cs:21`, `src/ScadaLink.HealthMonitoring/ICentralHealthAggregator.cs:16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:146-148`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/SiteHealthState.cs:21`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/ICentralHealthAggregator.cs:16` | **Description** @@ -289,7 +289,7 @@ number, so readers can reason about the 60s offline grace. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthReportLoop.cs:48-81`, `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:149` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs:48-81`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:149` | **Description** @@ -333,7 +333,7 @@ offline after 10 minutes) verify the behaviour. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/HealthReportSender.cs:28`, `src/ScadaLink.HealthMonitoring/CentralHealthReportLoop.cs:32` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/HealthReportSender.cs:28`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs:32` | **Description** @@ -378,7 +378,7 @@ the pre-fix code, which had no `TimeProvider` parameter). | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:86-99` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:86-99` | **Description** @@ -422,7 +422,7 @@ verifies the registration; `MarkHeartbeat_KeepsSiteOnline_BetweenReports` and | Severity | Medium — re-triaged: already resolved as a side-effect of HealthMonitoring-002. | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:146-158` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:146-158` | **Description** @@ -460,7 +460,7 @@ what the HealthMonitoring-002 change did, so no further code change was required | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.HealthMonitoring.Tests/` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/` | **Description** @@ -502,8 +502,8 @@ Resolved 2026-05-16 (commit `pending`). Added the missing coverage: `SetStoreAndForwardDepths`. The `SiteHealthReportReplica` idempotency item is **out of scope** for this module: -`SiteHealthReportReplica` is declared in `ScadaLink.Commons` and published/consumed by -`CentralCommunicationActor` in the `ScadaLink.Communication` module — the +`SiteHealthReportReplica` is declared in `ZB.MOM.WW.ScadaBridge.Commons` and published/consumed by +`CentralCommunicationActor` in the `ZB.MOM.WW.ScadaBridge.Communication` module — the HealthMonitoring module itself has no replication code. Replica double-delivery idempotency is already covered by `ProcessReport`'s sequence-number guard (`ProcessReport_RejectsEqualSequence`, `ProcessReport_RejectsStaleReport_WhenSequenceNotGreater`); @@ -517,7 +517,7 @@ The HealthMonitoring test suite now stands at 47 passing tests (was 30). | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/HealthReportSender.cs:70-87` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/HealthReportSender.cs:70-87` | **Description** @@ -560,7 +560,7 @@ the pre-fix bare `catch { }` (logged-entry collection was empty). | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/ServiceCollectionExtensions.cs:42-46` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/ServiceCollectionExtensions.cs:42-46` | **Description** @@ -593,7 +593,7 @@ build and all 50 tests passing. | Severity | Low — re-triaged: already resolved as a side-effect of HealthMonitoring-002. | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/SiteHealthState.cs:11` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/SiteHealthState.cs:11` | **Description** @@ -620,7 +620,7 @@ HealthMonitoring-007 fixes. `SiteHealthState.LatestReport` is already declared `SiteHealthReport? LatestReport { get; init; }` (the recommendation's "make it properly nullable" option) with an XML doc explaining the `null` case ("known only via heartbeats, has not yet sent a report"). A codebase-wide search confirms no `null!` suppression -remains anywhere in `src/ScadaLink.HealthMonitoring`. This is exactly the change +remains anywhere in `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring`. This is exactly the change HealthMonitoring-002 made when converting `SiteHealthState` to an immutable record, so the contract is now honest and no further code change was required. @@ -631,7 +631,7 @@ the contract is now honest and no further code change was required. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:194-196` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:194-196` | **Description** @@ -680,11 +680,11 @@ would have returned 30s against the pre-fix code. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/HealthMonitoringOptions.cs:3-20`, `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:196`, `src/ScadaLink.HealthMonitoring/HealthReportSender.cs:67`, `src/ScadaLink.HealthMonitoring/CentralHealthReportLoop.cs:63` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/HealthMonitoringOptions.cs:3-20`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:196`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/HealthReportSender.cs:67`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs:63` | **Description** -`HealthMonitoringOptions` is bound from the `ScadaLink:HealthMonitoring` config +`HealthMonitoringOptions` is bound from the `ScadaBridge:HealthMonitoring` config section (`SiteServiceRegistration.BindSharedOptions`) with no validation — no `IValidateOptions`, no `ValidateDataAnnotations`, no `ValidateOnStart`. `ReportInterval`, `OfflineTimeout`, and `CentralOfflineTimeout` @@ -713,7 +713,7 @@ the hosted service with an opaque `ArgumentOutOfRangeException`. Added `HealthMonitoringOptionsValidator : IValidateOptions` that rejects non-positive `ReportInterval`/`OfflineTimeout`/`CentralOfflineTimeout` and a `CentralOfflineTimeout` shorter than `OfflineTimeout`, each failure naming the -`ScadaLink:HealthMonitoring` config key. It is registered (idempotently, via +`ScadaBridge:HealthMonitoring` config key. It is registered (idempotently, via `TryAddEnumerable`) by all three `ServiceCollectionExtensions` registration methods, so it fires when the hosted services resolve `IOptions.Value` at startup — failing fast with a clear message. (`ValidateOnStart()` lives in the Host module's binding @@ -730,7 +730,7 @@ intervals and the `CentralOfflineTimeout < OfflineTimeout` case. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:122-130`, `src/ScadaLink.HealthMonitoring/SiteHealthState.cs:27` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:122-130`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/SiteHealthState.cs:27` | **Description** @@ -784,7 +784,7 @@ the first would not compile against the pre-fix non-nullable field), and | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/SiteHealthCollector.cs:151` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/SiteHealthCollector.cs:151` | **Description** @@ -828,7 +828,7 @@ constructor. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/HealthReportSender.cs:140-154`, `src/ScadaLink.HealthMonitoring/SiteHealthCollector.cs:146-153` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/HealthReportSender.cs:140-154`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/SiteHealthCollector.cs:146-153` | **Resolution (2026-05-28):** Wrapped `_transport.Send(reportWithSeq)` in an inner try/catch that, on failure, atomically restores the captured per-interval counts via a new `ISiteHealthCollector.AddIntervalCounters(scriptErrors, alarmErrors, deadLetters, siteAuditWriteFailures, auditRedactionFailures)` API backed by `Interlocked.Add`. Concurrent increments arriving during the Send accumulate against the zero left by `CollectReport`'s `Exchange`; the restore Add sums correctly with them. The new interface method ships with a default no-op so existing test fakes (`CountCapturingHealthCollector` etc.) keep compiling without per-fake updates. Regression test `HealthReportSenderTests.SendFailure_PreservesIntervalCountersForNextReport` pre-populates all five counters, makes the first Send throw, and asserts the next successful report carries the original counts (2 / 1 / 3 / 1 / 2). @@ -882,7 +882,7 @@ report includes the previously-failed interval's `ScriptErrorCount`. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthReportLoop.cs:87-98` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs:87-98` | **Resolution (2026-05-28):** Same shape of fix as HealthMonitoring-017 — `_aggregator.ProcessReport(reportWithSeq)` now sits inside an inner try/catch that, on failure, calls `_collector.AddIntervalCounters(...)` with the captured report's counts. Reuses the same `ISiteHealthCollector.AddIntervalCounters` API; no extra collector surface. Regression test `CentralHealthReportLoopTests.ProcessReportFailure_PreservesIntervalCountersForNextReport` pre-populates all five counters, makes the first `ProcessReport` throw, and asserts the next successful report carries the original counts. @@ -919,7 +919,7 @@ collector API once it lands. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `docs/requirements/Component-HealthMonitoring.md:39,40`, `src/ScadaLink.HealthMonitoring/ICentralHealthAggregator.cs`, `src/ScadaLink.AuditLog/Central/AuditCentralHealthSnapshot.cs:39-58` | +| Location | `docs/requirements/Component-HealthMonitoring.md:39,40`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/ICentralHealthAggregator.cs`, `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditCentralHealthSnapshot.cs:39-58` | **Resolution (2026-05-28):** Took the simpler doc-removal path rather than surfacing the metrics through a new HealthMonitoring API. Removed `SiteAuditTelemetryStalled` and `CentralAuditWriteFailures` from the Monitored Metrics table, the Audit Log KPIs section, and the Audit Log Dependencies entry in `Component-HealthMonitoring.md`. The two metrics remain internal to `AuditLog`'s `AuditCentralHealthSnapshot` — promoting them to dashboard tiles is a separate feature, out of scope here. @@ -937,11 +937,11 @@ Tracing the code: - `SiteAuditTelemetryStalled` is published by `SiteAuditReconciliationActor`, picked up by `SiteAuditTelemetryStalledTracker`, and latched into `AuditCentralHealthSnapshot._stalled` (a `ConcurrentDictionary` - in the `ScadaLink.AuditLog` assembly). + in the `ZB.MOM.WW.ScadaBridge.AuditLog` assembly). - `CentralAuditWriteFailures` is incremented inside `AuditCentralHealthSnapshot` - via `ICentralAuditWriteFailureCounter.Increment()` (also in `ScadaLink.AuditLog`). + via `ICentralAuditWriteFailureCounter.Increment()` (also in `ZB.MOM.WW.ScadaBridge.AuditLog`). -Neither metric is referenced anywhere in `src/ScadaLink.HealthMonitoring/`: +Neither metric is referenced anywhere in `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/`: - `ICentralHealthAggregator` does not expose them. - `SiteHealthCollector` has no central counterpart (it is site-only). - `SiteHealthReport` has no `SiteAuditTelemetryStalled` / `CentralAuditWriteFailures` @@ -955,7 +955,7 @@ design doc places these metrics under HealthMonitoring's responsibility Dependencies section's claim that Health Monitoring provides "the central-computed `CentralAuditWriteFailures` / `AuditRedactionFailure` metrics" is false for `CentralAuditWriteFailures`: nothing under -`src/ScadaLink.HealthMonitoring/` knows about it. +`src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/` knows about it. **Recommendation** @@ -980,7 +980,7 @@ counter and per-site stalled state. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:128-147` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:128-147` | **Resolution (2026-05-28):** `MarkHeartbeat` now branches on `existing.IsOnline`: when transitioning offline-to-online it anchors @@ -1035,7 +1035,7 @@ online. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.HealthMonitoring/CentralHealthReportLoop.cs:22`, `src/ScadaLink.HealthMonitoring/CentralHealthAggregator.cs:224-226` | +| Location | `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthReportLoop.cs:22`, `src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/CentralHealthAggregator.cs:224-226` | **Resolution (2026-05-28):** `CentralHealthReportLoop.CentralSiteId` is now `"$central"` instead of `"central"`. The leading `$` is forbidden in operator-set `Site.SiteIdentifier` values (which are plain identifiers), so the synthetic central self-report cannot collide with a real site whose identifier happens to be the bare word `"central"`. The collision case the finding called out — two reports clobbering each other in the aggregator keyspace via the sequence-number guard and a real site inheriting `CentralOfflineTimeout` and staying falsely-online for an extra two minutes — is now impossible. The aggregator (`CentralHealthAggregator.CheckForOfflineSites`), the Central UI health dashboard (`Monitoring/Health.razor`), and every test reference the constant rather than the literal string, so the value change is local — no consumer code needed updating. Existing `CentralHealthAggregatorTests` and `CentralHealthReportLoopTests` already use the constant, so they continue to pin the central-self-report identity through the new sentinel. @@ -1088,9 +1088,9 @@ preserved. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs:32-42` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs:32-42` | -**Resolution (2026-05-28):** Picked the less-invasive recommended option (a) — kept the real-time `PeriodicTimer` but replaced the fixed-budget `Task.Delay` with a generous poll-until-condition helper. `RunLoopUntil(loop, condition, maxWait = 5s)` starts the hosted service, polls `condition` every 25 ms with a 5 s outer cap, and stops cleanly when met; `GeneratesCentralReports_WhenSelfIsPrimary`, `AssignsMonotonicSequenceNumbers`, and `ProcessReportFailure_PreservesIntervalCountersForNextReport` now use it. The legacy `RunLoopBriefly` retains a fixed wait (≥ 1 s) for the two tests that assert *absence* of reports (`GeneratesNoReports_WhenNotPrimary`, `SetsActiveNodeFlag_EvenWhenNotPrimary`) since there is no condition to poll for. Refactoring the production loop to consume `TimeProvider.CreateTimer` (option b) was rejected for batch scope — it would require a production change for what is currently a low-severity test-hygiene gap. All 73 `ScadaLink.HealthMonitoring.Tests` pass; the new generous budget tolerates slow CI runners. +**Resolution (2026-05-28):** Picked the less-invasive recommended option (a) — kept the real-time `PeriodicTimer` but replaced the fixed-budget `Task.Delay` with a generous poll-until-condition helper. `RunLoopUntil(loop, condition, maxWait = 5s)` starts the hosted service, polls `condition` every 25 ms with a 5 s outer cap, and stops cleanly when met; `GeneratesCentralReports_WhenSelfIsPrimary`, `AssignsMonotonicSequenceNumbers`, and `ProcessReportFailure_PreservesIntervalCountersForNextReport` now use it. The legacy `RunLoopBriefly` retains a fixed wait (≥ 1 s) for the two tests that assert *absence* of reports (`GeneratesNoReports_WhenNotPrimary`, `SetsActiveNodeFlag_EvenWhenNotPrimary`) since there is no condition to poll for. Refactoring the production loop to consume `TimeProvider.CreateTimer` (option b) was rejected for batch scope — it would require a production change for what is currently a low-severity test-hygiene gap. All 73 `ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests` pass; the new generous budget tolerates slow CI runners. **Description** @@ -1125,7 +1125,7 @@ module's tests. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `tests/ScadaLink.HealthMonitoring.Tests/SiteHealthCollectorTests.cs:117-122` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteHealthCollectorTests.cs:117-122` | **Resolution (2026-05-28):** Renamed the test method from `StoreAndForwardBufferDepths_IsEmptyPlaceholder` to `StoreAndForwardBufferDepths_DefaultsToEmpty_WhenSetterNotCalled` so the name describes what it actually asserts — the default-state contract of a fresh collector. No behaviour change; the body still constructs a collector without calling `SetStoreAndForwardDepths` and asserts `Empty(report.StoreAndForwardBufferDepths)`. diff --git a/code-reviews/Host/findings.md b/code-reviews/Host/findings.md index a6edd891..d0ed36ac 100644 --- a/code-reviews/Host/findings.md +++ b/code-reviews/Host/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.Host` | +| Module | `src/ZB.MOM.WW.ScadaBridge.Host` | | Design doc | `docs/requirements/Component-Host.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -12,12 +12,12 @@ ## Summary -The Host module is the composition root for the entire ScadaLink system: a single +The Host module is the composition root for the entire ScadaBridge system: a single binary whose behaviour (`Central` vs `Site`) is driven entirely by configuration. The implementation is generally faithful to `Component-Host.md` — startup validation, role-based registration, Serilog enrichment, Windows Service support, dead-letter monitoring, CoordinatedShutdown, and gRPC hosting on site nodes are all present and -backed by a solid test suite (`tests/ScadaLink.Host.Tests`). +backed by a solid test suite (`tests/ZB.MOM.WW.ScadaBridge.Host.Tests`). The most significant problem is the readiness endpoint: `/health/ready` runs **all** registered health checks, including the leader-only `active-node` check, so a fully @@ -74,7 +74,7 @@ call passes `default` for `CancellationToken`, so a SIGTERM during the bounded-retry window is ignored for up to ~2 minutes (Host-019); `LoggerConfigurationFactory` layers `MinimumLevel.Is` over `ReadFrom.Configuration`, so any `Serilog:MinimumLevel` an operator sets is -silently overridden by `ScadaLink:Logging:MinimumLevel` (Host-020); the +silently overridden by `ScadaBridge:Logging:MinimumLevel` (Host-020); the shipped `appsettings.json` carries a Microsoft `Logging:LogLevel` block but Serilog is the only logger provider and the section is dead config (Host-021); and `ParseLevel` silently swallows an unrecognised `MinimumLevel` value (e.g. @@ -108,7 +108,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | 7 | Design-document adherence | ☑ | Re-review: REQ-HOST-7 site-shutdown ordering — stop accepting new streams, cancel active streams via `ApplicationStopping`, then tear down actors — is not wired in `Program.cs` (Host-017). | | 8 | Code organization & conventions | ☑ | Re-review: `NodeOptions.NodeName` is absent from the shipped per-role configs even though it stamps `AuditLog.SourceNode` (Host-018); the appsettings `Logging:LogLevel` Microsoft section is dead config under Serilog (Host-021). | | 9 | Testing coverage | ☑ | Strong existing suite. No coverage for the Site `CentralContactPoints` second-entry rule (Host-016), the site-shutdown ordering (Host-017), the `NodeName`-absent shipped config (Host-018), the unused `CancellationToken` parameter (Host-019), the `MinimumLevel.Is` override semantics (Host-020) or the `ParseLevel` silent fallback (Host-022). | -| 10 | Documentation & comments | ☑ | Re-review: layered `MinimumLevel.Is` / `ReadFrom.Configuration` semantics are not surfaced — an operator-set `Serilog:MinimumLevel` is silently overridden by `ScadaLink:Logging:MinimumLevel` (Host-020); `ParseLevel` silently coerces a misspelled level to `Information` with no warning (Host-022). | +| 10 | Documentation & comments | ☑ | Re-review: layered `MinimumLevel.Is` / `ReadFrom.Configuration` semantics are not surfaced — an operator-set `Serilog:MinimumLevel` is silently overridden by `ScadaBridge:Logging:MinimumLevel` (Host-020); `ParseLevel` silently coerces a misspelled level to `Information` with no warning (Host-022). | ## Findings @@ -119,7 +119,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Host/Program.cs:135-145` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:135-145` | **Description** @@ -165,7 +165,7 @@ response body; it failed before the fix and passes after. Full Host suite green | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:70-108`, `docs/requirements/Component-Host.md` REQ-HOST-6 | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:70-108`, `docs/requirements/Component-Host.md` REQ-HOST-6 | **Description** @@ -173,7 +173,7 @@ REQ-HOST-6 states the Host "must configure the Akka.NET actor system using Akka.Hosting with ... **Persistence**: Configured with the appropriate journal and snapshot store (SQL for central, SQLite for site)." The HOCON built in `AkkaHostedService.StartAsync` contains no `akka.persistence` section, no journal and -no snapshot-store plugin, and `ScadaLink.Host.csproj` references neither +no snapshot-store plugin, and `ZB.MOM.WW.ScadaBridge.Host.csproj` references neither `Akka.Persistence.Hosting` nor any persistence plugin (the design doc Dependencies list `Akka.Persistence.Hosting`). A repo-wide search finds **no** `PersistentActor` / `ReceivePersistentActor` subclasses — the system deliberately uses custom SQLite @@ -193,7 +193,7 @@ add the plugin packages and HOCON. Either way, code and doc must agree. Resolved 2026-05-16 (commit ``). Confirmed accurate: a repo-wide search finds **no** `PersistentActor` / `ReceivePersistentActor` subclasses anywhere in `src/`, no `akka.persistence` section in the HOCON built by -`AkkaHostedService.StartAsync`, and `ScadaLink.Host.csproj` references no +`AkkaHostedService.StartAsync`, and `ZB.MOM.WW.ScadaBridge.Host.csproj` references no persistence plugin packages. The Host code is correct and internally consistent; the defect was a stale design doc. Fix: updated `docs/requirements/Component-Host.md` — REQ-HOST-6 no longer lists Persistence as a configured subsystem and now carries @@ -211,15 +211,15 @@ agree; no code or test change required. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Host/appsettings.Central.json:20-31` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Central.json:20-31` | **Description** `appsettings.Central.json` contains real-looking secrets in plaintext, checked into source control: SQL Server passwords in the `ConfigurationDb` / `MachineDataDb` -connection strings (`Password=ScadaLink_Dev1#`), an LDAP service-account password +connection strings (`Password=ScadaBridge_Dev1#`), an LDAP service-account password (`LdapServiceAccountPassword: "password"`), and a JWT signing key -(`JwtSigningKey: "scadalink-dev-jwt-signing-key-..."`). Even though these are +(`JwtSigningKey: "scadabridge-dev-jwt-signing-key-..."`). Even though these are intended as development defaults, shipping them in the default config invites them being reused verbatim in production, and a committed JWT signing key allows anyone with repo access to forge session tokens. `TrustServerCertificate=true` additionally @@ -237,16 +237,16 @@ environment. Resolved 2026-05-16 (commit `pending`). Root cause confirmed against `appsettings.Central.json`: the committed file carried real-looking secrets in -plaintext — SQL Server passwords (`Password=ScadaLink_Dev1#`) in both connection +plaintext — SQL Server passwords (`Password=ScadaBridge_Dev1#`) in both connection strings, an LDAP service-account password, and a JWT signing key. Fix: all four secrets were removed from the committed file and replaced with non-functional `${...}` placeholder references (`ConfigurationDb` / `MachineDataDb`, `LdapServiceAccountPassword`, `JwtSigningKey`). A new top-level `_secrets` note documents that the Host's configuration builder (`AddEnvironmentVariables()`) overlays the real values supplied via environment variables -(`ScadaLink__Database__ConfigurationDb`, `ScadaLink__Database__MachineDataDb`, -`ScadaLink__Security__LdapServiceAccountPassword`, -`ScadaLink__Security__JwtSigningKey`); the placeholders are intentionally invalid so +(`ScadaBridge__Database__ConfigurationDb`, `ScadaBridge__Database__MachineDataDb`, +`ScadaBridge__Security__LdapServiceAccountPassword`, +`ScadaBridge__Security__JwtSigningKey`); the placeholders are intentionally invalid so a misconfigured deployment fails loudly rather than silently using a committed key. Regression test class `ConfigSecretsTests` asserts the committed file carries no plaintext `Password=` value, no committed LDAP service-account password, and no @@ -266,13 +266,13 @@ scope; they should receive the same treatment in a follow-up. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Host/appsettings.Site.json:10-19` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json:10-19` | **Description** The shipped site config sets `Node:RemotingPort = 8082` and `Node:GrpcPort = 8083`, -but `Cluster:SeedNodes` is `["akka.tcp://scadalink@localhost:8082", -"akka.tcp://scadalink@localhost:8083"]`. The second seed node targets `8083`, which +but `Cluster:SeedNodes` is `["akka.tcp://scadabridge@localhost:8082", +"akka.tcp://scadabridge@localhost:8083"]`. The second seed node targets `8083`, which is the Kestrel HTTP/2 gRPC port — not an Akka remoting endpoint. A node attempting to join via that seed will try to establish an Akka.Remote TCP association against the gRPC listener and fail. `StartupValidator` only checks that ≥2 seed nodes exist @@ -290,7 +290,7 @@ to reject a seed node whose port equals this node's `GrpcPort`. Resolved 2026-05-16 (commit `pending`). Root cause confirmed against `appsettings.Site.json`: with `Node:RemotingPort = 8082` and `Node:GrpcPort = 8083`, -the second `Cluster:SeedNodes` entry was `akka.tcp://scadalink@localhost:8083` — the +the second `Cluster:SeedNodes` entry was `akka.tcp://scadabridge@localhost:8083` — the Kestrel HTTP/2 gRPC port, not an Akka.Remote endpoint. `StartupValidator` only checked seed-node *count* (≥2), so the misconfiguration passed silently. Fix, two parts: (1) the shipped `appsettings.Site.json` second seed entry was corrected to a @@ -313,7 +313,7 @@ appropriately before the fix and pass after. | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:345` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:345` | **Description** @@ -354,7 +354,7 @@ async startup pipeline and remain green (175 passed). | Severity | Low | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:70-108` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:70-108` | **Description** @@ -404,7 +404,7 @@ suite green (175 passed). | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Host/StartupValidator.cs:43-47` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs:43-47` | **Description** @@ -421,7 +421,7 @@ piece. Add a check in the `role == "Site"` block: if `GrpcPort` (resolved, including the 8083 default) equals `RemotingPort`, add an error -`"ScadaLink:Node:GrpcPort must differ from RemotingPort"`. +`"ScadaBridge:Node:GrpcPort must differ from RemotingPort"`. **Resolution** @@ -429,7 +429,7 @@ Resolved 2026-05-16 (commit `pending`). Root cause confirmed against `StartupValidator.cs`: the `role == "Site"` block validated the GrpcPort range but never compared it to `RemotingPort`, so a site config setting both ports equal passed validation and then failed opaquely when Kestrel and Akka.Remote both bound -the port. Fix: added `if (port == grpcPort) errors.Add("ScadaLink:Node:GrpcPort must +the port. Fix: added `if (port == grpcPort) errors.Add("ScadaBridge:Node:GrpcPort must differ from RemotingPort")` in the Site block, using the resolved GrpcPort (including the 8083 `NodeOptions` default when the key is absent) against the parsed RemotingPort. Regression tests in `StartupValidatorTests`: @@ -445,11 +445,11 @@ before the fix and pass after. Full Host suite green (175 passed). | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Host/StartupValidator.cs:33-34`, `src/ScadaLink.Host/DatabaseOptions.cs:6` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs:33-34`, `src/ZB.MOM.WW.ScadaBridge.Host/DatabaseOptions.cs:6` | **Description** -`StartupValidator` requires a non-empty `ScadaLink:Database:MachineDataDb` connection +`StartupValidator` requires a non-empty `ScadaBridge:Database:MachineDataDb` connection string for Central nodes, and `DatabaseOptions` exposes a `MachineDataDb` property, but a repo-wide search shows the value is never read anywhere outside the Host module — only `ConfigurationDb` is passed to `AddConfigurationDatabase` @@ -489,7 +489,7 @@ key harmlessly — it will simply be ignored; a follow-up may remove it for tidi | Severity | Low | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:127-141` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:127-141` | **Description** @@ -540,7 +540,7 @@ Host suite green (175 passed). | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Host/Program.cs:112-125` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:112-125` | **Description** @@ -585,40 +585,40 @@ the pre-fix code (the helper did not exist) and pass after. Full Host suite gree | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Host/LoggingOptions.cs:5`, `src/ScadaLink.Host/Program.cs:42-50` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/LoggingOptions.cs:5`, `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:42-50` | **Description** -`LoggingOptions` exposes a `MinimumLevel` property bound from `ScadaLink:Logging` +`LoggingOptions` exposes a `MinimumLevel` property bound from `ScadaBridge:Logging` (`SiteServiceRegistration.BindSharedOptions`), and both `appsettings.Central.json` and `appsettings.Site.json` set `"Logging": { "MinimumLevel": "Information" }`. However Serilog is configured purely via `ReadFrom.Configuration(configuration)`, -which reads the standard `Serilog` section — not `ScadaLink:Logging`. The +which reads the standard `Serilog` section — not `ScadaBridge:Logging`. The `LoggingOptions.MinimumLevel` value is never read by any code, so changing it has no -effect. This is misleading: an operator editing `ScadaLink:Logging:MinimumLevel` +effect. This is misleading: an operator editing `ScadaBridge:Logging:MinimumLevel` expecting a log-level change will see nothing happen. **Recommendation** Either consume `LoggingOptions.MinimumLevel` when configuring the Serilog `LoggerConfiguration` (e.g. set `MinimumLevel.Is(...)` from it), or remove the option -class and the `ScadaLink:Logging` sections and rely solely on the `Serilog` +class and the `ScadaBridge:Logging` sections and rely solely on the `Serilog` configuration section. Keep one mechanism, not two. **Resolution** Resolved 2026-05-16 (commit `pending`). Root cause confirmed: `LoggingOptions.MinimumLevel` -was bound from `ScadaLink:Logging` but Serilog was configured purely via +was bound from `ScadaBridge:Logging` but Serilog was configured purely via `ReadFrom.Configuration` (standard `Serilog` section), so editing -`ScadaLink:Logging:MinimumLevel` had no effect. Re-triaged the two options: the +`ScadaBridge:Logging:MinimumLevel` had no effect. Re-triaged the two options: the "remove the option class" branch was rejected because `Component-Host.md` REQ-HOST-3 -explicitly lists `ScadaLink:Logging` → `LoggingOptions` and that design doc is outside +explicitly lists `ScadaBridge:Logging` → `LoggingOptions` and that design doc is outside this task's edit scope — removing the class would create a fresh code-vs-doc drift. Fix (the "consume it" branch): added a `LoggerConfigurationFactory.Build` that binds `LoggingOptions`, parses `MinimumLevel` into a Serilog `LogEventLevel` (falling back to `Information` for null/blank/unrecognised values), and pins it via `MinimumLevel.Is(...)` on top of `ReadFrom.Configuration`; `Program.cs` now builds the -logger through this factory. `ScadaLink:Logging:MinimumLevel` is now live. +logger through this factory. `ScadaBridge:Logging:MinimumLevel` is now live. Regression tests in new `LoggerConfigurationTests`: `MinimumLevel_Warning_SuppressesInformationLogs`, `MinimumLevel_Debug_AllowsDebugLogs`, and `MinimumLevel_Absent_DefaultsToInformation` @@ -633,17 +633,17 @@ key). Full Host suite green (175 passed). | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:146-148` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:146-148` | **Description** `AkkaHostedService.BuildHocon` emits the split-brain-resolver block with `keep-oldest { down-if-alone = on }` as a literal constant. `ClusterOptions` -(`src/ScadaLink.ClusterInfrastructure/ClusterOptions.cs:74`) exposes a -`DownIfAlone` property — bound from `ScadaLink:Cluster` via the Options pattern, +(`src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ClusterOptions.cs:74`) exposes a +`DownIfAlone` property — bound from `ScadaBridge:Cluster` via the Options pattern, documented as "the design-doc requirement", default `true` — but a repo-wide search shows it is referenced **nowhere outside its own declaration**. The Host therefore -ignores the bound value entirely: setting `ScadaLink:Cluster:DownIfAlone` to `false` +ignores the bound value entirely: setting `ScadaBridge:Cluster:DownIfAlone` to `false` in `appsettings.json` has no effect, the resolver still runs with `down-if-alone = on`. This is the same class of defect as the resolved Host-011 (`LoggingOptions.MinimumLevel` was dead config) — a configuration option that is @@ -659,7 +659,7 @@ Make `BuildHocon` consume `clusterOptions.DownIfAlone` — emit `down-if-alone = {(clusterOptions.DownIfAlone ? "on" : "off")}` (the value is a bool, so no escaping is needed). Add a `HoconBuilderTests` case asserting both `true` and `false` produce the corresponding `down-if-alone` token. If the flag is genuinely meant to be fixed -at `on` for ScadaLink's two-node clusters, remove the `DownIfAlone` property and its +at `on` for ScadaBridge's two-node clusters, remove the `DownIfAlone` property and its doc comment instead so code and configuration contract agree — but do not leave it declared-but-dead. @@ -682,7 +682,7 @@ the fix (token was still `on`) and passes after. Full Host suite green (182 pass | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:135-136,145,151-152` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:135-136,145,151-152` | **Description** @@ -727,7 +727,7 @@ after. Full Host suite green (182 passed). | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Host/Program.cs:43-48`, `src/ScadaLink.Host/appsettings.json:1-7` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:43-48`, `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.json:1-7` | **Description** @@ -738,7 +738,7 @@ configuration section — but neither `appsettings.json` nor either role-specifi contains a `Serilog` section (only a Microsoft `Logging` section with a `LogLevel` map, which Serilog's `ReadFrom.Configuration` does not consume). The two sinks that actually run are appended in `Program.cs` as hard-coded `.WriteTo.Console(...)` and -`.WriteTo.File("logs/scadalink-.log", rollingInterval: Day)` calls. As a result the +`.WriteTo.File("logs/scadabridge-.log", rollingInterval: Day)` calls. As a result the console output template, the file path, and the rolling interval cannot be changed without recompiling — an operator cannot redirect logs, change the file location, or add a sink via configuration, contrary to REQ-HOST-8. The `ReadFrom.Configuration` @@ -761,7 +761,7 @@ role-specific file contained a `Serilog` section, so the two sinks that actually were hard-coded `.WriteTo.Console(...)` / `.WriteTo.File(...)` calls in `Program.cs` — uneditable without recompiling, contrary to REQ-HOST-8. Fix: added a `Serilog` section to `appsettings.json` with `WriteTo` entries for the Console and File sinks -(carrying the output template, file path `logs/scadalink-.log` and `Day` rolling +(carrying the output template, file path `logs/scadabridge-.log` and `Day` rolling interval as args) and removed the hard-coded `.WriteTo` calls from `Program.cs`; the factory's `ReadFrom.Configuration` (backed by the transitive `Serilog.Settings.Configuration` package) now drives the sinks. Regression tests in @@ -779,7 +779,7 @@ green (182 passed). | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Host/StartupRetry.cs:36-45` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/StartupRetry.cs:36-45` | **Description** @@ -832,13 +832,13 @@ Full Host suite green (182 passed). | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Host/appsettings.Site.json:33-37` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json:33-37` | **Description** The shipped site config sets `Node:RemotingPort = 8082` and lists `Communication:CentralContactPoints` as -`["akka.tcp://scadalink@localhost:8081", "akka.tcp://scadalink@localhost:8082"]`. +`["akka.tcp://scadabridge@localhost:8081", "akka.tcp://scadabridge@localhost:8082"]`. The second contact point — port `8082` — is the **site's own** remoting endpoint, not a central node. `SiteCommunicationActor` / `ClusterClient` uses these addresses as initial contacts when discovering the central @@ -861,7 +861,7 @@ multi-node layout). Consider extending `StartupValidator` to reject any node's `NodeHostname`+`RemotingPort`. Add a regression test in `StartupValidatorTests` mirroring `Site_SeedNodeOnGrpcPort_FailsValidation`. -**Resolution (2026-05-28):** The shipped `appsettings.Site.json` `CentralContactPoints` entry that pointed at the site's own remoting port (`localhost:8082`) was removed — the dev-loopback default now lists only the single central node (`akka.tcp://scadalink@localhost:8081`), which is the actually-reachable target in the single-node dev layout. A `_centralContactPoints` doc-key comment was added immediately above the array calling out the per-entry rule (each entry MUST be a central node's remoting endpoint, not the site's own remoting port) and explaining how to extend the list with a second central node (`akka.tcp://scadalink@central-b-host:8081`) in a multi-central deployment so ClusterClient can fail over. The dangerous example pattern that would have been copied into multi-central configs no longer exists in the template. `StartupValidator` cross-check is left as a follow-up — the documented rule plus the corrected template removes the immediate misconfiguration risk. +**Resolution (2026-05-28):** The shipped `appsettings.Site.json` `CentralContactPoints` entry that pointed at the site's own remoting port (`localhost:8082`) was removed — the dev-loopback default now lists only the single central node (`akka.tcp://scadabridge@localhost:8081`), which is the actually-reachable target in the single-node dev layout. A `_centralContactPoints` doc-key comment was added immediately above the array calling out the per-entry rule (each entry MUST be a central node's remoting endpoint, not the site's own remoting port) and explaining how to extend the list with a second central node (`akka.tcp://scadabridge@central-b-host:8081`) in a multi-central deployment so ClusterClient can fail over. The dangerous example pattern that would have been copied into multi-central configs no longer exists in the template. `StartupValidator` cross-check is left as a follow-up — the documented rule plus the corrected template removes the immediate misconfiguration risk. ### Host-017 — Site-shutdown ordering from REQ-HOST-7 is not wired @@ -870,7 +870,7 @@ node's `NodeHostname`+`RemotingPort`. Add a regression test in | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Host/Program.cs:229-265`, `src/ScadaLink.Communication/Grpc/SiteStreamGrpcServer.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:229-265`, `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcServer.cs` | **Description** @@ -904,7 +904,7 @@ before the Akka hosted service runs `CoordinatedShutdown` (or order via reverse-registration order, so the gRPC server's lifetime can be sequenced before Akka shutdown). Alternatively, reconcile REQ-HOST-7 with the actual implementation if the explicit ordering is no longer intended. Add an -integration test under `tests/ScadaLink.Host.Tests` that starts a site host, +integration test under `tests/ZB.MOM.WW.ScadaBridge.Host.Tests` that starts a site host, opens a stream, triggers shutdown, and asserts the stream completes with `Cancelled` before the actor system tears down. @@ -928,7 +928,7 @@ ordering. Clients observe a clean `Cancelled` and reconnect rather than a silent stream that times out via keepalive (~25 s). Two unit regression tests added to -`tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs`: +`tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs`: `Host017_CancelAllStreams_CancelsActiveStreamsAndRefusesNewOnes` (active streams complete, new ones rejected) and `Host017_CancelAllStreams_IsIdempotent` (double-call safe). A full site-host integration test was deferred — the @@ -942,7 +942,7 @@ unit suite covers both server-side invariants and the wiring is a single | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Host/appsettings.Central.json`, `src/ScadaLink.Host/appsettings.Site.json`, `src/ScadaLink.Host/NodeOptions.cs:10-16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Central.json`, `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json`, `src/ZB.MOM.WW.ScadaBridge.Host/NodeOptions.cs:10-16` | **Description** @@ -955,8 +955,8 @@ telemetry and reconciliation, and is indexed via `IX_AuditLog_Node_Occurred (SourceNode, OccurredAtUtc)`. The docker per-node configs (`docker/central-node-a/appsettings.Central.json`, `docker/site-a-node-a/appsettings.Site.json`, etc.) all set -`ScadaLink:Node:NodeName`. The **shipped, default** per-role files in -`src/ScadaLink.Host/` — the templates a developer running the binary +`ScadaBridge:Node:NodeName`. The **shipped, default** per-role files in +`src/ZB.MOM.WW.ScadaBridge.Host/` — the templates a developer running the binary directly will use — do not. `NodeIdentityProvider` normalises an empty `NodeName` to `null`, so dev audit rows carry a null `SourceNode` and the indexed lookup never narrows. The dev examples should match the docker @@ -972,7 +972,7 @@ per-node in multi-node deployments. Consider validating in `StartupValidator` that `NodeName` is non-empty, or accept the null and document explicitly that single-node dev deployments leave `SourceNode` null. -**Resolution (2026-05-28):** The shipped per-role templates now set `ScadaLink:Node:NodeName` — `central-a` in `appsettings.Central.json` and `node-a` in `appsettings.Site.json` — so dev audit rows are stamped with a real `SourceNode` value (instead of `NodeIdentityProvider` normalising the missing key to `null`) and the indexed `IX_AuditLog_Node_Occurred` lookup actually narrows. A `_nodeName` doc-key comment was added beside each `Node` section explaining the convention (`central-a`/`central-b` for central, `node-a`/`node-b` for site), pointing at the docker per-node configs (which already overrode the field), and noting that the value must be overridden per-node in multi-node deployments and that an empty value still normalises to a `NULL` SourceNode. The shipped dev templates now match the per-node docker examples — a developer running the binary directly no longer sees a null `SourceNode`. +**Resolution (2026-05-28):** The shipped per-role templates now set `ScadaBridge:Node:NodeName` — `central-a` in `appsettings.Central.json` and `node-a` in `appsettings.Site.json` — so dev audit rows are stamped with a real `SourceNode` value (instead of `NodeIdentityProvider` normalising the missing key to `null`) and the indexed `IX_AuditLog_Node_Occurred` lookup actually narrows. A `_nodeName` doc-key comment was added beside each `Node` section explaining the convention (`central-a`/`central-b` for central, `node-a`/`node-b` for site), pointing at the docker per-node configs (which already overrode the field), and noting that the value must be overridden per-node in multi-node deployments and that an empty value still normalises to a `NULL` SourceNode. The shipped dev templates now match the per-node docker examples — a developer running the binary directly no longer sees a null `SourceNode`. ### Host-019 — Migration `StartupRetry` call drops the host `CancellationToken` @@ -981,7 +981,7 @@ single-node dev deployments leave `SourceNode` null. | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.Host/Program.cs:154-165` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:154-165` | **Resolution (2026-05-28):** Added a `Func` overload of `StartupRetry.ExecuteWithRetryAsync` that forwards the retry-loop token into the operation, and the migration call site in `Program.cs` now passes `app.Lifetime.ApplicationStopping` as both the operation token (threaded to `MigrationHelper.ApplyOrValidateMigrationsAsync`) and the loop's `cancellationToken` (already honoured by the inter-attempt `Task.Delay`). A SIGTERM during the bounded retry window now tears down cleanly instead of waiting up to ~2 minutes for the loop to exhaust. The original `Func` overload still exists and delegates, so existing callers/tests are unchanged. @@ -1018,7 +1018,7 @@ _Open._ | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.Host/LoggerConfigurationFactory.cs:36-43` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/LoggerConfigurationFactory.cs:36-43` | **Description** @@ -1026,10 +1026,10 @@ _Open._ via `ReadFrom.Configuration(configuration)` (which can include a `MinimumLevel` block — the standard Serilog way to set the floor) and **then** calls `.MinimumLevel.Is(minimumLevel)` derived from -`ScadaLink:Logging:MinimumLevel`. Serilog's fluent builder applies the later +`ScadaBridge:Logging:MinimumLevel`. Serilog's fluent builder applies the later call, so any `Serilog:MinimumLevel:Default` an operator sets is silently -overridden by `ScadaLink:Logging:MinimumLevel` (or by its -`Information` fallback when the ScadaLink key is absent). There are now two +overridden by `ScadaBridge:Logging:MinimumLevel` (or by its +`Information` fallback when the ScadaBridge key is absent). There are now two documented configuration paths for the same setting with non-obvious precedence, and the override direction is the opposite of what most Serilog users would expect (the more-specific `Serilog` section being the authority). @@ -1041,12 +1041,12 @@ but does not warn that the floor *overrides* the Serilog section's own Pick one mechanism: either (a) drop the `MinimumLevel.Is` call and let `ReadFrom.Configuration` consume `Serilog:MinimumLevel`, migrating any docs/ -deployments that reference `ScadaLink:Logging:MinimumLevel`; or (b) keep the -current "ScadaLink:Logging" path and reject `Serilog:MinimumLevel` if present +deployments that reference `ScadaBridge:Logging:MinimumLevel`; or (b) keep the +current "ScadaBridge:Logging" path and reject `Serilog:MinimumLevel` if present (throw at startup so the operator sees the conflict). At minimum, expand the XML doc + REQ-HOST-8 to spell out the precedence explicitly. -**Resolution (2026-05-28):** `ScadaLink:Logging:MinimumLevel` is now the documented single source of truth for the Serilog floor (Host-011's `LoggingOptions` binding), and the precedence is made visible — `LoggerConfigurationFactory.Build` writes a one-shot warning to `Console.Error` when both `ScadaLink:Logging:MinimumLevel` and `Serilog:MinimumLevel` (or `Serilog:MinimumLevel:Default`) are present, naming both values and pointing the operator at the documented key. Order of operations is unchanged — `MinimumLevel.Is(...)` deliberately runs after `ReadFrom.Configuration(...)` so the ScadaLink value wins — but the silent-override behaviour is now loud. The class XML doc gained a Host-020 paragraph explicitly spelling out the precedence. A test-visible `Build(..., TextWriter warningWriter)` overload mirrors the `ParseLevel` Host-022 pattern so the warning can be asserted in unit tests; the production four-arg overload delegates with `Console.Error`. +**Resolution (2026-05-28):** `ScadaBridge:Logging:MinimumLevel` is now the documented single source of truth for the Serilog floor (Host-011's `LoggingOptions` binding), and the precedence is made visible — `LoggerConfigurationFactory.Build` writes a one-shot warning to `Console.Error` when both `ScadaBridge:Logging:MinimumLevel` and `Serilog:MinimumLevel` (or `Serilog:MinimumLevel:Default`) are present, naming both values and pointing the operator at the documented key. Order of operations is unchanged — `MinimumLevel.Is(...)` deliberately runs after `ReadFrom.Configuration(...)` so the ScadaBridge value wins — but the silent-override behaviour is now loud. The class XML doc gained a Host-020 paragraph explicitly spelling out the precedence. A test-visible `Build(..., TextWriter warningWriter)` overload mirrors the `ParseLevel` Host-022 pattern so the warning can be asserted in unit tests; the production four-arg overload delegates with `Console.Error`. ### Host-021 — Microsoft `Logging:LogLevel` section in `appsettings.json` is dead config under Serilog @@ -1055,7 +1055,7 @@ XML doc + REQ-HOST-8 to spell out the precedence explicitly. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Host/appsettings.json:2-6` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.json:2-6` | **Description** @@ -1075,10 +1075,10 @@ the .NET convention) sees no behaviour change — the section is dead config. Either remove the `Logging:LogLevel` block from `appsettings.json` (Serilog owns logging configuration in this Host), or replace it with a brief comment explaining it is intentionally retained for non-Serilog tooling. Document the -authoritative location (`Serilog` + `ScadaLink:Logging`) in +authoritative location (`Serilog` + `ScadaBridge:Logging`) in `Component-Host.md` REQ-HOST-8 if not already explicit. -**Resolution (2026-05-28):** Confirmed by repository-wide grep that no code reads `Logging:LogLevel` (the Host calls `builder.Host.UseSerilog()` which replaces the default `ILoggerFactory` setup with Serilog as the only provider), so the block was pure dead config. Removed the `Logging:LogLevel:Default = Information` block from `appsettings.json` and replaced it with a `_logging` doc-key comment explaining the rationale (Serilog is the sole provider) and pointing operators at the two authoritative keys: `ScadaLink:Logging:MinimumLevel` for the floor (bound to `LoggingOptions` per Host-011) and the `Serilog` section for sinks (Host-014's `ReadFrom.Configuration`). The Host-014 regression test (`SerilogSinkConfigTests.ShippedAppSettings_HasSerilogSection_WithConsoleAndFileSinks`) still asserts the surviving `Serilog` section's shape, so removing the Microsoft block did not break the existing pinning. +**Resolution (2026-05-28):** Confirmed by repository-wide grep that no code reads `Logging:LogLevel` (the Host calls `builder.Host.UseSerilog()` which replaces the default `ILoggerFactory` setup with Serilog as the only provider), so the block was pure dead config. Removed the `Logging:LogLevel:Default = Information` block from `appsettings.json` and replaced it with a `_logging` doc-key comment explaining the rationale (Serilog is the sole provider) and pointing operators at the two authoritative keys: `ScadaBridge:Logging:MinimumLevel` for the floor (bound to `LoggingOptions` per Host-011) and the `Serilog` section for sinks (Host-014's `ReadFrom.Configuration`). The Host-014 regression test (`SerilogSinkConfigTests.ShippedAppSettings_HasSerilogSection_WithConsoleAndFileSinks`) still asserts the surviving `Serilog` section's shape, so removing the Microsoft block did not break the existing pinning. ### Host-022 — `ParseLevel` silently coerces unrecognised `MinimumLevel` to `Information` @@ -1087,7 +1087,7 @@ authoritative location (`Serilog` + `ScadaLink:Logging`) in | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Host/LoggerConfigurationFactory.cs:50-55` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/LoggerConfigurationFactory.cs:50-55` | **Resolution (2026-05-28):** `ParseLevel` now writes a one-shot warning to `Console.Error` (the logger isn't built yet at this point) when a non-null/non-blank `MinimumLevel` value fails to parse, naming the offending value and the `Information` fallback. Null/blank values continue to default silently (treated as "unset"). The helper gained a test-visible `TextWriter` overload so unit tests can capture the warning; the production path delegates to it with `Console.Error`. Tests `ParseLevel_UnrecognisedValue_FallsBackAndWarns`, `ParseLevel_NullOrBlank_FallsBackSilently`, and `ParseLevel_RecognisedValue_NoWarning` pin the behaviour. @@ -1097,7 +1097,7 @@ authoritative location (`Serilog` + `ScadaLink:Logging`) in `Enum.TryParse(level, ignoreCase: true, out var parsed)` and returns `LogEventLevel.Information` when parsing fails — without logging the fallback. An operator who sets -`ScadaLink:Logging:MinimumLevel = "Informaiton"` (a common typo) or +`ScadaBridge:Logging:MinimumLevel = "Informaiton"` (a common typo) or `"Verbose,Debug"` or any unrecognised value gets the default level silently; there is no warning, no log line, no startup error. Combined with Host-020 (this is the only mechanism that pins the floor), a misspelt value is @@ -1111,7 +1111,7 @@ In `LoggerConfigurationFactory.Build`, when `loggingOptions.MinimumLevel` is non-null/non-blank but does not parse to a valid `LogEventLevel`, write a `Console.Error.WriteLine` warning (the logger is not yet built) and proceed with `Information`. Alternatively, validate the value in `StartupValidator` -and fail fast — that matches the pattern used for other ScadaLink +and fail fast — that matches the pattern used for other ScadaBridge configuration keys. Add a `LoggerConfigurationTests` case asserting the behaviour you choose. diff --git a/code-reviews/InboundAPI/findings.md b/code-reviews/InboundAPI/findings.md index 43772a85..291b60a5 100644 --- a/code-reviews/InboundAPI/findings.md +++ b/code-reviews/InboundAPI/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.InboundAPI` | +| Module | `src/ZB.MOM.WW.ScadaBridge.InboundAPI` | | Design doc | `docs/requirements/Component-InboundAPI.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -33,7 +33,7 @@ are High severity and should be addressed before production use. #### Re-review 2026-05-17 (commit `39d737e`) All 13 findings from the initial review remain `Resolved`; the module source under -`src/ScadaLink.InboundAPI` is unchanged since the last InboundAPI fix commit +`src/ZB.MOM.WW.ScadaBridge.InboundAPI` is unchanged since the last InboundAPI fix commit (`8dd7412`), which precedes `39d737e`. This re-review re-walked all 10 checklist categories against the resolved code and surfaced **4 new findings** — none touching the previously-fixed concurrency/trust-model code, but all in areas the first pass @@ -68,16 +68,16 @@ statement that the timeout covers routed calls (InboundAPI-016); and (4) `RouteH All 17 prior findings remain `Resolved`. The module has grown materially since the last pass — a new `AuditWriteMiddleware` (Audit Log #23 M4 Bundle D) now lives under -`src/ScadaLink.InboundAPI/Middleware/`, the `ApiKeyValidator` was rewired to hash the +`src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/`, the `ApiKeyValidator` was rewired to hash the candidate with `IApiKeyHasher` (ConfigurationDatabase-012), and an `IInstanceRouter` seam was introduced. This re-review re-walked all 10 checklist categories against `1eb6e97` and surfaced **8 new findings** concentrated on the new audit middleware and a stranded follow-up from InboundAPI-008: 1. The InboundAPI-008 resolution explicitly deferred registering an `IActiveNodeGate` - implementation in `ScadaLink.Host` as a "follow-up outside this module's scope" — + implementation in `ZB.MOM.WW.ScadaBridge.Host` as a "follow-up outside this module's scope" — that follow-up is still unfulfilled (no production registration anywhere in - `src/ScadaLink.Host/`), so the design-mandated standby-node gating is silently + `src/ZB.MOM.WW.ScadaBridge.Host/`), so the design-mandated standby-node gating is silently disabled in production today (`InboundAPI-022`, High). 2. `AuditWriteMiddleware` is wired in `Program.cs` against `/api/*` rather than the specific `POST /api/{methodName}` route, so GETs against `/api/audit/query` and @@ -133,7 +133,7 @@ configuration database, but the invariant is undocumented.) | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:17`, `:32`, `:40`, `:89`, `:123-128` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:17`, `:32`, `:40`, `:89`, `:123-128` | **Description** @@ -169,7 +169,7 @@ via `GetOrAdd` so concurrent first-callers share one handler. Regression tests | Severity | Medium — re-triaged: already fixed by the InboundAPI-001 fix; verified and closed | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:152-161` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:152-161` | **Description** @@ -209,7 +209,7 @@ handler that `GetOrAdd` keeps. Regression test | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ConfigurationDatabase/Repositories/InboundApiRepository.cs:22-23`, consumed by `src/ScadaLink.InboundAPI/ApiKeyValidator.cs:33` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/InboundApiRepository.cs:22-23`, consumed by `src/ZB.MOM.WW.ScadaBridge.InboundAPI/ApiKeyValidator.cs:33` | **Description** @@ -251,7 +251,7 @@ longer depends on it. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:117-141` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:117-141` | **Description** @@ -293,7 +293,7 @@ added. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:56-93` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:56-93` | **Description** @@ -337,7 +337,7 @@ Regression tests `CompileAndRegister_ForbiddenApi_RejectsScript` (theory), | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/EndpointExtensions.cs:54-62` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/EndpointExtensions.cs:54-62` | **Description** @@ -365,7 +365,7 @@ It rejects requests whose declared `Content-Length` exceeds `InboundApiOptions. MaxRequestBodyBytes` (default 1 MiB) with HTTP 413 *before* the handler buffers the body into a `JsonDocument`, and also lowers the per-request `IHttpMaxRequestBodySizeFeature` cap so a chunked/unknown-length stream is cut off by Kestrel while being read. The -limit is configurable via the bound `ScadaLink:InboundApi` options section. Regression +limit is configurable via the bound `ScadaBridge:InboundApi` options section. Regression tests `OversizedBody_ShortCircuitsWith413_AndDoesNotRunHandler`, `BodyAtLimit_RunsHandler`, and `FilterCapsMaxRequestBodySizeFeature` added. @@ -376,7 +376,7 @@ and `FilterCapsMaxRequestBodySizeFeature` added. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:188-203` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:188-203` | **Description** @@ -402,7 +402,7 @@ Resolved 2026-05-16 (commit ``). The drift was confirmed real: so a method script following the documented `Database.Connection("name")` API would fail to compile. Resolution direction: the design doc is stale, not the code. Implementing `Database.Connection()` would hand inbound API scripts a -*raw* MS SQL client, in direct tension with the ScadaLink script trust model +*raw* MS SQL client, in direct tension with the ScadaBridge script trust model (scripts are forbidden `System.IO`, raw network, etc.; `ForbiddenApiChecker` statically enforces this). Rather than carve a hole in the trust model, the "Database Access" section was removed from `docs/requirements/Component-InboundAPI.md` @@ -418,7 +418,7 @@ explicit design change. Code and doc now agree; no code or test change required. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/EndpointExtensions.cs:19-23`, `src/ScadaLink.Host/Program.cs:149` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/EndpointExtensions.cs:19-23`, `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:149` | **Description** @@ -447,7 +447,7 @@ auth/script work, so Traefik/clients only reach the live node — consistent wit registered (non-clustered host / tests) the endpoint defaults to "allow", preserving prior behaviour. Regression tests `StandbyNode_ShortCircuitsWith503_AndDoesNotRunHandler`, `ActiveNode_PassesGate_RunsHandler`, and `NoGateRegistered_PassesGate_RunsHandler` -added. **Follow-up (outside this module's scope):** `ScadaLink.Host` should register +added. **Follow-up (outside this module's scope):** `ZB.MOM.WW.ScadaBridge.Host` should register an `IActiveNodeGate` implementation backed by `ActiveNodeHealthCheck` / `Cluster.State.Leader` in the central-role branch of `Program.cs` so the gate is actually enforced in production; until then the endpoint defaults to "allow". @@ -459,7 +459,7 @@ actually enforced in production; until then the endpoint defaults to "allow". | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:123-128` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:123-128` | **Description** @@ -496,7 +496,7 @@ re-evaluated. Regression tests `FailedCompilation_IsNotRetriedOnEveryRequest` | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/ParameterValidator.cs:64-90`, `:112-118` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/ParameterValidator.cs:64-90`, `:112-118` | **Description** @@ -541,7 +541,7 @@ follow-up. Regression tests `UnexpectedBodyField_ReturnsInvalid` and | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/ApiKeyValidator.cs:39-52` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/ApiKeyValidator.cs:39-52` | **Description** @@ -580,14 +580,14 @@ indistinguishable contract. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/ParameterValidator.cs:128-133` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/ParameterValidator.cs:128-133` | **Description** `ParameterDefinition` is a persistence-/contract-shaped POCO: it is the deserialized form of `ApiMethod.ParameterDefinitions` (a column in the configuration database) and describes the public API contract. CLAUDE.md's code-organization rules place -persistence-ignorant entity/contract types in `ScadaLink.Commons`. Defining it inside +persistence-ignorant entity/contract types in `ZB.MOM.WW.ScadaBridge.Commons`. Defining it inside the InboundAPI project means any other component that needs to read or produce method parameter definitions (e.g. Central UI's method editor, CLI, Management Service) cannot share the type and will duplicate it. @@ -595,7 +595,7 @@ cannot share the type and will duplicate it. **Recommendation** Move `ParameterDefinition` (and a matching return-definition type, if added) to -`ScadaLink.Commons` under the InboundApi entity/types namespace so it is shared by all +`ZB.MOM.WW.ScadaBridge.Commons` under the InboundApi entity/types namespace so it is shared by all components that work with method definitions. **Resolution** @@ -604,22 +604,22 @@ Resolved 2026-05-16 (commit ``): root cause confirmed against the sourc `ParameterDefinition` was a persistence-ignorant, API-contract-shaped POCO (the deserialized form of the `ApiMethod.ParameterDefinitions` configuration-database column) declared inside the component project, contrary to CLAUDE.md's -code-organization rule that such shared contract types live in `ScadaLink.Commons`. -The type was moved to `src/ScadaLink.Commons/Types/InboundApi/ParameterDefinition.cs` -(namespace `ScadaLink.Commons.Types.InboundApi`) — placed under `Types/` with an +code-organization rule that such shared contract types live in `ZB.MOM.WW.ScadaBridge.Commons`. +The type was moved to `src/ZB.MOM.WW.ScadaBridge.Commons/Types/InboundApi/ParameterDefinition.cs` +(namespace `ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi`) — placed under `Types/` with an `InboundApi` domain subfolder, matching the existing `Types/Scripts/` precedent, since the column itself is the persisted form and this type is its deserialized contract shape (not an EF-mapped entity). It remains a pure POCO with no EF attributes and no behaviour. `ParameterValidator` now imports the moved type via a `using -ScadaLink.Commons.Types.InboundApi;` directive; a tree-wide search confirmed +ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi;` directive; a tree-wide search confirmed `ParameterValidator.cs` was the type's only declaration and only direct consumer (all other `ParameterDefinition*` matches are the unrelated `ParameterDefinitions` string property). No return-definition type exists in the codebase — only a `ReturnDefinition` string column — so none was invented. No behavioural change, so no new runtime regression test: this is a compile-level type move, and the existing 52 -`ScadaLink.InboundAPI.Tests` (including the `ParameterValidator` suite) act as the -regression guard. `dotnet test` for `ScadaLink.InboundAPI.Tests` (52 passed) and -`ScadaLink.Commons.Tests` (226 passed) are green; `dotnet build ScadaLink.slnx` +`ZB.MOM.WW.ScadaBridge.InboundAPI.Tests` (including the `ParameterValidator` suite) act as the +regression guard. `dotnet test` for `ZB.MOM.WW.ScadaBridge.InboundAPI.Tests` (52 passed) and +`ZB.MOM.WW.ScadaBridge.Commons.Tests` (226 passed) are green; `dotnet build ZB.MOM.WW.ScadaBridge.slnx` succeeds with 0 warnings / 0 errors. ### InboundAPI-013 — `ApiKeyValidationResult.NotFound` factory returns HTTP 400, contradicting its name @@ -629,7 +629,7 @@ succeeds with 0 warnings / 0 errors. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/ApiKeyValidator.cs:78-79` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/ApiKeyValidator.cs:78-79` | **Description** @@ -667,7 +667,7 @@ from "key not approved"), but that doc edit is outside this module's editable sc | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:201-205`, `src/ScadaLink.Commons/Entities/InboundApi/ApiMethod.cs:10` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:201-205`, `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/InboundApi/ApiMethod.cs:10` | **Description** @@ -725,7 +725,7 @@ is validation-only (no coercion). Regression tests: `ReturnValueValidatorTests` | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/ForbiddenApiChecker.cs:63-119`, `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:109-126` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/ForbiddenApiChecker.cs:63-119`, `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:109-126` | **Description** @@ -799,7 +799,7 @@ namespace-deny-list regression guards. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/RouteHelper.cs:59-152`, `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:177`, `:199` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/RouteHelper.cs:59-152`, `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:177`, `:199` | **Description** @@ -863,13 +863,13 @@ of running orphaned. Regression tests (in the new `RouteHelperTests`): | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/RouteHelper.cs:1-165`, `tests/ScadaLink.InboundAPI.Tests/` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/RouteHelper.cs:1-165`, `tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/` | **Description** `RouteHelper`/`RouteTarget` is the entire WP-4 cross-site routing surface — the `Route.To().Call()/GetAttribute(s)/SetAttribute(s)` API that inbound API scripts use -to reach instances at any site. It has zero tests: the `ScadaLink.InboundAPI.Tests` +to reach instances at any site. It has zero tests: the `ZB.MOM.WW.ScadaBridge.InboundAPI.Tests` project covers `ApiKeyValidator`, `ParameterValidator`, `InboundScriptExecutor`, and `InboundApiEndpointFilter`, but no test file exercises `RouteHelper`. Untested behaviours include site resolution via `IInstanceLocator` (including the @@ -892,7 +892,7 @@ wiring is added. **Resolution** -Resolved 2026-05-17 (commit ``): confirmed — `ScadaLink.InboundAPI.Tests` had +Resolved 2026-05-17 (commit ``): confirmed — `ZB.MOM.WW.ScadaBridge.InboundAPI.Tests` had no file exercising `RouteHelper`/`RouteTarget`. To make the surface testable without a live actor system, an `IInstanceRouter` seam was introduced in the module (the routing transport `RouteHelper` depends on); the production `CommunicationServiceInstanceRouter` @@ -912,7 +912,7 @@ the InboundAPI-016 deadline-token inheritance behaviour. All 15 pass. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddleware.cs:257` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddleware.cs:257` | **Resolution (2026-05-28):** kept the fire-and-forget (audit emission must never block or alter the user-facing response per alog.md §13) but added @@ -968,7 +968,7 @@ synchronous throw) to pin the new contract. |--|--| | Severity | Low | | Category | Performance & resource management | -| Location | `src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddleware.cs:141` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddleware.cs:141` | | Status | Resolved | **Resolution (2026-05-28):** Added a `RequestHasBody(HttpRequest)` guard that returns `true` only when `ContentLength > 0` or the method is POST / PUT / PATCH (the `HttpMethods.IsPost/Put/Patch` helpers); the `EnableBuffering` + `ReadBufferedRequestBodyAsync` call now sits behind that guard. Bodyless GET / HEAD / DELETE / TRACE / OPTIONS requests (and any explicit `Content-Length: 0`) skip the `FileBufferingReadStream` allocation; body-carrying methods with no Content-Length (chunked POST etc.) still buffer. Regression tests `BodylessMethod_SkipsEnableBuffering_RequestStreamIsNotReplaced` (GET/HEAD/DELETE theory), `BodylessPost_ContentLengthZero_SkipsEnableBuffering`, and `PostWithBody_StillEnablesBuffering_AndCapturesRequestSummary` (anti-regression). @@ -1000,7 +1000,7 @@ bodyless request through the middleware. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/EndpointExtensions.cs:70` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/EndpointExtensions.cs:70` | **Resolution (2026-05-28):** swapped the case-sensitive `Contains("json")` substring match for `Contains("json", StringComparison.OrdinalIgnoreCase)` so @@ -1041,7 +1041,7 @@ regression test posting with `application/JSON` and Transfer-Encoding: chunked. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/RouteHelper.cs:141-143`, `:182-183`, `:225-226`; `src/ScadaLink.Commons/Messages/InboundApi/RouteToInstanceRequest.cs:15-21`, `:36-40`, `:55-59` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/RouteHelper.cs:141-143`, `:182-183`, `:225-226`; `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/InboundApi/RouteToInstanceRequest.cs:15-21`, `:36-40`, `:55-59` | **Description** @@ -1104,9 +1104,9 @@ backlog), they can stamp the parent id without any further plumbing. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/IActiveNodeGate.cs`, `src/ScadaLink.InboundAPI/InboundApiEndpointFilter.cs:52-60`; absent from `src/ScadaLink.Host/Program.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/IActiveNodeGate.cs`, `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundApiEndpointFilter.cs:52-60`; absent from `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs` | -**Resolution** — Added `src/ScadaLink.Host/Health/ActiveNodeGate.cs`, a production `IActiveNodeGate` implementation backed by `AkkaHostedService` that mirrors `ActiveNodeHealthCheck`'s leadership probe (member status `Up` AND `Cluster.State.Leader == SelfAddress`), and registered it as a singleton in the central-role branch of `Program.cs`. A structural regression test (`CentralCompositionRootTests.Central_IActiveNodeGate_IsRegisteredAsActiveNodeGate`) reflects over the built `IServiceProvider` to assert the registration's existence and concrete type — failing on `main` and passing after the fix. The `InboundApiEndpointFilter`'s fall-through-to-allow behaviour is retained as the documented safe default for non-clustered hosts and tests. +**Resolution** — Added `src/ZB.MOM.WW.ScadaBridge.Host/Health/ActiveNodeGate.cs`, a production `IActiveNodeGate` implementation backed by `AkkaHostedService` that mirrors `ActiveNodeHealthCheck`'s leadership probe (member status `Up` AND `Cluster.State.Leader == SelfAddress`), and registered it as a singleton in the central-role branch of `Program.cs`. A structural regression test (`CentralCompositionRootTests.Central_IActiveNodeGate_IsRegisteredAsActiveNodeGate`) reflects over the built `IServiceProvider` to assert the registration's existence and concrete type — failing on `main` and passing after the fix. The `InboundApiEndpointFilter`'s fall-through-to-allow behaviour is retained as the documented safe default for non-clustered hosts and tests. **Description** @@ -1118,14 +1118,14 @@ when `gate is { IsActiveNode: false }` returns HTTP 503. The filter's behaviour when **no implementation is registered** (line 51 comment) is to fall through and serve the request — the resolution paragraph for InboundAPI-008 closes with: -> "Follow-up (outside this module's scope): `ScadaLink.Host` should register an +> "Follow-up (outside this module's scope): `ZB.MOM.WW.ScadaBridge.Host` should register an > `IActiveNodeGate` implementation backed by `ActiveNodeHealthCheck` / > `Cluster.State.Leader` in the central-role branch of `Program.cs` so the gate is > actually enforced in production; until then the endpoint defaults to "allow"." -A grep of the entire `src/ScadaLink.Host/` tree at `1eb6e97` finds **zero** +A grep of the entire `src/ZB.MOM.WW.ScadaBridge.Host/` tree at `1eb6e97` finds **zero** `IActiveNodeGate` registrations: `grep -rn "IActiveNodeGate\|AddSingleton.*ActiveNode" -src/ScadaLink.Host/` returns no matches. The follow-up was never carried out. So +src/ZB.MOM.WW.ScadaBridge.Host/` returns no matches. The follow-up was never carried out. So in production today the standby central node still serves the inbound API exactly as InboundAPI-008 described — executes method scripts, runs `Route.To()` calls, races the active node, and may operate against stale singleton state. The new @@ -1138,7 +1138,7 @@ The design says the inbound API is "Central cluster only (active node)" and **Recommendation** Register an `IActiveNodeGate` implementation in the central-role branch of -`ScadaLink.Host/Program.cs`. The natural backing is the existing +`ZB.MOM.WW.ScadaBridge.Host/Program.cs`. The natural backing is the existing `ActiveNodeHealthCheck` (already wired for `/health/active`) or a direct read of `Cluster.Get(actorSystem).State.Leader == Cluster.Get(actorSystem).SelfAddress`. Add an integration test in the Host that spins up the central role and asserts @@ -1153,9 +1153,9 @@ realisation of the InboundAPI-008 vulnerability. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/EndpointExtensions.cs:31-140`, `tests/ScadaLink.InboundAPI.Tests/` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/EndpointExtensions.cs:31-140`, `tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/` | -**Resolution (2026-05-28):** Added `tests/ScadaLink.InboundAPI.Tests/EndpointExtensionsTests.cs`, a `TestServer`-hosted suite (same pattern as `EndpointContentTypeTests`) that drives the `POST /api/{methodName}` wiring end-to-end. Seven cases pin the composed flow: happy path (200 + script result body), missing API key (401), unknown method (403, indistinguishable from "not approved" per InboundAPI-011), invalid JSON body (400), missing required parameter (400 from `ParameterValidator`), script throws (500 with sanitized error body — the executor's catch-all replaces the raw exception with `"Internal script error"`), and the `HttpContext.Items[AuditWriteMiddleware.AuditActorItemKey]` actor-stash invariant (verified by an inline capture middleware reading the slot after the endpoint runs). All 7 new tests pass; total InboundAPI.Tests now 158 (was 151). +**Resolution (2026-05-28):** Added `tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointExtensionsTests.cs`, a `TestServer`-hosted suite (same pattern as `EndpointContentTypeTests`) that drives the `POST /api/{methodName}` wiring end-to-end. Seven cases pin the composed flow: happy path (200 + script result body), missing API key (401), unknown method (403, indistinguishable from "not approved" per InboundAPI-011), invalid JSON body (400), missing required parameter (400 from `ParameterValidator`), script throws (500 with sanitized error body — the executor's catch-all replaces the raw exception with `"Internal script error"`), and the `HttpContext.Items[AuditWriteMiddleware.AuditActorItemKey]` actor-stash invariant (verified by an inline capture middleware reading the slot after the endpoint runs). All 7 new tests pass; total InboundAPI.Tests now 158 (was 151). **Description** @@ -1190,7 +1190,7 @@ resolved key name after successful auth, but is absent on auth failures). | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.InboundAPI/InboundScriptExecutor.cs:30`, `:77`, `:223`, `:233` | +| Location | `src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs:30`, `:77`, `:223`, `:233` | **Resolution (2026-05-28):** capped the cache at `KnownBadMethodsCap = 1000` entries via a new `TryRecordBadMethod` helper that short-circuits when the cap @@ -1236,7 +1236,7 @@ immediate change required; this is a watch-list item. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Host/Program.cs:183-185`; consumers: `src/ScadaLink.ManagementService/AuditEndpoints.cs:93-94`; emitter: `src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddleware.cs:175-252` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:183-185`; consumers: `src/ZB.MOM.WW.ScadaBridge.ManagementService/AuditEndpoints.cs:93-94`; emitter: `src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddleware.cs:175-252` | **Resolution (2026-05-28):** Took the defensive path-exclusion in `Program.cs` (Option 1 from the recommendation). The `UseWhen` predicate @@ -1255,7 +1255,7 @@ the excluded prefixes, which would be noisy in code review. `Program.cs` wires the audit middleware as `app.UseWhen(ctx => ctx.Request.Path.StartsWithSegments("/api"), branch => branch.UseAuditWriteMiddleware())` — scoped to the `/api` *prefix*, not to the `POST /api/{methodName}` route. -Meanwhile, `ScadaLink.ManagementService/AuditEndpoints.cs` maps +Meanwhile, `ZB.MOM.WW.ScadaBridge.ManagementService/AuditEndpoints.cs` maps `MapGet("/api/audit/query", ...)` (line 93) and `MapGet("/api/audit/export", ...)` (line 94). Both routes therefore inherit `AuditWriteMiddleware`, which emits an `AuditEvent { Channel = AuditChannel.ApiInbound, Kind = AuditKind.InboundRequest, ... }` diff --git a/code-reviews/ManagementService/findings.md b/code-reviews/ManagementService/findings.md index f183811a..cc850f87 100644 --- a/code-reviews/ManagementService/findings.md +++ b/code-reviews/ManagementService/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.ManagementService` | +| Module | `src/ZB.MOM.WW.ScadaBridge.ManagementService` | | Design doc | `docs/requirements/Component-ManagementService.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -31,7 +31,7 @@ authorization bypass with no workaround. #### Re-review 2026-05-17 (commit `39d737e`) All thirteen prior findings remain correctly closed; the source under -`src/ScadaLink.ManagementService` is byte-identical between the previously reviewed state +`src/ZB.MOM.WW.ScadaBridge.ManagementService` is byte-identical between the previously reviewed state and `39d737e` (the resolution commits of findings 001–013 are folded into the history at or before `39d737e`). ManagementService-012 was re-checked and its **Deferred** status still holds: `ManagementEnvelope.Command` is still typed `object`, and the marker-interface fix @@ -111,7 +111,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:1465`, `:1481`, `:1493`, `:641`, `:649` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:1465`, `:1481`, `:1493`, `:641`, `:649` | **Description** @@ -153,7 +153,7 @@ Resolved 2026-05-16 (commit ``). Threaded `AuthenticatedUser` into | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:510`, `:673`, `:733`, `:774`, `:631`, `:624` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:510`, `:673`, `:733`, `:774`, `:631`, `:624` | **Description** @@ -192,7 +192,7 @@ the resolved entity's site ID (instance `SiteId`, site `Id`, data-connection `Si | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/DebugStreamHub.cs:104` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/DebugStreamHub.cs:104` | **Description** @@ -231,7 +231,7 @@ tests: `IsInstanceAccessAllowed_SiteScopedUser_OutOfScopeInstance_Denied`, | Severity | Medium | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:61` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:61` | **Description** @@ -271,7 +271,7 @@ mapping tests confirm behaviour is preserved. | Severity | Low | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:33` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:33` | **Description** @@ -306,7 +306,7 @@ children today, so this is a forward-looking correctness fix. Regression tests: | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementEndpoints.cs:83`, `:112` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementEndpoints.cs:83`, `:112` | **Description** @@ -342,7 +342,7 @@ string rather than parsing a throwaway document. Regression tests: | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:67`; `src/ScadaLink.ManagementService/ManagementEndpoints.cs:113` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:67`; `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementEndpoints.cs:113` | **Description** @@ -380,7 +380,7 @@ Regression tests: `SerializeResult_WithCyclicGraph_DoesNotThrow`, | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:285` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:285` | **Description** @@ -403,7 +403,7 @@ Resolved 2026-05-16 (commit pending). Confirmed: `HandleResolveRoles` did (the two-step ResolveRoles flow is retired). Resolving 011 by deleting the `ResolveRolesCommand` dispatch case and `HandleResolveRoles` handler also removes the only manually-constructed `RoleMapper` in the module, so the DI-bypass no longer exists. No -remaining `new RoleMapper` in `src/ScadaLink.ManagementService`. Regression covered by +remaining `new RoleMapper` in `src/ZB.MOM.WW.ScadaBridge.ManagementService`. Regression covered by `ResolveRolesCommand_IsNoLongerDispatched_ReturnsManagementError`. ### ManagementService-009 — Audit logging applied inconsistently across mutating handlers @@ -413,7 +413,7 @@ remaining `new RoleMapper` in `src/ScadaLink.ManagementService`. Regression cove | Severity | Low — re-triaged from Medium; the claimed audit gap does not exist (see Description), leaving only an undocumented-convention issue. | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:357`, `:1134`, `:1085`, `:526`, `:1275` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:357`, `:1134`, `:1085`, `:526`, `:1275` | **Description** @@ -461,7 +461,7 @@ covers the explicit-audit path. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementServiceOptions.cs:5`; `src/ScadaLink.ManagementService/ManagementEndpoints.cs:16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementServiceOptions.cs:5`; `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementEndpoints.cs:16` | **Description** @@ -497,7 +497,7 @@ Regression tests: `ResolveAskTimeout_UsesConfiguredCommandTimeout`, | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:273`, `:283` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:273`, `:283` | **Description** @@ -526,7 +526,7 @@ falls through to the `NotSupportedException` default and gets a uniform `Managem (closing the unauthenticated role-mapping enumeration surface, since `GetRequiredRole` returned null for it). A code comment at the former dispatch site documents the intentional omission. Note: the `ResolveRolesCommand` *record* itself lives in -`src/ScadaLink.Commons/Messages/Management/SecurityCommands.cs` and was left in place — that +`src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/SecurityCommands.cs` and was left in place — that file is outside this module's permitted edit scope; deleting the orphan record should be done as a Commons-module follow-up. With the handler removed it is now an inert, registry-only type with no behaviour. Regression test: @@ -539,7 +539,7 @@ registry-only type with no behaviour. Regression test: | Severity | Low | | Category | Akka.NET conventions | | Status | Deferred | -| Location | `src/ScadaLink.Commons/Messages/Management/ManagementEnvelope.cs:7`; `src/ScadaLink.ManagementService/ManagementActor.cs:132` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/ManagementEnvelope.cs:7`; `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:132` | **Description** @@ -561,8 +561,8 @@ flag unhandled cases, and keeps `ManagementCommandRegistry`'s reflection scan pr Deferred 2026-05-16. Finding verified as genuine: `ManagementEnvelope.Command` is typed `object` and the recommended `IManagementCommand` marker-interface fix is sound. However, the fix cannot be implemented within the `ManagementService` module: both `ManagementEnvelope` and -all ~50 `*Command` records live in `src/ScadaLink.Commons/Messages/Management/` (17 files), -which is outside this work item's permitted edit scope (`src/ScadaLink.ManagementService/**`, +all ~50 `*Command` records live in `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/` (17 files), +which is outside this work item's permitted edit scope (`src/ZB.MOM.WW.ScadaBridge.ManagementService/**`, its tests, and this findings file only). Adding the marker interface, retyping the envelope, and having `ManagementCommandRegistry` constrain its reflection scan to `IManagementCommand` implementers is a cohesive Commons-module change and must be done there — also so the Commons @@ -576,7 +576,7 @@ work item; no `ManagementService`-local change is appropriate. | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.ManagementService.Tests/ManagementActorTests.cs:1` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorTests.cs:1` | **Description** @@ -618,7 +618,7 @@ pre-existing site-scope and DebugStreamHub suites. `dotnet test` -> 48 passed. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:306`, `:1174` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:306`, `:1174` | **Description** @@ -672,7 +672,7 @@ Regression tests: `QueryDeployments_WithDesignRole_ReturnsUnauthorized`, | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:647`–`:659` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:647`–`:659` | **Description** @@ -716,7 +716,7 @@ this residual is documented in a code comment on the handler. Regression tests: | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:121`–`:131` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:121`–`:131` | **Description** @@ -761,7 +761,7 @@ leaked. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.ManagementService.Tests/ManagementActorTests.cs:1` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorTests.cs:1` | **Description** @@ -797,7 +797,7 @@ Deployment user and an Admin user, in- and out-of-scope | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:153`–`:207`, `:336`, `:1302` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:153`–`:207`, `:336`, `:1302` | **Description** @@ -858,7 +858,7 @@ pre-fix code (the command fell through to "any authenticated user") and pass aft | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/AuditEndpoints.cs:358`–`:368`, `:397`–`:437` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/AuditEndpoints.cs:358`–`:368`, `:397`–`:437` | **Description** @@ -928,7 +928,7 @@ mixed-set intersected. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:1136`–`:1153` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:1136`–`:1153` | **Resolution (2026-05-28):** Added `SmtpConfigPublicShape` projection that returns every non-secret field plus a `HasCredentials` bool — never the @@ -989,7 +989,7 @@ Add regression tests: `UpdateSmtpConfig_DoesNotEchoCredentialsInResponse` and | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.ManagementService.Tests/ManagementActorTests.cs:1`; `src/ScadaLink.ManagementService/ManagementActor.cs:1717`–`:1897` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorTests.cs:1`; `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:1717`–`:1897` | **Resolution (2026-05-28):** Added six `ManagementActorTests` cases covering the load-bearing bundle behaviours. Role gating: `ExportBundleCommand_WithAdminRole_ReturnsUnauthorized` (Export needs Design), `PreviewBundleCommand_WithDesignRole_ReturnsUnauthorized`, and `ImportBundleCommand_WithDesignRole_ReturnsUnauthorized` (Preview/Import need Admin). Name resolution: `ExportBundleCommand_WithUnknownTemplateName_ReturnsManagementError` proves the `ResolveIds` `ManagementCommandException` surfaces verbatim with the missing entity type + name. Handler logic: `ImportBundleCommand_WithBlockerRow_AbortsBeforeApply` seeds a `ConflictKind.Blocker` preview and asserts `IBundleImporter.ApplyAsync` is never called and the error names the blocker; `ImportBundleCommand_DuplicatePreviewItems_DedupePerEntityTypeAndName` seeds three rows for the same `(Template, "Dup")` key (Identical, Modified, Identical) and asserts only one resolution reaches `ApplyAsync` with last-write-wins (`Skip`, overriding the prior `Modified`/`Overwrite`). All bundle tests use substituted `IBundleExporter`/`IBundleImporter` via a new `AddBundleSubstitutes()` helper plus stub `GetAll*Async` repository returns. 106/106 ManagementService.Tests pass. @@ -1095,7 +1095,7 @@ Update `Component-ManagementService.md`: | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.ManagementService/ManagementActor.cs:1276`–`:1295` | +| Location | `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs:1276`–`:1295` | **Resolution (2026-05-28):** Swapped the per-`InstanceId` `GetInstanceByIdAsync` lookup loop for a single `templateRepo.GetAllInstancesAsync()` bulk fetch, projected into a `Dictionary` keyed by `Instance.Id`. The unfiltered branch now hits the configuration database exactly twice (deployment records + instances) regardless of fleet size. Existing test `QueryDeployments_UnfilteredForSiteScopedUser_DropsOutOfScopeRecords` was updated to mock the bulk path and to assert `GetInstanceByIdAsync` is no longer used on the unfiltered branch; new regression test `QueryDeployments_UnfilteredForSiteScopedUser_UsesBulkInstanceLoad_NotPerRecordLookup` pins `GetAllInstancesAsync` is invoked exactly once even with duplicate-instance records. diff --git a/code-reviews/NotificationOutbox/findings.md b/code-reviews/NotificationOutbox/findings.md index 6b05d530..0448914a 100644 --- a/code-reviews/NotificationOutbox/findings.md +++ b/code-reviews/NotificationOutbox/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.NotificationOutbox` | +| Module | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox` | | Design doc | `docs/requirements/Component-NotificationOutbox.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -28,7 +28,7 @@ ConfigurationDatabase**. The outbox inherits two known defects from its sibling that are reachable through `EmailNotificationDeliveryAdapter`: the OAuth2 SASL empty-user bug (NS-021) ships every M365 send with `user=""`, and the `InsertIfNotExistsAsync` check-then-act race (CD-015) lives on the outbox's ack-after-persist -hot path. Neither is a defect of code under `src/ScadaLink.NotificationOutbox/`, but both +hot path. Neither is a defect of code under `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/`, but both are surfaced here because production dispatch and ingest go through these exact lines. A secondary theme is **dispatcher-fire-and-forget audit writes** (`_ = _auditWriter.WriteAsync(...)`) that can race the per-sweep scope dispose under the wrong DI graph, and a few smaller @@ -63,7 +63,7 @@ from `Component-NotificationOutbox.md`. No Critical findings; two High, six Medi | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs:185-191` (calls `smtp.AuthenticateAsync("oauth2", token)`); root cause in `src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs:76-79` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs:185-191` (calls `smtp.AuthenticateAsync("oauth2", token)`); root cause in `src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs:76-79` | **Description** @@ -106,7 +106,7 @@ _Unresolved._ | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs:348-360` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs:348-360` | **Description** @@ -146,7 +146,7 @@ _Unresolved._ | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs:334`, `src/ScadaLink.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs:22` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs:334`, `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs:22` | **Description** @@ -186,14 +186,14 @@ _Unresolved._ | Severity | Medium | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs:425-435`, `463-485` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs:425-435`, `463-485` | **Description** Both emission helpers issue `_ = _auditWriter.WriteAsync(evt);` — discarding the returned task. `CentralAuditWriter.WriteAsync` opens its own `await using var scope = _services.CreateAsyncScope();` and resolves a scoped `IAuditLogRepository` (verified -at `src/ScadaLink.AuditLog/Central/CentralAuditWriter.cs:118-121`), so the writer is +at `src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/CentralAuditWriter.cs:118-121`), so the writer is defensively scope-independent. However the dispatcher already holds a per-sweep `using var scope = _serviceProvider.CreateScope();` and the per-notification `UpdateAsync` runs in that scope. The fire-and-forget pattern means: @@ -238,15 +238,15 @@ _Unresolved._ | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs:127-132` (caller); root cause in `src/ScadaLink.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs:33-45` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs:127-132` (caller); root cause in `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs:33-45` | -**Resolution (2026-05-28):** Closed by CD-015 — `NotificationOutboxRepository.InsertIfNotExistsAsync` (commit `ac96b83`) is now a single-statement `IF NOT EXISTS ... INSERT` via `ExecuteSqlInterpolatedAsync` with a `SqlException` filter swallowing duplicate-key violations (`2601`/`2627`) as a no-op (`return false`). The check-then-act window is eliminated; the at-least-once handoff contract holds and the actor's `PipeTo` success/failure projection no longer surfaces a permanent PK-violation back to the site. Verified in `src/ScadaLink.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs:51-103`. +**Resolution (2026-05-28):** Closed by CD-015 — `NotificationOutboxRepository.InsertIfNotExistsAsync` (commit `ac96b83`) is now a single-statement `IF NOT EXISTS ... INSERT` via `ExecuteSqlInterpolatedAsync` with a `SqlException` filter swallowing duplicate-key violations (`2601`/`2627`) as a no-op (`return false`). The check-then-act window is eliminated; the at-least-once handoff contract holds and the actor's `PipeTo` success/failure projection no longer surfaces a permanent PK-violation back to the site. Verified in `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs:51-103`. **Description** `HandleSubmit` → `PersistAsync` calls `repository.InsertIfNotExistsAsync(notification)` on `INotificationOutboxRepository`. The current implementation -(`src/ScadaLink.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs`) +(`src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/NotificationOutboxRepository.cs`) does a check-then-act with no duplicate-key catch — documented as CD-015 (High, Open). The Notification Outbox's documented contract is "at-least-once handoff with ack-after-persist plus insert-if-not-exists on `NotificationId`" (CLAUDE.md, @@ -280,7 +280,7 @@ remains the CD-015 raw-SQL `IF NOT EXISTS … INSERT` with `2601/2627` catch in | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs:267-277` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs:267-277` | **Description** @@ -319,7 +319,7 @@ stateful intent (timeouts, circuit breakers) cannot accidentally lose state. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxOptions.cs:13`, `:22`, `:25`; `docs/requirements/Component-NotificationOutbox.md:152-160` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxOptions.cs:13`, `:22`, `:25`; `docs/requirements/Component-NotificationOutbox.md:152-160` | **Description** @@ -363,7 +363,7 @@ remains tracked separately. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs:29-31`, `:251-259`; tests in `tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs:29-31`, `:251-259`; tests in `tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs` | **Resolution (2026-05-28):** The `FallbackMaxRetries` / `FallbackRetryDelay` constants are documented for forward-compat with a deferred secondary-adapter path — when no SMTP configuration row exists, `EmailNotificationDeliveryAdapter` returns `Permanent("No SMTP configuration available")` before the retry-policy values are ever consulted, so the path is effectively unreachable from any current production caller. The reachable use of the constants — clamping a non-positive `SmtpConfiguration.MaxRetries` / `RetryDelay` (per NO-002) — is already covered by `TransientFailure_WithZeroMaxRetries_RetriesUsingFallback_DoesNotParkImmediately`, `TransientFailure_WithNegativeMaxRetries_RetriesUsingFallback_DoesNotParkImmediately`, and `TransientFailure_WithNonPositiveRetryDelay_UsesFallbackDelay_NotZero` in `NotificationOutboxActorDispatchTests.cs`. Mark untestable today and re-visit when a non-Email adapter (Teams etc.) makes the empty-SMTP-config branch genuinely deliverable. @@ -401,7 +401,7 @@ the choice in the actor XML so a maintainer does not "fix" the unreachable code. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxOptions.cs:15-16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxOptions.cs:15-16` | **Description** @@ -440,7 +440,7 @@ requeue, or escalation. Matches `Component-NotificationOutbox.md §Monitoring`. | Severity | Medium | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs:469-477` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs:469-477` | **Description** diff --git a/code-reviews/NotificationService/findings.md b/code-reviews/NotificationService/findings.md index 495b846c..401b94a8 100644 --- a/code-reviews/NotificationService/findings.md +++ b/code-reviews/NotificationService/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.NotificationService` | +| Module | `src/ZB.MOM.WW.ScadaBridge.NotificationService` | | Design doc | `docs/requirements/Component-NotificationService.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -124,7 +124,7 @@ prefix could be aggressively scrubbed out of unrelated log text (NS-025). | Severity | Critical | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:96`, `src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs:8` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:96`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs:8` | **Description** @@ -153,7 +153,7 @@ path. Fixed by the commit whose message references `NotificationService-001`. | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:157-167` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:157-167` | **Description** @@ -181,7 +181,7 @@ plus `SocketException`/`TimeoutException` are treated as transient. Regression t | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:144-147`, `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:163-166` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:144-147`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:163-166` | **Description** @@ -211,7 +211,7 @@ Regression tests `Send_Smtp5xxCommandException_ClassifiedPermanent`, | Severity | High | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:118-119` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:118-119` | **Description** @@ -243,7 +243,7 @@ the resulting client is disposed. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs:18`, `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:123` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs:18`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:123` | **Description** @@ -273,7 +273,7 @@ parks a buffered message) instead of silently negotiating TLS. Regression tests: | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/OAuth2TokenService.cs:14-15`, `src/ScadaLink.NotificationService/OAuth2TokenService.cs:30-35` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/OAuth2TokenService.cs:14-15`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/OAuth2TokenService.cs:30-35` | **Description** @@ -301,7 +301,7 @@ and `GetTokenAsync_SameCredentials_CachedPerCredential`. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationOptions.cs:11-14`, `src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs:16-20`, `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:111-140` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationOptions.cs:11-14`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs:16-20`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:111-140` | **Description** @@ -332,7 +332,7 @@ remain as operational fallback defaults. Regression tests: | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:136-137`, `src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs:50-53` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:136-137`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs:50-53` | **Description** @@ -362,7 +362,7 @@ the Central UI is a separate component and out of this module's scope. | Severity | Medium — re-triaged: split into an in-scope log-leak fix (resolved) and a Commons-scoped at-rest-encryption / structured-credential follow-up (NotificationService-013, Deferred). | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:127-134`, `src/ScadaLink.NotificationService/OAuth2TokenService.cs:30-65`, `src/ScadaLink.Commons/Entities/Notifications/SmtpConfiguration.cs:9` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:127-134`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/OAuth2TokenService.cs:30-65`, `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Notifications/SmtpConfiguration.cs:9` | **Description** @@ -389,7 +389,7 @@ conflates two concerns with different ownership. 2. **At-rest encryption + structured-credential modelling (out of scope — Deferred).** Encrypting `SmtpConfiguration.Credentials` at rest and replacing the brittle colon-packed `string` with structured fields requires editing - `src/ScadaLink.Commons/Entities/Notifications/SmtpConfiguration.cs` and the + `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Notifications/SmtpConfiguration.cs` and the ConfigurationDatabase EF layer — both outside this module. Tracked separately as **NotificationService-013** (Deferred) so it is not lost. @@ -400,7 +400,7 @@ conflates two concerns with different ownership. | Severity | Medium | | Category | Security | | Status | Deferred | -| Location | `src/ScadaLink.Commons/Entities/Notifications/SmtpConfiguration.cs:9`, ConfigurationDatabase EF mapping | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Notifications/SmtpConfiguration.cs:9`, ConfigurationDatabase EF mapping | **Description** @@ -419,7 +419,7 @@ fields directly. **Resolution** -Deferred — requires changes to `src/ScadaLink.Commons` and the ConfigurationDatabase +Deferred — requires changes to `src/ZB.MOM.WW.ScadaBridge.Commons` and the ConfigurationDatabase component, which are outside the NotificationService module. To be addressed in a Commons/ConfigurationDatabase-scoped change. The associated log-leak risk is resolved under NotificationService-009. @@ -431,7 +431,7 @@ under NotificationService-009. | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:121-154` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:121-154` | **Description** @@ -461,7 +461,7 @@ mask the original delivery exception. Regression tests | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:173-177`, `src/ScadaLink.Commons/Entities/Notifications/SmtpConfiguration.cs:5-15` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:173-177`, `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Notifications/SmtpConfiguration.cs:5-15` | **Description** @@ -477,11 +477,11 @@ Resolved 2026-05-16 (commit pending). Both issues confirmed against source. 1. **`SmtpPermanentException` placement (in scope — fixed).** The public exception type was extracted from the bottom of `NotificationDeliveryService.cs` into its own file, - `src/ScadaLink.NotificationService/SmtpPermanentException.cs`, restoring the + `src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpPermanentException.cs`, restoring the one-type-per-file layout. No behaviour change, so no dedicated regression test — the move is verified by the module test suite still compiling and passing (56 tests green). 2. **`SmtpConfiguration` non-nullable strings (out of scope — re-triaged).** - `SmtpConfiguration` lives in `src/ScadaLink.Commons`, which is outside the + `SmtpConfiguration` lives in `src/ZB.MOM.WW.ScadaBridge.Commons`, which is outside the NotificationService module's edit scope; it cannot be changed here. This is the same Commons entity already flagged for follow-up under **NotificationService-013** (Deferred). The `required`-members / documented-constructor change should be folded into @@ -497,7 +497,7 @@ Resolved 2026-05-16 (commit pending). Both issues confirmed against source. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.NotificationService.Tests/NotificationDeliveryServiceTests.cs`, `tests/ScadaLink.NotificationService.Tests/OAuth2TokenServiceTests.cs` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/NotificationDeliveryServiceTests.cs`, `tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/OAuth2TokenServiceTests.cs` | **Description** @@ -543,7 +543,7 @@ Module test suite is green at 56 tests. | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:214-228`, `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:308-312`, `src/ScadaLink.NotificationService/OAuth2TokenService.cs:56-84` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:214-228`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:308-312`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/OAuth2TokenService.cs:56-84` | **Description** @@ -564,7 +564,7 @@ Resolved 2026-05-17. Root cause confirmed against source — `DeliverBufferedAsy | Severity | High | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:96-148`, `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:308-312` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:96-148`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:308-312` | **Description** @@ -585,7 +585,7 @@ Resolved 2026-05-17. Root cause confirmed — `SendAsync` had only three catch c | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs:46-67` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs:46-67` | **Description** @@ -606,11 +606,11 @@ Resolved 2026-05-17. Root cause confirmed — `AuthenticateAsync` returned silen | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationOptions.cs:1-15`, `src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs:10-11`, `src/ScadaLink.Host/SiteServiceRegistration.cs:70` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationOptions.cs:1-15`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs:10-11`, `src/ZB.MOM.WW.ScadaBridge.Host/SiteServiceRegistration.cs:70` | **Description** -`NotificationOptions` (with `ConnectionTimeoutSeconds` and `MaxConcurrentConnections`) is bound from the `ScadaLink:Notification` configuration section in two places — `ServiceCollectionExtensions.AddNotificationService` (`AddOptions().BindConfiguration(...)`) and again in `Host/SiteServiceRegistration.cs:70` (`services.Configure(...)`). However, a repo-wide search shows no code ever injects `IOptions` or otherwise reads either property. When NS-007 enforced the connection timeout and concurrency limit, it sourced both values from the per-site `SmtpConfiguration` entity, not from `NotificationOptions` — so this options class is now entirely dead configuration. Its XML doc still claims it "provides fallback defaults and operational limits", which is misleading: nothing falls back to it. The double binding is also redundant. Dead, falsely-documented configuration invites an operator to set `ScadaLink:Notification:ConnectionTimeoutSeconds` and expect it to take effect, when it has no effect at all. +`NotificationOptions` (with `ConnectionTimeoutSeconds` and `MaxConcurrentConnections`) is bound from the `ScadaBridge:Notification` configuration section in two places — `ServiceCollectionExtensions.AddNotificationService` (`AddOptions().BindConfiguration(...)`) and again in `Host/SiteServiceRegistration.cs:70` (`services.Configure(...)`). However, a repo-wide search shows no code ever injects `IOptions` or otherwise reads either property. When NS-007 enforced the connection timeout and concurrency limit, it sourced both values from the per-site `SmtpConfiguration` entity, not from `NotificationOptions` — so this options class is now entirely dead configuration. Its XML doc still claims it "provides fallback defaults and operational limits", which is misleading: nothing falls back to it. The double binding is also redundant. Dead, falsely-documented configuration invites an operator to set `ScadaBridge:Notification:ConnectionTimeoutSeconds` and expect it to take effect, when it has no effect at all. **Recommendation** @@ -627,7 +627,7 @@ Resolved 2026-05-17. Root cause confirmed — `NotificationOptions` was bound bu | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:237-255` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:237-255` | **Description** @@ -648,9 +648,9 @@ Resolved 2026-05-17. All three issues confirmed against source. The hand-rolled | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:18-442`, `src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs:20-21`, `src/ScadaLink.Commons/Interfaces/Services/INotificationDeliveryService.cs:1-33`, `src/ScadaLink.Host/Program.cs:77` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:18-442`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs:20-21`, `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/Services/INotificationDeliveryService.cs:1-33`, `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:77` | -**Resolution** — Executed option 1. Deleted `src/ScadaLink.NotificationService/NotificationDeliveryService.cs`, `src/ScadaLink.Commons/Interfaces/Services/INotificationDeliveryService.cs` (also retires `NotificationResult` + `BufferedNotification`), and the orphaned `tests/ScadaLink.NotificationService.Tests/NotificationDeliveryServiceTests.cs` suite; reduced `AddNotificationService` to the shared SMTP primitives (`OAuth2TokenService`, `Func`, `NotificationOptions`), updated `CompositionRootTests` (assert the primitives instead of the dead types), and removed the `Notification_Send_MockSmtp_Delivers` assertion in `IntegrationSurfaceTests` (central delivery is covered by `EmailNotificationDeliveryAdapterTests`). Grep-verified `grep -rn "INotificationDeliveryService\|NotificationDeliveryService\|NotificationResult\|BufferedNotification\|DeliverBufferedAsync" --include="*.cs" src/ tests/` before delete: zero production callers (only XML-doc cross-references in NS, MailKit wrapper, NotificationOptions and `EmailNotificationDeliveryAdapter`, plus the dead test files); cross-reference comments updated to remove the stale class references. `dotnet build ScadaLink.slnx` succeeds (0 warnings, 0 errors); affected test projects all pass (`NotificationService.Tests` 52/52, `NotificationOutbox.Tests` 86/86 on rerun — one flaky timing-sensitive Akka.TestKit test unrelated to NS-019, `Host.Tests` 205/205); `IntegrationTests` 64/66 with two pre-existing failures in `NotificationOutboxFlowTests` (SQLite "near IF: syntax error", reproducible on pristine `main`, unrelated to NS-019). +**Resolution** — Executed option 1. Deleted `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs`, `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/Services/INotificationDeliveryService.cs` (also retires `NotificationResult` + `BufferedNotification`), and the orphaned `tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/NotificationDeliveryServiceTests.cs` suite; reduced `AddNotificationService` to the shared SMTP primitives (`OAuth2TokenService`, `Func`, `NotificationOptions`), updated `CompositionRootTests` (assert the primitives instead of the dead types), and removed the `Notification_Send_MockSmtp_Delivers` assertion in `IntegrationSurfaceTests` (central delivery is covered by `EmailNotificationDeliveryAdapterTests`). Grep-verified `grep -rn "INotificationDeliveryService\|NotificationDeliveryService\|NotificationResult\|BufferedNotification\|DeliverBufferedAsync" --include="*.cs" src/ tests/` before delete: zero production callers (only XML-doc cross-references in NS, MailKit wrapper, NotificationOptions and `EmailNotificationDeliveryAdapter`, plus the dead test files); cross-reference comments updated to remove the stale class references. `dotnet build ZB.MOM.WW.ScadaBridge.slnx` succeeds (0 warnings, 0 errors); affected test projects all pass (`NotificationService.Tests` 52/52, `NotificationOutbox.Tests` 86/86 on rerun — one flaky timing-sensitive Akka.TestKit test unrelated to NS-019, `Host.Tests` 205/205); `IntegrationTests` 64/66 with two pre-existing failures in `NotificationOutboxFlowTests` (SQLite "near IF: syntax error", reproducible on pristine `main`, unrelated to NS-019). **Description** @@ -660,8 +660,8 @@ The current source does not match. `NotificationDeliveryService` is a site-shape Who actually calls it? -- **Sites** do **not**. `SiteServiceRegistration.cs:33-38` documents the deliberate omission: "AddNotificationService() is intentionally NOT registered on the site path." Sites register `NotificationForwarder` (in `ScadaLink.StoreAndForward`) as the S&F handler for `StoreAndForwardCategory.Notification` (`AkkaHostedService.cs:654-660`), which Asks the central comms actor and never touches SMTP. `ScriptRuntimeContext.NotifyHelper` (in `SiteRuntime`) enqueues directly to S&F as a serialized `NotificationSubmit`, **not** via `INotificationDeliveryService.SendAsync`. -- **Central** registers it (`Program.cs:77` calls `AddNotificationService`) but no central component resolves it. The central notification dispatcher is `NotificationOutboxActor` → `INotificationDeliveryAdapter` → `EmailNotificationDeliveryAdapter`. The adapter is a full re-implementation of the connect/auth/send/disconnect sequence (see `EmailNotificationDeliveryAdapter.cs:163-222`) — it deliberately does not call `NotificationDeliveryService.DeliverAsync` (XML-doc on the adapter says "Reuses the `ScadaLink.NotificationService` SMTP machinery — `ISmtpClientWrapper`, `SmtpTlsModeParser`, `OAuth2TokenService` and the typed `SmtpPermanentException`", i.e. only the leaf primitives). +- **Sites** do **not**. `SiteServiceRegistration.cs:33-38` documents the deliberate omission: "AddNotificationService() is intentionally NOT registered on the site path." Sites register `NotificationForwarder` (in `ZB.MOM.WW.ScadaBridge.StoreAndForward`) as the S&F handler for `StoreAndForwardCategory.Notification` (`AkkaHostedService.cs:654-660`), which Asks the central comms actor and never touches SMTP. `ScriptRuntimeContext.NotifyHelper` (in `SiteRuntime`) enqueues directly to S&F as a serialized `NotificationSubmit`, **not** via `INotificationDeliveryService.SendAsync`. +- **Central** registers it (`Program.cs:77` calls `AddNotificationService`) but no central component resolves it. The central notification dispatcher is `NotificationOutboxActor` → `INotificationDeliveryAdapter` → `EmailNotificationDeliveryAdapter`. The adapter is a full re-implementation of the connect/auth/send/disconnect sequence (see `EmailNotificationDeliveryAdapter.cs:163-222`) — it deliberately does not call `NotificationDeliveryService.DeliverAsync` (XML-doc on the adapter says "Reuses the `ZB.MOM.WW.ScadaBridge.NotificationService` SMTP machinery — `ISmtpClientWrapper`, `SmtpTlsModeParser`, `OAuth2TokenService` and the typed `SmtpPermanentException`", i.e. only the leaf primitives). The `NotificationDeliveryService` class, its `DeliverBufferedAsync`, the `Func` registration consumed only by it, and the `INotificationDeliveryService` interface (still in Commons) and `NotificationResult` record are therefore dead code that contradicts the design. Worse, every prior finding NS-001..NS-018 was reviewed and resolved against this dead path. The 56-test green test suite (NS-012 resolution note) exercises behaviour no production caller invokes — it gives a false sense of coverage. The misleading XML doc on `NotificationDeliveryService` ("WP-11/12: Notification delivery via SMTP") tells a maintainer this is *the* delivery path; the registration on central does the same. @@ -671,7 +671,7 @@ Risk: an operator following the design doc will look here for "the central email Decide and execute one of: -1. **Delete `NotificationDeliveryService`, `DeliverBufferedAsync`, the `BufferedNotification` payload type, the `Func` scoped registration (move it to NotificationOutbox if still needed there — it already has its own), and `INotificationDeliveryService`/`NotificationResult` in Commons.** Reduce `AddNotificationService` to registering the shared primitives — `OAuth2TokenService`, `ISmtpClientWrapper` factory, `NotificationOptions`. Delete the NS-001..NS-018 tests that target the orphaned path; rebase the ones that exercise primitives (`SmtpErrorClassifier`, `SmtpTlsModeParser`, `CredentialRedactor`, `EmailAddressValidator`, `MailKitSmtpClientWrapper`, `OAuth2TokenService`) which remain genuinely shared. Update `CompositionRootTests` (`tests/ScadaLink.Host.Tests/CompositionRootTests.cs:208-209`) and `IntegrationSurfaceTests` (`tests/ScadaLink.IntegrationTests/IntegrationSurfaceTests.cs:122-135`) to drop the stale assertions. +1. **Delete `NotificationDeliveryService`, `DeliverBufferedAsync`, the `BufferedNotification` payload type, the `Func` scoped registration (move it to NotificationOutbox if still needed there — it already has its own), and `INotificationDeliveryService`/`NotificationResult` in Commons.** Reduce `AddNotificationService` to registering the shared primitives — `OAuth2TokenService`, `ISmtpClientWrapper` factory, `NotificationOptions`. Delete the NS-001..NS-018 tests that target the orphaned path; rebase the ones that exercise primitives (`SmtpErrorClassifier`, `SmtpTlsModeParser`, `CredentialRedactor`, `EmailAddressValidator`, `MailKitSmtpClientWrapper`, `OAuth2TokenService`) which remain genuinely shared. Update `CompositionRootTests` (`tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CompositionRootTests.cs:208-209`) and `IntegrationSurfaceTests` (`tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/IntegrationSurfaceTests.cs:122-135`) to drop the stale assertions. 2. **Keep the class as the central-only Email delivery primitive** and rewrite `EmailNotificationDeliveryAdapter` to delegate to it. This is the smaller diff but the larger semantic burden — `NotificationDeliveryService.SendAsync` returns `NotificationResult` (Success / WasBuffered) which cannot encode the three-way `DeliveryOutcome` (Success / Transient / Permanent) the outbox needs, so the contract still has to change. @@ -684,7 +684,7 @@ Recommended path is option 1: the parallel implementation in `EmailNotificationD | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:654-660`, NS-001 resolution note (this file) | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:654-660`, NS-001 resolution note (this file) | **Resolution (2026-05-28):** Added a `_notificationDeliveryHandlerRegistered` sentinel field on `AkkaHostedService` and gated the canonical `NotificationForwarder` registration with an `InvalidOperationException` guard — a future code path that re-introduces the dead NS-001 site-SMTP handler now fails fast at startup with an explicit NS-020 diagnostic, rather than silently overwriting `RegisterDeliveryHandler`'s last-write-wins map and inverting the central-only design. The sentinel's XML doc cross-references NS-001/NS-019/NS-020 so a maintainer searching for the `Notification` S&F handler finds the one canonical registration and its history. @@ -707,7 +707,7 @@ Mark the NS-001 resolution note in this file as **superseded by NS-019** with a | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs:76-79` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs:76-79` | **Description** @@ -736,7 +736,7 @@ Pass the sender mailbox into the wrapper's `AuthenticateAsync` path. The cleanes | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs:14`, `src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs:19` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs:14`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs:19` | **Resolution (2026-05-28):** Took option (a) — updated the class-level XML doc on `MailKitSmtpClientWrapper` with an explicit lifetime section (NS-022) describing single-connection ownership and the per-delivery factory contract (NOT a pool; `MailKit.Net.Smtp.SmtpClient` holds one TCP/TLS connection and is not thread-safe; the DI `Func` is a factory, callers run connect/auth/send/disconnect/dispose per send). A field-level comment was added to the `_client` declaration cross-referencing the class docs so a maintainer hunting from the field-initializer immediately sees the constraint. The wrapper code itself is unchanged — option (b) (transient SmtpClient per Send) was deliberately not taken because it would re-handshake TLS per email which is materially more expensive than the current per-delivery factory model the callers already implement. The concurrent-connection limit regression on the central-side delivery path (per-site semaphore on `EmailNotificationDeliveryAdapter`) is out of NotificationService scope and tracked separately. @@ -761,7 +761,7 @@ Document the per-send lifecycle on `MailKitSmtpClientWrapper` (XML on the class: | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:12-17`, `src/ScadaLink.Commons/Interfaces/Services/INotificationDeliveryService.cs:3-12`, `src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs:8-9` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:12-17`, `src/ZB.MOM.WW.ScadaBridge.Commons/Interfaces/Services/INotificationDeliveryService.cs:3-12`, `src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs:8-9` | **Resolution (2026-05-28):** Closed by NS-019 — both `NotificationDeliveryService.cs` and `INotificationDeliveryService.cs` were removed in commit `ac96b83`, and `ServiceCollectionExtensions.AddNotificationService`'s XML doc was rewritten in the same commit to describe the central-only design (shared SMTP primitives consumed by `EmailNotificationDeliveryAdapter`, with an explicit NS-019 cross-reference and a note that sites no longer deliver notifications). No stale XML docs remain in this module. @@ -787,9 +787,9 @@ Tied to NS-019: if the orphan classes are deleted, this finding closes itself. I | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.NotificationService.Tests/NotificationDeliveryServiceTests.cs`, `tests/ScadaLink.IntegrationTests/IntegrationSurfaceTests.cs:118-136`, `tests/ScadaLink.Host.Tests/CompositionRootTests.cs:207-209` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/NotificationDeliveryServiceTests.cs`, `tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/IntegrationSurfaceTests.cs:118-136`, `tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CompositionRootTests.cs:207-209` | -**Resolution (2026-05-28):** Closed by NS-019 — the orphaned `NotificationDeliveryService` class, its `INotificationDeliveryService` Commons interface, and the associated `NotificationDeliveryServiceTests.cs` test file (~40 tests asserting `SendAsync`/`DeliverBufferedAsync` behaviour against a code path no production caller resolves) were all deleted in the NS-019 fix commit. Verification: a directory listing of `tests/ScadaLink.NotificationService.Tests/` shows only `CredentialRedactorTests.cs`, `MailKitSmtpClientWrapperTests.cs`, `NotificationOptionsTests.cs`, `OAuth2TokenServiceTests.cs`, `SmtpErrorClassifierTests.cs`, and `SmtpTlsModeParserTests.cs` — every retained file exercises a primitive that the central NotificationOutbox `EmailNotificationDeliveryAdapter` still depends on, so the false-coverage signal this finding called out no longer exists. The "no test affirms the central-only invariant" gap was the consequence of the orphaned tests existing; with them gone, the module test suite genuinely scopes to the shared SMTP primitives. The architecture-test recommendation (banning new consumers of `INotificationDeliveryService`) is moot once the interface itself is gone. +**Resolution (2026-05-28):** Closed by NS-019 — the orphaned `NotificationDeliveryService` class, its `INotificationDeliveryService` Commons interface, and the associated `NotificationDeliveryServiceTests.cs` test file (~40 tests asserting `SendAsync`/`DeliverBufferedAsync` behaviour against a code path no production caller resolves) were all deleted in the NS-019 fix commit. Verification: a directory listing of `tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/` shows only `CredentialRedactorTests.cs`, `MailKitSmtpClientWrapperTests.cs`, `NotificationOptionsTests.cs`, `OAuth2TokenServiceTests.cs`, `SmtpErrorClassifierTests.cs`, and `SmtpTlsModeParserTests.cs` — every retained file exercises a primitive that the central NotificationOutbox `EmailNotificationDeliveryAdapter` still depends on, so the false-coverage signal this finding called out no longer exists. The "no test affirms the central-only invariant" gap was the consequence of the orphaned tests existing; with them gone, the module test suite genuinely scopes to the shared SMTP primitives. The architecture-test recommendation (banning new consumers of `INotificationDeliveryService`) is moot once the interface itself is gone. **Description** @@ -799,7 +799,7 @@ In particular there is **no test in this module** that affirms the central-only - No test that `AddNotificationService()` registered on a *site* role would be inert / no-op'd, or that `SiteServiceRegistration.Configure` does **not** call `AddNotificationService` (an obvious regression vector — re-adding it would silently restore the orphaned site-delivery path). - No test that confirms `INotificationDeliveryService` has no production consumer (i.e. an architecture test that fails if anyone re-introduces a constructor parameter or `GetRequiredService()` call). -- The cross-module `CompositionRootTests` (`tests/ScadaLink.Host.Tests/CompositionRootTests.cs:208-209`) still asserts `NotificationDeliveryService` and `INotificationDeliveryService` are registered, locking in the orphan rather than catching it. +- The cross-module `CompositionRootTests` (`tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CompositionRootTests.cs:208-209`) still asserts `NotificationDeliveryService` and `INotificationDeliveryService` are registered, locking in the orphan rather than catching it. - `IntegrationSurfaceTests.cs:122-125` constructs `NotificationDeliveryService` directly to validate "the integration surface" — testing a surface that no script actually crosses. **Recommendation** @@ -807,7 +807,7 @@ In particular there is **no test in this module** that affirms the central-only After NS-019 is decided: 1. If the orphan is deleted, remove the orphaned-path tests (NS-001/004/005/007/008/009/010/014/015/016/017/018-style tests targeting `SendAsync`/`DeliverBufferedAsync`). Retain `SmtpErrorClassifierTests`, `SmtpTlsModeParserTests`, `CredentialRedactorTests`, `OAuth2TokenServiceTests`, and `MailKitSmtpClientWrapperTests` (primitives genuinely shared). Update `CompositionRootTests` to drop the stale rows and `IntegrationSurfaceTests` to call the live path via `INotificationDeliveryAdapter`/`EmailNotificationDeliveryAdapter`. -2. Add a one-shot architecture test in `tests/ScadaLink.Architecture.Tests` (if it exists, else this module) that scans for direct references to `INotificationDeliveryService` outside this project and the obsolete-interface declaration in Commons, failing if any new consumer reappears. +2. Add a one-shot architecture test in `tests/ZB.MOM.WW.ScadaBridge.Architecture.Tests` (if it exists, else this module) that scans for direct references to `INotificationDeliveryService` outside this project and the obsolete-interface declaration in Commons, failing if any new consumer reappears. ### NotificationService-025 — `CredentialRedactor` over-masks: any 4-character credential component is masked anywhere it appears, including unrelated log text @@ -816,7 +816,7 @@ After NS-019 is decided: | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.NotificationService/CredentialRedactor.cs:34-48` | +| Location | `src/ZB.MOM.WW.ScadaBridge.NotificationService/CredentialRedactor.cs:34-48` | **Resolution (2026-05-28):** Tightened the policy per the recommendation — only the LAST colon-separated component (password in Basic / clientSecret diff --git a/code-reviews/README.md b/code-reviews/README.md index d4918f75..9a60a7d6 100644 --- a/code-reviews/README.md +++ b/code-reviews/README.md @@ -1,6 +1,6 @@ # Code Reviews -Comprehensive, per-module code reviews of the ScadaLink codebase. Each module (one +Comprehensive, per-module code reviews of the ScadaBridge codebase. Each module (one buildable project under `src/`) has its own folder containing a `findings.md`. This README is the aggregated index — the single place to see all outstanding work. diff --git a/code-reviews/REVIEW-PROCESS.md b/code-reviews/REVIEW-PROCESS.md index 1578f870..e5dcb17b 100644 --- a/code-reviews/REVIEW-PROCESS.md +++ b/code-reviews/REVIEW-PROCESS.md @@ -1,15 +1,15 @@ # Code Review Process This document describes how to perform a comprehensive, per-module code review of -the ScadaLink codebase and how to track findings to resolution. +the ScadaBridge codebase and how to track findings to resolution. -A **module** is one buildable project under `src/` (e.g. `src/ScadaLink.TemplateEngine`). +A **module** is one buildable project under `src/` (e.g. `src/ZB.MOM.WW.ScadaBridge.TemplateEngine`). Each module has its own folder under `code-reviews/` containing a single `findings.md`. ## 1. Before you start 1. Pick the module to review. Its folder is `code-reviews//` where `` - is the project name with the `ScadaLink.` prefix stripped. + is the project name with the `ZB.MOM.WW.ScadaBridge.` prefix stripped. 2. Identify the design context for the module: - Its component design doc: `docs/requirements/Component-.md`. - The relevant **Key Design Decisions** in `CLAUDE.md`. diff --git a/code-reviews/Security/findings.md b/code-reviews/Security/findings.md index 56b80fda..4e84ef39 100644 --- a/code-reviews/Security/findings.md +++ b/code-reviews/Security/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.Security` | +| Module | `src/ZB.MOM.WW.ScadaBridge.Security` | | Design doc | `docs/requirements/Component-Security.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -117,7 +117,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:37-47` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:37-47` | **Description** @@ -153,7 +153,7 @@ and `AuthenticateAsync_NoTlsTransport_RejectedWithoutAllowInsecure`. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Security/ServiceCollectionExtensions.cs:16-23` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/ServiceCollectionExtensions.cs:16-23` | **Description** @@ -186,7 +186,7 @@ tuning left as a separate, lower-priority improvement.) | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Security/JwtTokenService.cs:33`, `src/ScadaLink.Security/SecurityOptions.cs:42` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/JwtTokenService.cs:33`, `src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptions.cs:42` | **Description** @@ -222,7 +222,7 @@ corrected to state the requirement. Regression tests | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:66`, `:138`, `:157-159` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:66`, `:138`, `:157-159` | **Description** @@ -258,7 +258,7 @@ Regression tests `BuildFallbackUserDn_UsesConfiguredUserIdAttribute`, | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:157-159` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:157-159` | **Description** @@ -297,7 +297,7 @@ Regression tests `BuildFallbackUserDn_EscapesDnMetacharacters`, | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Security/JwtTokenService.cs:67-75`, `:56-59` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/JwtTokenService.cs:67-75`, `:56-59` | **Description** @@ -311,7 +311,7 @@ silently exploitable. **Recommendation** -Set a fixed `Issuer` and `Audience` (e.g. `"scadalink-central"`) when generating tokens +Set a fixed `Issuer` and `Audience` (e.g. `"scadabridge-central"`) when generating tokens and enable `ValidateIssuer`/`ValidateAudience` with the matching expected values during validation. @@ -320,7 +320,7 @@ validation. Resolved 2026-05-16 (commit `pending`). Confirmed: `GenerateToken` set neither `iss` nor `aud` and `ValidateToken` had `ValidateIssuer = false`/`ValidateAudience = false`. `GenerateToken` now binds `JwtTokenService.TokenIssuer`/`TokenAudience` -(both `"scadalink-central"`) into every token, and `ValidateToken` enables +(both `"scadabridge-central"`) into every token, and `ValidateToken` enables `ValidateIssuer`/`ValidateAudience` against those fixed values — a token signed with the shared key but a foreign issuer is now rejected. Regression tests `GenerateToken_SetsIssuerAndAudience`, `ValidateToken_RejectsTokenWithWrongIssuer`, @@ -333,7 +333,7 @@ the shared key but a foreign issuer is now rejected. Regression tests | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Security/JwtTokenService.cs:40`, `:111-123` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/JwtTokenService.cs:40`, `:111-123` | **Description** @@ -381,7 +381,7 @@ Security-side defect — the reset-on-refresh bug — is fully fixed here. Regre | Severity | Low | | Category | Performance & resource management | | Status | Deferred | -| Location | `src/ScadaLink.Security/RoleMapper.cs:25-48` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/RoleMapper.cs:25-48` | **Description** @@ -403,7 +403,7 @@ issues one `GetScopeRulesForMappingAsync` round-trip per matched Deployment mapp genuine N+1 on the login / 15-minute-refresh path. However, the only correct fix (a batch `GetScopeRulesForMappingsAsync(IEnumerable)` repository method, or an eager-load navigation property) requires changes to `ISecurityRepository` -(`src/ScadaLink.Commons`) and `SecurityRepository` (`src/ScadaLink.ConfigurationDatabase`). +(`src/ZB.MOM.WW.ScadaBridge.Commons`) and `SecurityRepository` (`src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase`). Both are outside the Security module's permitted edit scope for this review pass, and the existing `ISecurityRepository` surface offers no per-set scope-rule query, so the N+1 cannot be removed from within `RoleMapper.cs` alone. Severity is Low (bounded by the @@ -418,7 +418,7 @@ rules in a single call. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:42`, `:46`, `:51`, `:56-57`, `:67-73`, `:135`, `:139-145` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:42`, `:46`, `:51`, `:56-57`, `:67-73`, `:135`, `:139-145` | **Description** @@ -490,7 +490,7 @@ of the document and the code. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.Security.Tests/UnitTest1.cs` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.Security.Tests/UnitTest1.cs` | **Description** @@ -529,7 +529,7 @@ LDAP-timeout coverage (Security-009) plus extra no-service-account / DN-path edg | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:78-118` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:78-118` | **Description** @@ -581,7 +581,7 @@ treating a genuine empty-groups result as a successful login. Regression tests | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:258-269` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:258-269` | **Description** @@ -621,7 +621,7 @@ testing. Regression tests `ExtractFirstRdnValue_EscapedComma_KeepsWholeGroupName | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Security/JwtTokenService.cs:156-169` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/JwtTokenService.cs:156-169` | **Description** @@ -665,7 +665,7 @@ invariant. Regression tests `RefreshToken_IdleExpiredPrincipal_ReturnsNull`, | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:20-21`, `:80`, `:122`, `:169`, `:193` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:20-21`, `:80`, `:122`, `:169`, `:193` | **Description** @@ -707,7 +707,7 @@ use the single canonical identity. Regression tests | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Security/RoleMapper.cs:30-31`, `:41-55`, `:59` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/RoleMapper.cs:30-31`, `:41-55`, `:59` | **Description** @@ -765,17 +765,17 @@ after. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.Security/SiteScopeAuthorizationHandler.cs:8-58`; `src/ScadaLink.Security/AuthorizationPolicies.cs:113-143` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/SiteScopeAuthorizationHandler.cs:8-58`; `src/ZB.MOM.WW.ScadaBridge.Security/AuthorizationPolicies.cs:113-143` | **Description** The module declares `SiteScopeRequirement` (an `IAuthorizationRequirement` carrying a `TargetSiteId`) and the matching `SiteScopeAuthorizationHandler` that combines the Deployment role claim with the `SiteId` claims to enforce the design's site-scoping -rule. The handler is registered in `AddScadaLinkAuthorization` +rule. The handler is registered in `AddScadaBridgeAuthorization` (`services.AddSingleton()`). But no `AddPolicy` call ever wires the requirement to a named policy, and a grep across -`src/ScadaLink.CentralUI` and `src/ScadaLink.ManagementService` confirms that **no +`src/ZB.MOM.WW.ScadaBridge.CentralUI` and `src/ZB.MOM.WW.ScadaBridge.ManagementService` confirms that **no production code ever instantiates `new SiteScopeRequirement(...)` or calls `AuthorizeAsync(...)` with one** — the only callers are the unit tests in `SecurityTests.cs:1146,1166,1185,1203`. The design + CLAUDE.md state that "Deployment @@ -808,7 +808,7 @@ piecemeal. Resolved 2026-05-28 (commit pending) per recommendation option (a): deleted `SiteScopeRequirement` and `SiteScopeAuthorizationHandler` outright, along with the unwired `services.AddSingleton()` -registration in `AuthorizationPolicies.AddScadaLinkAuthorization` and the four +registration in `AuthorizationPolicies.AddScadaBridgeAuthorization` and the four isolation tests in `SecurityTests.cs`. `SiteScopeService` (CentralUI-002) is now documented as the sole site-scoping mechanism — the stale "mirrors SiteScopeAuthorizationHandler" comment in `SiteScopeService.ResolveAsync` was rewritten @@ -822,7 +822,7 @@ new report pages now consume `SiteScopeService`). | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.Security/RoleMapper.cs:41`; `src/ScadaLink.Security/SiteScopeAuthorizationHandler.cs:36`; `src/ScadaLink.Security/AuthorizationPolicies.cs:118,121,124,95,107` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/RoleMapper.cs:41`; `src/ZB.MOM.WW.ScadaBridge.Security/SiteScopeAuthorizationHandler.cs:36`; `src/ZB.MOM.WW.ScadaBridge.Security/AuthorizationPolicies.cs:118,121,124,95,107` | **Description** @@ -852,11 +852,11 @@ will then either succeed everywhere or fail to compile. **Resolution** -Resolved 2026-05-28 (commit pending). Added `src/ScadaLink.Security/Roles.cs` holding +Resolved 2026-05-28 (commit pending). Added `src/ZB.MOM.WW.ScadaBridge.Security/Roles.cs` holding `Admin`/`Design`/`Deployment`/`Audit`/`AuditReadOnly` as `public const string` fields. Replaced every magic-string occurrence in this module: `RoleMapper.MapGroupsToRolesAsync` now compares against `Roles.Deployment`; -`AuthorizationPolicies.AddScadaLinkAuthorization` binds `RequireClaim(...)` to +`AuthorizationPolicies.AddScadaBridgeAuthorization` binds `RequireClaim(...)` to `Roles.{Admin,Design,Deployment}`; `OperationalAuditRoles` / `AuditExportRoles` are now built from `Roles.Admin`, `Roles.Audit`, `Roles.AuditReadOnly`. `SiteScopeAuthorizationHandler.cs` was deleted under Security-017, so its @@ -870,7 +870,7 @@ single edit or fails to compile. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Security/LdapAuthService.cs:85-89`, `:147-151` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs:85-89`, `:147-151` | **Description** @@ -903,7 +903,7 @@ distinct error message. **Resolution** Resolved 2026-05-28 (commit pending). Added a new `ServiceAccountBindException` -(`src/ScadaLink.Security/ServiceAccountBindException.cs`) — deliberately NOT an +(`src/ZB.MOM.WW.ScadaBridge.Security/ServiceAccountBindException.cs`) — deliberately NOT an `LdapException` subtype so it short-circuits the generic LDAP catch — and a private `BindServiceAccountAsync` helper on `LdapAuthService` that wraps both service-account rebind sites (the post-user-bind group-lookup rebind AND the `ResolveUserDnAsync` @@ -926,7 +926,7 @@ is the closest meaningful unit-level coverage. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Security/SecurityOptions.cs:6-7`, `:36-37`; `src/ScadaLink.Security/ServiceCollectionExtensions.cs:13-30` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptions.cs:6-7`, `:36-37`; `src/ZB.MOM.WW.ScadaBridge.Security/ServiceCollectionExtensions.cs:13-30` | **Resolution (2026-05-28):** added `SecurityOptionsValidator` (`IValidateOptions`) that rejects empty/whitespace @@ -972,7 +972,7 @@ every required `SecurityOptions` field is enforced at startup, not at first use. | Severity | Low | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Security/SecurityOptions.cs:100-108`; `src/ScadaLink.Security/ServiceCollectionExtensions.cs:54-59` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptions.cs:100-108`; `src/ZB.MOM.WW.ScadaBridge.Security/ServiceCollectionExtensions.cs:54-59` | **Resolution (2026-05-28):** Added `ILoggerFactory` to the cookie-options `Configure` callback in `AddSecurity` so an explicit `RequireHttpsCookie=false` diff --git a/code-reviews/SiteCallAudit/findings.md b/code-reviews/SiteCallAudit/findings.md index 018d9407..f656afb3 100644 --- a/code-reviews/SiteCallAudit/findings.md +++ b/code-reviews/SiteCallAudit/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.SiteCallAudit` | +| Module | `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit` | | Design doc | `docs/requirements/Component-SiteCallAudit.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -51,7 +51,7 @@ tests using a shared `MsSqlMigrationFixture`. | Severity | Medium | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs:32-46`, `src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs:147-151` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs:32-46`, `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs:147-151` | **Description** @@ -107,7 +107,7 @@ children (Site Runtime hierarchy) — not to leaf cluster singletons. | Severity | Low | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:455-462` (singleton wiring), `src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs:153-193` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:455-462` (singleton wiring), `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs:153-193` | **Resolution (2026-05-28):** Added a `CoordinatedShutdown` task in the `cluster-leave` phase (named `drain-site-call-audit-singleton`) that issues an explicit `GracefulStop(10s)` to the `SiteCallAudit` cluster singleton manager before the cluster-leave proceeds. Akka.NET's singleton handover already waits for the active actor's `ReceiveAsync` task to complete before signalling `HandOverDone`, so an in-flight EF `UpsertAsync` (and its SQL round-trip) drains on the old node before the new singleton starts on the other central node — closing the seam where the new singleton could race a still-running upsert on the old node. The 10-second timeout is bounded so a misbehaving upsert cannot stall coordinated shutdown indefinitely; on timeout the existing `PoisonPill` termination path takes over and the repository's monotonic-upsert + 2601/2627 duplicate-key swallow remain as the storage-state safety net. Pattern is suitable for the `NotificationOutbox` singleton too; deferred to keep this change scoped. @@ -153,14 +153,14 @@ Notification Outbox sibling has the same pattern. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs:153-193` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs:153-193` | **Description** The combined-telemetry hot path (`AuditLogIngestActor.OnCachedTelemetryAsync`) stamps `IngestedAtUtc = DateTime.UtcNow` on both the `AuditLog` row and the `SiteCall` row at central-side persist time -(`src/ScadaLink.AuditLog/Central/AuditLogIngestActor.cs:238-239`). The design +(`src/ZB.MOM.WW.ScadaBridge.AuditLog/Central/AuditLogIngestActor.cs:238-239`). The design doc treats `IngestedAtUtc` as "central ingested (or last refreshed) this row" — a central-side timestamp. @@ -197,7 +197,7 @@ because callers cannot in general know the actor is colocated on central. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs:23-30` (actor XML), `src/ScadaLink.SiteCallAudit/ServiceCollectionExtensions.cs:8-13`, `docs/requirements/Component-SiteCallAudit.md:24-32` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs:23-30` (actor XML), `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/ServiceCollectionExtensions.cs:8-13`, `docs/requirements/Component-SiteCallAudit.md:24-32` | **Description** @@ -238,7 +238,7 @@ doc update is tracked separately. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs:548-563` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs:548-563` | **Description** @@ -297,9 +297,9 @@ relay-path crash. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditActorTests.cs:335-392` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditActorTests.cs:335-392` | -**Resolution (2026-05-28):** Added `SiteCallQueryRequest_StuckOnly_CursorAtNonStuckBoundary_SkipsToNextStuckRow` to `tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditActorTests.cs` — drives six rows interleaved as `stuck/non-stuck` × 3 (oldest-first), then issues three page-size-1 stuck-only queries. The cursor between each page deliberately lands on a non-stuck row, so the SQL composition of the stuck predicate AND the keyset cursor predicate must skip it. Asserts each page returns exactly one stuck row in DESC-by-CreatedAtUtc order with no overlap and all three stuck rows visited. Locks the invariant that post-filtering does not produce under-filled pages with non-null next cursors. +**Resolution (2026-05-28):** Added `SiteCallQueryRequest_StuckOnly_CursorAtNonStuckBoundary_SkipsToNextStuckRow` to `tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditActorTests.cs` — drives six rows interleaved as `stuck/non-stuck` × 3 (oldest-first), then issues three page-size-1 stuck-only queries. The cursor between each page deliberately lands on a non-stuck row, so the SQL composition of the stuck predicate AND the keyset cursor predicate must skip it. Asserts each page returns exactly one stuck row in DESC-by-CreatedAtUtc order with no overlap and all three stuck rows visited. Locks the invariant that post-filtering does not produce under-filled pages with non-null next cursors. **Description** diff --git a/code-reviews/SiteEventLogging/findings.md b/code-reviews/SiteEventLogging/findings.md index 1be32617..972a1efd 100644 --- a/code-reviews/SiteEventLogging/findings.md +++ b/code-reviews/SiteEventLogging/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.SiteEventLogging` | +| Module | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging` | | Design doc | `docs/requirements/Component-SiteEventLogging.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -110,7 +110,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs:100-102`, `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:36-55` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs:100-102`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:36-55` | **Description** @@ -150,7 +150,7 @@ reliably observes the database shrinking. Regression test | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs:87-105` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs:87-105` | **Description** @@ -190,7 +190,7 @@ removed). | Severity | High | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs:64,90,100,110,114`, `src/ScadaLink.SiteEventLogging/EventLogQueryService.cs:36`, `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:34,72` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs:64,90,100,110,114`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs:36`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:34,72` | **Description** @@ -233,7 +233,7 @@ concurrently with multiple writer threads. | Original severity | High (re-triaged down to Low on 2026-05-16 — see Re-triage note) | | Category | Design-document adherence | | Status | Won't Fix | -| Location | `src/ScadaLink.Host/Actors/AkkaHostedService.cs:313-336`, `src/ScadaLink.SiteEventLogging/EventLogHandlerActor.cs:21-25` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs:313-336`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogHandlerActor.cs:21-25` | **Description** @@ -277,14 +277,14 @@ as a plain per-node DI singleton (`AddSiteEventLogging`), so it records to a loc SQLite file on **every** node, including the standby. That wastes storage on the standby but does **not** cause the query-returns-nothing symptom the finding describes, because the query singleton always reads the *active* node's (populated) -database. Gating the writer to the active node would be a `ScadaLink.Host` wiring +database. Gating the writer to the active node would be a `ZB.MOM.WW.ScadaBridge.Host` wiring change, outside this module's scope, and is a minor optimisation rather than a correctness defect. Re-triaged from High to Low and closed as **Won't Fix**: the High-severity correctness claim does not hold. Any residual cleanup (gate the standby-node writer; the comment needs no change) can be raised as a fresh Low finding against -`ScadaLink.Host` if desired. +`ZB.MOM.WW.ScadaBridge.Host` if desired. **Resolution** @@ -300,7 +300,7 @@ on the active node. No code change made; see the re-triage note above. | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:57-99` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:57-99` | **Description** @@ -343,7 +343,7 @@ caller returns in <500 ms while the database is held busy) plus | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:50-52`, `src/ScadaLink.SiteEventLogging/EventLogQueryService.cs:65-81` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:50-52`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs:65-81` | **Description** @@ -380,7 +380,7 @@ tests `Schema_HasIndexOnSeverity` and `SeverityFilteredQuery_UsesIndex_NotFullSc | Severity | Medium (partially re-triaged 2026-05-16 — see Re-triage note) | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs:21-30`, `src/ScadaLink.SiteEventLogging/EventLogQueryService.cs:20-28`, `src/ScadaLink.SiteEventLogging/ServiceCollectionExtensions.cs:10-23` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs:21-30`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs:20-28`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ServiceCollectionExtensions.cs:10-23` | **Description** @@ -426,7 +426,7 @@ three services still share one connection/lock. Regression tests | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:92-95` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:92-95` | **Description** @@ -463,7 +463,7 @@ Regression test `LogEventAsync_FaultsTask_AndCountsFailure_OnWriteError`. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/ISiteEventLogger.cs:8-10`, `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:57` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ISiteEventLogger.cs:8-10`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:57` | **Description** @@ -510,7 +510,7 @@ tests `LogEventAsync_DoesNotBlockCaller_WhenWriteIsSlow` and | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.SiteEventLogging.Tests/` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/` | **Description** @@ -558,7 +558,7 @@ SiteEventLogging-001/-002/-003 were resolved | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/ServiceCollectionExtensions.cs:18-22` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ServiceCollectionExtensions.cs:18-22` | **Description** @@ -579,7 +579,7 @@ the misleading comment. Resolved 2026-05-16 (commit `pending`): confirmed dead code — a repo-wide search found zero callers of `AddSiteEventLoggingActors`, and `EventLogHandlerActor` is in -fact wired up directly in `ScadaLink.Host/Actors/AkkaHostedService.cs` as a cluster +fact wired up directly in `ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs` as a cluster singleton (it must be created inside the `ActorSystem` with a resolved `IEventLogQueryService`, which a `IServiceCollection` extension cannot do). The empty placeholder method and its stale "Phase 4+" comment were deleted, and a short @@ -595,7 +595,7 @@ full module suite still passing. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:160-166,193-197` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:160-166,193-197` | **Description** @@ -652,7 +652,7 @@ silent-success behaviour and was replaced). | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogQueryService.cs:79-83` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs:79-83` | **Description** @@ -693,7 +693,7 @@ keyword is matched as a literal substring as the design intends. Regression test | Severity | Low | | Category | Performance & resource management | | Status | Won't Fix | -| Location | `src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs:34-48` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs:34-48` | **Description** @@ -754,7 +754,7 @@ background scheduler). | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:58-63` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:58-63` | **Resolution (2026-05-28):** Switched `SiteEventLogger._writeQueue` to `Channel.CreateBounded` with `FullMode = BoundedChannelFullMode.DropOldest`. @@ -777,7 +777,7 @@ from an alarm storm / script failure loop — drives the queue arbitrarily large Every queued `PendingEvent` retains its `TaskCompletionSource` and its payload strings, so there is no upper bound on how much memory the recorder can hold. -The sister centralized-audit component `ScadaLink.AuditLog/Site/SqliteAuditWriter.cs` +The sister centralized-audit component `ZB.MOM.WW.ScadaBridge.AuditLog/Site/SqliteAuditWriter.cs` addresses the same hot-path-writer problem with `Channel.CreateBounded<...>(new BoundedChannelOptions(_options.ChannelCapacity) { ..., FullMode = BoundedChannelFullMode.Wait })`, giving back-pressure to producers. Site event logging picked the riskier choice for @@ -803,7 +803,7 @@ chosen policy on `ISiteEventLogger.LogEventAsync`. | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogQueryService.cs:67-77`, `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:159`, `src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs:72-78` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs:67-77`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:159`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs:72-78` | **Resolution** — `EventLogQueryService.ExecuteQuery` now calls `.ToUniversalTime()` on `request.From`/`request.To` before `ToString("o")`, so the produced ISO 8601 string always ends in `+00:00` and lexicographically matches the UTC timestamps written by `SiteEventLogger`. `EventLogPurgeService.PurgeByRetention` was also made defensive with an explicit `.ToUniversalTime()` on the cutoff. A regression test (`Query_FiltersByTimeRange_HandlesNonUtcOffset`) constructs a `+05:00` `DateTimeOffset` and asserts the matching UTC-stored events are returned and out-of-range ones are excluded. @@ -854,7 +854,7 @@ lexicographic-comparison hazard structurally. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogQueryService.cs:55`, `src/ScadaLink.Commons/Messages/RemoteQuery/EventLogQueryRequest.cs:18` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs:55`, `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/RemoteQuery/EventLogQueryRequest.cs:18` | **Resolution (2026-05-28):** `EventLogQueryService.ExecuteQuery` now clamps `pageSize` to new `SiteEventLogOptions.MaxQueryPageSize` (default 500, matching @@ -902,9 +902,9 @@ refused. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:67-71,225-226` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:67-71,225-226` | -**Resolution (2026-05-28):** Took option (a)-via-(b) from the recommendation. Softened the `SiteEventLogger.FailedWriteCount` XML doc to describe the actual state ("Available for future Health Monitoring integration — the counter is correct and observable, but the central health-metric pipeline does not yet poll it"), removing the misleading "Health Monitoring can detect a logging outage" claim. The Health Monitoring wiring is left as a tracked follow-up (it requires a `ScadaLink.HealthMonitoring` source change that belongs in a different batch). Promoted `FailedWriteCount { get; }` onto `ISiteEventLogger` so the eventual Health consumer reads it through the interface without a concrete-type downcast. No behaviour change — pure documentation + interface-surface tidy-up; `SiteEventLogger` already exposed the property publicly, and no test fakes/mocks of `ISiteEventLogger` exist in the repo (grep confirms only `SiteEventLogger` implements it), so the interface addition is non-breaking. Existing 59 SiteEventLogging tests remain green. +**Resolution (2026-05-28):** Took option (a)-via-(b) from the recommendation. Softened the `SiteEventLogger.FailedWriteCount` XML doc to describe the actual state ("Available for future Health Monitoring integration — the counter is correct and observable, but the central health-metric pipeline does not yet poll it"), removing the misleading "Health Monitoring can detect a logging outage" claim. The Health Monitoring wiring is left as a tracked follow-up (it requires a `ZB.MOM.WW.ScadaBridge.HealthMonitoring` source change that belongs in a different batch). Promoted `FailedWriteCount { get; }` onto `ISiteEventLogger` so the eventual Health consumer reads it through the interface without a concrete-type downcast. No behaviour change — pure documentation + interface-surface tidy-up; `SiteEventLogger` already exposed the property publicly, and no test fakes/mocks of `ISiteEventLogger` exist in the repo (grep confirms only `SiteEventLogger` implements it), so the interface addition is non-breaking. Existing 59 SiteEventLogging tests remain green. **Description** @@ -913,7 +913,7 @@ XML doc statement "Surfaced so Health Monitoring can detect a logging outage instead of relying on a local log line nobody is watching." The implementation is correct (`Interlocked.Increment` on write failure, `Interlocked.Read` getter), but a repo-wide search shows **no** caller anywhere in `src/` reads the property — -neither `ScadaLink.HealthMonitoring`, the central health collector, nor the host's +neither `ZB.MOM.WW.ScadaBridge.HealthMonitoring`, the central health collector, nor the host's `/health` endpoint. The metric is dead-letter: a logging outage still goes unnoticed in production, contradicting the original finding's resolution claim. @@ -938,7 +938,7 @@ file a tracking item for the wiring. The current doc claim is misleading. | Severity | Low | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs:57-95`, `src/ScadaLink.SiteEventLogging/ServiceCollectionExtensions.cs:30-39`, `docs/requirements/Component-SiteEventLogging.md:45` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs:57-95`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ServiceCollectionExtensions.cs:30-39`, `docs/requirements/Component-SiteEventLogging.md:45` | **Description** @@ -989,7 +989,7 @@ SiteEventLogging.Tests). | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:144-156`, `src/ScadaLink.SiteEventLogging/ISiteEventLogger.cs:14-15` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:144-156`, `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ISiteEventLogger.cs:14-15` | **Resolution (2026-05-28):** `LogEventAsync` now validates `severity` against the closed set `{Info, Warning, Error}` (case-sensitive, matches SQLite @@ -1033,7 +1033,7 @@ case-insensitive. Update the XML doc to match the enforced contract. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/EventLogQueryService.cs:138` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs:138` | **Resolution (2026-05-28):** `EventLogQueryService.ExecuteQuery` now parses the stored ISO 8601 timestamp with `CultureInfo.InvariantCulture` plus @@ -1077,14 +1077,14 @@ avoid all string-parsing. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteEventLogging/SiteEventLogger.cs:52` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs:52` | **Resolution (2026-05-28):** Dropped `Cache=Shared` from the default connection string in `SiteEventLogger`'s ctor — the logger owns exactly one `SqliteConnection` serialised under `_writeLock`, so the cross-connection shared-cache mode is dormant. The `connectionStringOverride` ctor parameter still lets a test path inject `Cache=Shared` explicitly when needed. No test -relied on the default option (grep across `tests/ScadaLink.SiteEventLogging.Tests` +relied on the default option (grep across `tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests` finds zero references). Behaviour unchanged for production callers. **Description** @@ -1118,7 +1118,7 @@ and locking_mode review that should accompany it. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs:282-308` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs:282-308` | **Resolution (2026-05-28):** Promoted the test-local `bool stop` to a `volatile bool _stop` field on `EventLogPurgeServiceTests` (with a doc-comment cross-referencing this finding). Every writer thread now observes the main thread's `_stop = true` flip without relying on JIT/runtime quirks across the `await _eventLogger.LogEventAsync` boundary, so the regression test for SiteEventLogging-003 can no longer hang past xUnit's per-test timeout in release builds. `CancellationTokenSource` was considered (canonical pattern) but `volatile bool` is the minimal-diff fix consistent with the existing structure. diff --git a/code-reviews/SiteRuntime/findings.md b/code-reviews/SiteRuntime/findings.md index 03985fdf..78087f94 100644 --- a/code-reviews/SiteRuntime/findings.md +++ b/code-reviews/SiteRuntime/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.SiteRuntime` | +| Module | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime` | | Design doc | `docs/requirements/Component-SiteRuntime.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -31,7 +31,7 @@ actor, and the repositories are untested. #### Re-review 2026-05-17 (commit `39d737e`) The module was re-reviewed at commit `39d737e`. No source under -`src/ScadaLink.SiteRuntime` has changed since the previous review at `9c60592` +`src/ZB.MOM.WW.ScadaBridge.SiteRuntime` has changed since the previous review at `9c60592` (the only intervening commits are code-review documentation updates), so all of SiteRuntime-001..013, 015, 016 remain Resolved and SiteRuntime-014 remains Deferred — its Deferred justification (a trigger-evaluation concurrency design @@ -116,7 +116,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Scripts/ScriptRuntimeContext.cs:106`, `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:204` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs:106`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:204` | **Description** @@ -165,7 +165,7 @@ synchronously. | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs:632` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs:632` | **Description** @@ -202,7 +202,7 @@ optimistic `true`. | Severity | High | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs:222` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs:222` | **Description** @@ -243,7 +243,7 @@ longer drifts (this additionally addresses the root cause behind SiteRuntime-004 | Severity | Medium — re-triaged: already fixed by the SiteRuntime-003 resolution. | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs` (`ApplyDeployment`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs` (`ApplyDeployment`) | **Description** @@ -283,7 +283,7 @@ Resolved. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs` (`ApplyDeployment`, `HandleDeployPersistenceResult`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs` (`ApplyDeployment`, `HandleDeployPersistenceResult`) | **Description** @@ -322,7 +322,7 @@ and `Deploy_Success_ReportsSuccessAndPersistsConfig`. | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Repositories/SiteExternalSystemRepository.cs`, `src/ScadaLink.SiteRuntime/Repositories/SiteNotificationRepository.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteExternalSystemRepository.cs`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteNotificationRepository.cs` | **Description** @@ -362,7 +362,7 @@ the repository's connection path end-to-end. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Repositories/SiteExternalSystemRepository.cs`, `src/ScadaLink.SiteRuntime/Repositories/SiteNotificationRepository.cs`, `src/ScadaLink.SiteRuntime/Repositories/SyntheticId.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteExternalSystemRepository.cs`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteNotificationRepository.cs`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SyntheticId.cs` | **Description** @@ -404,7 +404,7 @@ simulate a process restart and confirm by-ID lookups still resolve. | Severity | Medium | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs` (`HandleStartupConfigsLoaded`, `LoadSharedScriptsFromStorage`, `HandleSharedScriptsLoaded`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs` (`HandleStartupConfigsLoaded`, `LoadSharedScriptsFromStorage`, `HandleSharedScriptsLoaded`) | **Description** @@ -448,7 +448,7 @@ present). | Severity | Medium | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/ScriptExecutionActor.cs`, `src/ScadaLink.SiteRuntime/Actors/AlarmExecutionActor.cs`, `src/ScadaLink.SiteRuntime/Scripts/ScriptExecutionScheduler.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptExecutionActor.cs`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmExecutionActor.cs`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptExecutionScheduler.cs` | **Description** @@ -492,7 +492,7 @@ dedicated dispatcher" comments were removed. Regression tests: | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs` (`EnsureDclConnections`, `ComputeConnectionConfigHash`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs` (`EnsureDclConnections`, `ComputeConnectionConfigHash`) | **Description** @@ -531,7 +531,7 @@ and `EnsureDclConnections_UnchangedConfig_DoesNotReissueCreateCommand`. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Scripts/ScriptCompilationService.cs` (`ValidateTrustModel`) | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptCompilationService.cs` (`ValidateTrustModel`) | **Description** @@ -586,7 +586,7 @@ literal/identifier non-detection, allowed-exception resolution); all 39 existing | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Scripts/ScopeAccessors.cs:28` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScopeAccessors.cs:28` | **Description** @@ -627,7 +627,7 @@ variants. No behavioural change — this is a documentation finding; existing | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:414` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:414` | **Description** @@ -668,7 +668,7 @@ behaviour to regression-test, so no new test was added; the existing | Severity | Low | | Category | Akka.NET conventions | | Status | Deferred | -| Location | `src/ScadaLink.SiteRuntime/Actors/ScriptActor.cs:219`, `src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs:389` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptActor.cs:219`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs:389` | **Description** @@ -719,7 +719,7 @@ an out-of-scope or messaging-contract-changing fix. | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs:746` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs:746` | **Description** @@ -759,7 +759,7 @@ pass after the fix. | Severity | Low | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.SiteRuntime.Tests/` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/` | **Description** @@ -805,7 +805,7 @@ green. | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:625`, `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:675`, `src/ScadaLink.SiteRuntime/Actors/ScriptActor.cs:83`, `src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs:93` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:625`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:675`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptActor.cs:83`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs:93` | **Description** @@ -866,7 +866,7 @@ test project). | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/ScriptExecutionActor.cs:17` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptExecutionActor.cs:17` | **Description** @@ -907,7 +907,7 @@ regression test was added; the existing suite continues to pass. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:106`, `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:113` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:106`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:113` | **Description** @@ -955,7 +955,7 @@ Instance Actor produces no `InstanceLifecycleResponse` for either command | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs:285`, `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs:971` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs:285`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs:971` | **Resolution** — added a name → terminating-actor-ref shadow (`_terminatingActorsByName`) populated when `HandleDeploy` stops the @@ -1039,7 +1039,7 @@ be gated on "no instance with this name is currently terminating". | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs:931` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs:931` | **Resolution (2026-05-28):** Took the "refactor `EnsureDclConnections` into a shared field-based helper" path. Extracted a new `EnsureDclConnection(name, protocol, primaryJson, backupJson, failoverRetryCount)` method that owns the hash-cache check and the `CreateConnectionCommand` Tell — both the existing inline `EnsureDclConnections(configJson)` and the new artifact path now drive through it. `ComputeConnectionConfigHash` got a field-based overload so the artifact path (which carries data directly on `DataConnectionArtifact`) reuses the same hash logic as the `ConnectionConfig`-based inline path. To keep `_createdConnections` mutation actor-thread-confined (the artifact-deploy persistence runs inside a `Task.Run`), the off-thread persistence dispatches a new internal `ApplyArtifactDataConnectionsToDcl` message back to `Self` after the SQLite writes; the actor-thread handler then iterates and invokes `EnsureDclConnection`. The DCL only sees `CreateConnectionCommand` (no `Update`/`Delete` messages exist in the codebase, and `CreateConnectionCommand` is treated as upsert-by-name — same shape as the inline-config path). Build clean; 302 SiteRuntime tests green (the existing `EnsureDclConnections_ConnectionConfigChanged_ReissuesCreateCommand` regression test still passes through the refactored shared helper). @@ -1091,7 +1091,7 @@ and artifact paths can drive through it. | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Scripts/AuditingDbCommand.cs:138` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbCommand.cs:138` | **Resolution (2026-05-28):** Took the recommended "expose a proper API surface" path (the SiteRuntime-006 precedent). Added an `internal DbConnection Inner => _inner;` accessor to `AuditingDbConnection`; both classes are `internal sealed` in the same assembly, so the accessor stays out of the public API. The `AuditingDbCommand.DbConnection` setter now unwraps an `AuditingDbConnection` via `auditing.Inner` instead of `Type.GetField("_inner", BindingFlags.NonPublic | BindingFlags.Instance)!.GetValue(...)`. No reflection, no `!.` null-forgiveness hiding a runtime crash, no static-analyzer/IL-trim noise — and the same module that enforces "no `System.Reflection` in scripts" no longer reflects internally. The getter's `_wrappingConnection ?? _inner.Connection` fallback was left as-is; addressing the `CreateDbCommand()` round-trip concern is a separate behavioural decision (the finding marked it secondary). Build clean; 302 SiteRuntime tests green. @@ -1154,7 +1154,7 @@ the parent connection inside `AuditingDbConnection.CreateDbCommand`). | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/ScriptActor.cs:446`, `src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs:340`, `src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs:356`, `src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs:444` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptActor.cs:446`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs:340`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs:356`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs:444` | **Resolution (2026-05-28):** All four call sites (`ScriptActor.EvaluateCondition`, `AlarmActor.EvaluateRangeViolation`, @@ -1209,7 +1209,7 @@ on the host's regional settings. | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Tracking/OperationTrackingStore.cs:39`, `src/ScadaLink.SiteRuntime/Tracking/OperationTrackingStore.cs:360` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingStore.cs:39`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingStore.cs:360` | **Resolution** — split reads from writes: the single owned `_writeConnection` + `_writeGate` still serialises writers, but @@ -1270,7 +1270,7 @@ into a sync path that calls `_connection.Dispose()` directly. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:223`, `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs:246` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:223`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs:246` | **Resolution (2026-05-28):** `HandleSetStaticAttribute` now rejects writes whose `command.AttributeName` does not resolve against @@ -1334,7 +1334,7 @@ failure response). | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:10`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:13`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:15`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:17`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:19`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:25`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:28`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:30`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:32`, `src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs:34` | +| Location | `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:10`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:13`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:15`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:17`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:19`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:25`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:28`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:30`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:32`, `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs:34` | **Description** @@ -1355,7 +1355,7 @@ relied on by the `fixdocs` workflow will flag every record as missing docs. Add a `` per record naming the direction (outbound → peer / inbound from peer) and what the operation replicates, and `` docs for each record parameter. Mirror the precedent in -`src/ScadaLink.Commons/Messages/.../*.cs`. While there, consider sealing the +`src/ZB.MOM.WW.ScadaBridge.Commons/Messages/.../*.cs`. While there, consider sealing the inbound vs outbound split with a marker base type (currently they're just named conventionally) so `Receive` vs `Receive` is expressed at the type level — but that's optional and out of scope for a diff --git a/code-reviews/StoreAndForward/findings.md b/code-reviews/StoreAndForward/findings.md index 916840b1..53728126 100644 --- a/code-reviews/StoreAndForward/findings.md +++ b/code-reviews/StoreAndForward/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.StoreAndForward` | +| Module | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward` | | Design doc | `docs/requirements/Component-StoreAndForward.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -89,7 +89,7 @@ concurrent discard / sweep delete), re-introducing the StoreAndForward-016 stand divergence in that corner. `StoreAndForward-021` (Medium) is a design-doc-vs-code drift that should be reconciled in the doc: the **operation tracking table** is documented inside Component-StoreAndForward.md as a S&F responsibility (lines 21, 49, 77–87, 108, -114), but the actual `OperationTrackingStore` lives in `src/ScadaLink.SiteRuntime/ +114), but the actual `OperationTrackingStore` lives in `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ Tracking/` and is not consumed by S&F at all — the brief's own note flags this. The design doc should be updated to point at SiteRuntime, or the store moved to StoreAndForward. @@ -122,7 +122,7 @@ shutdown sequence (the DI container) can then NRE through the still-running swee | 6 | Performance & resource management | ☑ | No new findings — the connection-per-call documented trade-off and pooled `OpenAsync` remain acceptable. | | 7 | Design-document adherence | ☑ | Operation Tracking Table documented in StoreAndForward but actually lives in SiteRuntime (021); notification non-parking guarantee broken by 018 + 019. | | 8 | Code organization & conventions | ☑ | `IStoreAndForwardSiteContext` silently defaults `SiteId` to empty (023) — a configuration hole rather than an entity placement issue. | -| 9 | Testing coverage | ☑ | The seven new findings have no regression tests in `tests/ScadaLink.StoreAndForward.Tests/` — particularly the notification-doesn't-park invariant (018, 019), the requeue-after-reload-null replication gap (020), and the stop-during-sweep behaviour (024). | +| 9 | Testing coverage | ☑ | The seven new findings have no regression tests in `tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/` — particularly the notification-doesn't-park invariant (018, 019), the requeue-after-reload-null replication gap (020), and the stop-during-sweep behaviour (024). | | 10 | Documentation & comments | ☑ | `CachedCallAttemptOutcome.ParkedMaxRetries` XML doc says "S&F semantics" but the code applies it to notifications too if 018/019 fire — minor drift, captured under 018. The `TrackedOperationId.TryParse` silent-skip behaviour in `NotifyCachedCallObserverAsync` is documented in the source but not on the public observer contract (022). | ## Checklist coverage @@ -149,7 +149,7 @@ shutdown sequence (the DI container) can then NRE through the still-running swee | Severity | Critical | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/ReplicationService.cs:40`, `:53`, `:66`; `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:155`, `:212`, `:222`, `:236` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ReplicationService.cs:40`, `:53`, `:66`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:155`, `:212`, `:222`, `:236` | **Description** @@ -193,7 +193,7 @@ commit whose message references `StoreAndForward-001`. | Original severity | High (re-triaged down to Low on 2026-05-16 — see Re-triage note) | | Category | Error handling & resilience | | Status | Deferred | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:162`, `:201` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:162`, `:201` | **Description** @@ -221,7 +221,7 @@ transient condition with bounded logging rather than a permanent no-op. The finding's central factual claim — *"No caller in the codebase ever calls `RegisterDeliveryHandler`"* and therefore *"every buffered message lands in this dead -state"* — is **no longer true at the reviewed code**. `ScadaLink.Host` +state"* — is **no longer true at the reviewed code**. `ZB.MOM.WW.ScadaBridge.Host` (`AkkaHostedService.RegisterSiteActors`, `AkkaHostedService.cs:353-379`) registers all three delivery handlers (`ExternalSystem`, `CachedDbWrite`, `Notification`) at site startup, immediately after `StoreAndForwardService.StartAsync()`. The finding was @@ -249,7 +249,7 @@ should be made deliberately rather than forced here. _Deferred 2026-05-16 (re-triaged High → Low). Verified again against the source in this pass: the finding's premise (no `RegisterDeliveryHandler` caller anywhere) is stale — -`ScadaLink.Host` wires all three handlers at site startup — so the High-severity +`ZB.MOM.WW.ScadaBridge.Host` wires all three handlers at site startup — so the High-severity "engine cannot deliver anything" outcome no longer occurs. The residual gap (a message enqueued for a category that genuinely has no handler is buffered then skipped forever) is real but minor. The prescribed fix — making `EnqueueAsync` reject when no handler is @@ -266,7 +266,7 @@ pending that decision rather than forced here._ | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:153`, `:229`, `:233` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:153`, `:229`, `:233` | **Description** @@ -316,7 +316,7 @@ corrected semantics. | Severity | Medium | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:38`, `:60` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:38`, `:60` | **Description** @@ -355,7 +355,7 @@ Documentation-only change — no behavioural code touched, so no regression test | Original severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:184`, `:266`, `:280` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:184`, `:266`, `:280` | **Description** @@ -423,7 +423,7 @@ other writer's `RetryCount`). | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs:166`, `:175` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs:166`, `:175` | **Description** @@ -466,7 +466,7 @@ finding's recommendation. | Severity | Low | | Category | Akka.NET conventions | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/ParkedMessageHandlerActor.cs:34`, `:68`, `:87` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ParkedMessageHandlerActor.cs:34`, `:68`, `:87` | **Description** @@ -511,7 +511,7 @@ is a concrete non-virtual type with no failure-injection seam. | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs:28`, `:61`, `:93`, `:117`, `:144`, `:162`, `:199`, `:221`, `:237`, `:267`, `:285`, `:305`, `:319` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs:28`, `:61`, `:93`, `:117`, `:144`, `:162`, `:199`, `:221`, `:237`, `:267`, `:285`, `:305`, `:319` | **Description** @@ -550,7 +550,7 @@ touched, so no regression test (the connection-pool reliance is not test-observa | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:46`, `:309` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:46`, `:309` | **Description** @@ -596,7 +596,7 @@ with `WasBuffered == false` and an empty buffer) and | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs:203`, `:101` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs:203`, `:101` | **Description** @@ -637,7 +637,7 @@ cleared, message excluded from the retry-due set) and passes post-fix. | Severity | Low | | Category | Design-document adherence | | Status | Deferred | -| Location | `src/ScadaLink.Commons/Types/Enums/StoreAndForwardMessageStatus.cs:9`; `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:219`, `:235` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Commons/Types/Enums/StoreAndForwardMessageStatus.cs:9`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:219`, `:235` | **Description** @@ -663,8 +663,8 @@ StoreAndForward module only ever assigns `Pending` and `Parked`, and `InFlight` `Delivered` are never assigned anywhere (delivered messages are deleted, not marked). The design doc's `retrying` state is unmodelled. Both options the recommendation offers — (a) drop the unused `InFlight`/`Delivered` members, or (b) add a `Retrying` member — -require editing `StoreAndForwardMessageStatus.cs`, which lives in `src/ScadaLink.Commons` -(outside this review's edit scope: only `src/ScadaLink.StoreAndForward/**` may be +require editing `StoreAndForwardMessageStatus.cs`, which lives in `src/ZB.MOM.WW.ScadaBridge.Commons` +(outside this review's edit scope: only `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/**` may be changed). The enum is also referenced by IntegrationTests and HealthMonitoring tests, so removing members is a cross-module change. The defect is real but cannot be resolved in-module; **Deferred** to a change that owns the Commons enum and the design doc @@ -677,7 +677,7 @@ together._ | Severity | Low | | Category | Code organization & conventions | | Status | Deferred | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardMessage.cs:9` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardMessage.cs:9` | **Description** @@ -706,8 +706,8 @@ mapping to `sf_messages` and is also carried across Akka remoting inside component assembly rather than the Commons `Entities`/`Messages` hierarchy. The recommendation's primary remedy — moving `StoreAndForwardMessage` (and `ReplicationOperation`) into Commons — crosses module boundaries (it would add a type to -`src/ScadaLink.Commons`, outside this review's edit scope of -`src/ScadaLink.StoreAndForward/**`, and change every referencing module). The alternative +`src/ZB.MOM.WW.ScadaBridge.Commons`, outside this review's edit scope of +`src/ZB.MOM.WW.ScadaBridge.StoreAndForward/**`, and change every referencing module). The alternative "separate replication DTO" still leaves the persistence entity in the component, so it does not actually resolve the finding's core concern (entity placement / contract- evolution governance). Resolving this is a deliberate code-organisation decision that @@ -721,7 +721,7 @@ cross-module follow-up._ | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.StoreAndForward.Tests/` (whole directory); `src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs:101`; `src/ScadaLink.StoreAndForward/ParkedMessageHandlerActor.cs` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/` (whole directory); `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs:101`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ParkedMessageHandlerActor.cs` | **Description** @@ -768,7 +768,7 @@ These are coverage-gap tests over already-correct code, so they pass on first ru | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs:26` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs:26` | **Found 2026-05-16** while verifying the store-and-forward fixes — this defect was not part of the original baseline review. @@ -806,7 +806,7 @@ all six `SiteActorPathTests` now pass. Fixed by the commit whose message referen | Severity | Medium | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:114`–`:130`, `:285` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:114`–`:130`, `:285` | **Description** @@ -873,7 +873,7 @@ test-observable so no regression test was added. | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:339`–`:362`; `src/ScadaLink.StoreAndForward/ReplicationService.cs:131`–`:136` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:339`–`:362`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ReplicationService.cs:131`–`:136` | **Description** @@ -942,7 +942,7 @@ requeued row and calls `_replication?.ReplicateRequeue`, and the standby's | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:344`, `:358` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:344`, `:358` | **Description** @@ -992,7 +992,7 @@ the StoreAndForward-016 replication) — and pass it to `RaiseActivity` (falling | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/NotificationForwarder.cs:62`–`:69`, `:105`–`:122`; `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:369`–`:397` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/NotificationForwarder.cs:62`–`:69`, `:105`–`:122`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:369`–`:397` | **Resolution** — `NotificationForwarder.DeliverAsync` now discards a corrupt buffered payload instead of returning false. The corrupt path logs a Warning @@ -1053,7 +1053,7 @@ parking exception specifically for notifications, and revise the resolved StoreAndForward-017 wording; (b) treat `JsonException` as transient (would retry-forever on a corrupt payload — bad); (c) introduce a per-category park-allowed flag on the engine and gate the retry-path park behind it for the Notification category. -Add a regression test in `tests/ScadaLink.StoreAndForward.Tests/NotificationForwarderTests. +Add a regression test in `tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/NotificationForwarderTests. cs` asserting that a corrupt-payload notification reaches a terminal **non-Parked** state — today the corrupt-payload behaviour is uncovered. @@ -1068,7 +1068,7 @@ _Unresolved._ | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:229`, `:407`–`:437`; `src/ScadaLink.StoreAndForward/StoreAndForwardOptions.cs:18`; `src/ScadaLink.SiteRuntime/Scripts/ScriptRuntimeContext.cs:1773`–`:1778`; `src/ScadaLink.NotificationService/NotificationDeliveryService.cs:149`–`:156` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:229`, `:407`–`:437`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardOptions.cs:18`; `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs:1773`–`:1778`; `src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationDeliveryService.cs:149`–`:156` | **Description** @@ -1112,7 +1112,7 @@ parking violation under the engine's normal max-retries policy. Make the notification enqueue paths pass `maxRetries: 0` so the documented "no limit / never parked" semantics apply, and guard against regression by adding an integration -test in `tests/ScadaLink.StoreAndForward.Tests/NotificationForwarderTests.cs` that runs +test in `tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/NotificationForwarderTests.cs` that runs a sweep many more times than `DefaultMaxRetries` against an always-failing handler and asserts the buffered notification's status stays `Pending` (not `Parked`). A cleaner alternative is to special-case the `Notification` category inside @@ -1135,7 +1135,7 @@ applies uniformly (including to notifications) and that `maxRetries: 0` is the e escape hatch for callers that need unbounded retry. Added a `StoreAndForward-019` block to `StoreAndForwardOptions.DefaultMaxRetries`'s XML doc explaining the same invariant. No behavioural code change — existing tests (104 in -`ScadaLink.StoreAndForward.Tests`) continue to pass. +`ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests`) continue to pass. ### StoreAndForward-020 — `RetryParkedMessageAsync` skips standby replication when the message is deleted between local update and re-load @@ -1144,7 +1144,7 @@ No behavioural code change — existing tests (104 in | Severity | Medium | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:599`–`:616` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:599`–`:616` | **Description** @@ -1239,7 +1239,7 @@ the activity log uses the captured `Category` directly. | Severity | Medium | | Category | Design-document adherence | | Status | Resolved | -| Location | `docs/requirements/Component-StoreAndForward.md:21`, `:49`–`:51`, `:77`–`:87`, `:108`, `:114`; `src/ScadaLink.SiteRuntime/Tracking/OperationTrackingStore.cs:37`; `src/ScadaLink.StoreAndForward/` (whole module) | +| Location | `docs/requirements/Component-StoreAndForward.md:21`, `:49`–`:51`, `:77`–`:87`, `:108`, `:114`; `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingStore.cs:37`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/` (whole module) | **Description** @@ -1257,12 +1257,12 @@ this component: each site node holds a **site-local operation tracking table** in SQLite. … Each row records the operation kind (`TrackedOperationKind`) …" -The actual implementation lives outside this module: `src/ScadaLink.SiteRuntime/ +The actual implementation lives outside this module: `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ Tracking/OperationTrackingStore.cs` (and `IOperationTrackingStore`, `OperationTrackingOptions`). The StoreAndForward project contains no references to the tracking store, owns no `operation_tracking` table, and `StoreAndForwardService.NotifyCachedCallObserverAsync` is only a hook handing telemetry context to an `ICachedCallLifecycleObserver` — the -audit bridge wired in `ScadaLink.AuditLog`. The S&F module is **not** the table's +audit bridge wired in `ZB.MOM.WW.ScadaBridge.AuditLog`. The S&F module is **not** the table's owner; SiteRuntime is. This is a real design-doc drift, not a code defect, and is flagged explicitly in the @@ -1271,7 +1271,7 @@ discussion of the lifecycle — "immediate success writes a terminal Delivered t row directly here", "operator discard sets terminal `Discarded`", "central never mutates the mirror row directly" — places coordination responsibilities on the wrong component. A reader looking for the source of truth for `Tracking.Status(id)` would -read `Component-StoreAndForward.md` and search `src/ScadaLink.StoreAndForward/` in +read `Component-StoreAndForward.md` and search `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/` in vain. The doc also lists Site Call Audit / Audit Log telemetry-emission as a S&F responsibility (line 22), but the emission actually happens via the `AuditLog` site component subscribing to `ICachedCallLifecycleObserver`. @@ -1313,7 +1313,7 @@ not owned here. | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:484`–`:515` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:484`–`:515` | **Description** @@ -1332,7 +1332,7 @@ TrackedOperationId threaded in)", but the documented contract is broken in two w so a misconfigured caller bypasses the audit hot path with zero feedback. 2. **The contract is hidden in field-level XML.** The `ICachedCallLifecycleObserver` - public interface contract (defined in `ScadaLink.Commons`) does not document that + public interface contract (defined in `ZB.MOM.WW.ScadaBridge.Commons`) does not document that the observer will be silently skipped when the underlying S&F message id is not a GUID. A consumer reading the interface contract reasonably expects every cached-call attempt to surface — the audit pipeline depends on it. The silent-drop is an @@ -1377,7 +1377,7 @@ is on `_observer.Notifications` being empty, which is unchanged. | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/ServiceCollectionExtensions.cs:43`–`:53`; `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:99`, `:524` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ServiceCollectionExtensions.cs:43`–`:53`; `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:99`, `:524` | **Description** @@ -1436,7 +1436,7 @@ normalisation is a no-op there. | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.StoreAndForward/StoreAndForwardService.cs:122`–`:127`, `:136`–`:143`, `:303`–`:329` | +| Location | `src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs:122`–`:127`, `:136`–`:143`, `:303`–`:329` | **Resolution (2026-05-28):** the timer callback now captures the sweep task into a `_sweepTask` field via `Volatile.Write`, and `StopAsync` disposes the diff --git a/code-reviews/TemplateEngine/findings.md b/code-reviews/TemplateEngine/findings.md index 751cf176..786f36b4 100644 --- a/code-reviews/TemplateEngine/findings.md +++ b/code-reviews/TemplateEngine/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.TemplateEngine` | +| Module | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine` | | Design doc | `docs/requirements/Component-TemplateEngine.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -128,7 +128,7 @@ _Re-review (2026-05-28, `1eb6e97`):_ | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs:211`, `src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs:535`, `src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs:609` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs:211`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs:535`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs:609` | **Description** @@ -167,7 +167,7 @@ Regression tests: `Flatten_ThreeLevelComposition_AttributesAlarmsScriptsAllResol | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateService.cs:799` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:799` | **Description** @@ -195,7 +195,7 @@ Resolved 2026-05-16 (commit ``): implemented the per-slot alarm override mechanism as a coordinated `Commons` + `ConfigurationDatabase` + `TemplateEngine` change, mirroring the existing attribute/script override design. Added `IsInherited` / `LockedInDerived` to the `TemplateAlarm` POCO -(`ScadaLink.Commons`) and an EF migration `AddDerivedAlarmFields` adding two +(`ZB.MOM.WW.ScadaBridge.Commons`) and an EF migration `AddDerivedAlarmFields` adding two `bit NOT NULL DEFAULT 0` columns to `TemplateAlarms`. `BuildDerivedTemplate` now copies base alarms as `IsInherited = true` placeholder rows. `FlatteningService.ResolveInheritedAlarms` skips `IsInherited` placeholder @@ -218,7 +218,7 @@ now rejects a derived override of a `LockedInDerived` base alarm. | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateService.cs:285` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:285` | **Description** @@ -260,7 +260,7 @@ tests: `UpdateAttribute_UnlockedAttribute_DataTypeChangeRejected`, | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs:695` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs:695` | **Description** @@ -300,7 +300,7 @@ all see the reference. Regression tests: | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateService.cs:56` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:56` | **Description** @@ -339,7 +339,7 @@ Regression test: `CreateTemplate_WithParent_DoesNotRunDeadCollisionQuery`. | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Validation/ScriptCompiler.cs:21`, `src/ScadaLink.TemplateEngine/Validation/ValidationService.cs:318` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ScriptCompiler.cs:21`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ValidationService.cs:318` | **Description** @@ -386,7 +386,7 @@ doc, and the scan is explicitly labelled advisory. Regression tests: | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Validation/ScriptCompiler.cs:54`, `src/ScadaLink.TemplateEngine/SharedScriptService.cs:124` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ScriptCompiler.cs:54`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/SharedScriptService.cs:124` | **Description** @@ -429,7 +429,7 @@ genuine mismatches are still caught. Regression tests in `ScriptCompilerTests` | Severity | Medium | | Category | Error handling & resilience | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Services/InstanceService.cs:178` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/InstanceService.cs:178` | **Description** @@ -468,7 +468,7 @@ lock-bypass. Regression tests: `SetAlarmOverride_NonExistentAlarm_ReturnsFailure | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Services/TemplateDeletionService.cs:75` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateDeletionService.cs:75` | **Description** @@ -506,7 +506,7 @@ the `Compositions` navigation, matching how EF's `GetAllTemplatesAsync` loads it | Severity | Low — re-triaged from Medium: this is a stale XML comment, not a behavioural defect. The code matches the design (last-write-wins); only the doc string was wrong. | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Services/InstanceService.cs:9` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/InstanceService.cs:9` | **Description** @@ -550,7 +550,7 @@ behaviour change; no regression test (documentation-only). | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Flattening/RevisionHashService.cs:136` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/RevisionHashService.cs:136` | **Description** @@ -592,7 +592,7 @@ test gate instead of silently changing every revision hash. | Severity | Low | | Category | Design-document adherence | | Status | Deferred | -| Location | `src/ScadaLink.TemplateEngine/Validation/SemanticValidator.cs:18` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/SemanticValidator.cs:18` | **Description** @@ -612,13 +612,13 @@ or rename the enum to match the doc if "Integer" is the intended canonical name. **Re-triage** Verified against the source: the `DataType` enum is declared in -`src/ScadaLink.Commons/Types/Enums/DataType.cs` (`Boolean, Int32, Float, Double, +`src/ZB.MOM.WW.ScadaBridge.Commons/Types/Enums/DataType.cs` (`Boolean, Int32, Float, Double, String, DateTime, Binary`) — **not** in the TemplateEngine module — and is consumed across modules (`TemplateAttribute` entity, management command contracts). The only in-module file the finding cites, `SemanticValidator.cs:18`, is confirmed **correct**: `NumericDataTypes` already hard-codes the real enum names. Both remediation options in the recommendation therefore land **outside** this module's resolution boundary -(`src/ScadaLink.TemplateEngine/**`): renaming the enum touches `ScadaLink.Commons` +(`src/ZB.MOM.WW.ScadaBridge.TemplateEngine/**`): renaming the enum touches `ZB.MOM.WW.ScadaBridge.Commons` (and every consumer of `DataType`), and the alternative — updating the design doc — touches `docs/requirements/Component-TemplateEngine.md`. There is no in-module code defect to fix. Re-triaged from Open to Deferred: the fix is a one-line design-doc @@ -630,7 +630,7 @@ String") that must be made by an agent owning the docs / Commons scope. Deferred 2026-05-16 (no commit): no in-module fix possible — see Re-triage. The TemplateEngine code is correct as-is. FLAGGED for the docs owner: correct the Attribute data-type list in `docs/requirements/Component-TemplateEngine.md` to match -`ScadaLink.Commons` `DataType` (`Boolean, Int32, Float, Double, String, DateTime, +`ZB.MOM.WW.ScadaBridge.Commons` `DataType` (`Boolean, Int32, Float, Double, String, DateTime, Binary`). Renaming the enum is not recommended (cross-module churn for no behavioural gain); the doc is the authoritative thing to fix. @@ -641,7 +641,7 @@ gain); the doc is the authoritative thing to fix. | Severity | Low | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/CycleDetector.cs:30`, `src/ScadaLink.TemplateEngine/CycleDetector.cs:38` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CycleDetector.cs:30`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CycleDetector.cs:38` | **Description** @@ -688,7 +688,7 @@ are detected. Regression tests: | Severity | Low | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateService.cs:109`, `src/ScadaLink.TemplateEngine/Services/TemplateDeletionService.cs:27` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:109`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateDeletionService.cs:27` | **Description** @@ -731,7 +731,7 @@ verifies all three constraint categories are surfaced together. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateService.cs:680` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:680` | **Description** @@ -791,7 +791,7 @@ mutates. Regression tests: | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs:750` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs:750` | **Description** @@ -844,7 +844,7 @@ resolves against the real parent module. Regression test: | Severity | High | | Category | Design-document adherence | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Flattening/RevisionHashService.cs:128`, `src/ScadaLink.TemplateEngine/Flattening/RevisionHashService.cs:156`, `src/ScadaLink.TemplateEngine/Flattening/RevisionHashService.cs:42`, `src/ScadaLink.TemplateEngine/Flattening/DiffService.cs:110`, `src/ScadaLink.TemplateEngine/Flattening/DiffService.cs:118` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/RevisionHashService.cs:128`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/RevisionHashService.cs:156`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/RevisionHashService.cs:42`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/DiffService.cs:110`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/DiffService.cs:118` | **Resolution** — Added `Description` to `HashableAttribute` and `HashableAlarm` (placed alphabetically per the determinism contract) and introduced a `HashableConnection` projection plus a `SortedDictionary Connections` field on `HashableConfiguration` that captures protocol, primary/backup JSON, and failover retry count for every deployed connection. `DiffService.AttributesEqual` and `AlarmsEqual` now compare `Description`, and a new public `ConnectionsEqual` helper covers connection-endpoint drift so callers can detect the change in the same shape used by the other entity comparators. Regression tests `ComputeHash_AttributeDescriptionEdit_ChangesHash`, `ComputeHash_AlarmDescriptionEdit_ChangesHash`, `ComputeHash_ConnectionEndpointEdit_ChangesHash`, and `ConnectionsEqual_EndpointEdit_ReturnsFalse` lock the behaviour in. @@ -914,9 +914,9 @@ TemplateEngine-018. | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/Flattening/DiffService.cs:19` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/DiffService.cs:19` | -**Resolution (2026-05-28):** Added `DiffService.ComputeConnectionsDiff(oldConfig, newConfig)`, which mirrors the existing attribute/alarm/script `ComputeEntityDiff` shape over the `FlattenedConfiguration.Connections` map and emits `DiffEntry` Added / Removed / Changed entries keyed by connection name (delegating equality to the existing `ConnectionsEqual` helper). Kept the new diff as a parallel method on `DiffService` rather than extending `ConfigurationDiff` (which lives in `ScadaLink.Commons`, outside this fix's scope); the public-record extension and Central UI plumbing are a paired Commons follow-up. Regression tests: `ComputeConnectionsDiff_NewBindingAdded_ReportedAsAdded`, `ComputeConnectionsDiff_BindingCleared_ReportedAsRemoved`, `ComputeConnectionsDiff_EndpointEdit_ReportedAsChanged`, `ComputeConnectionsDiff_IdenticalConnections_NoEntries`. +**Resolution (2026-05-28):** Added `DiffService.ComputeConnectionsDiff(oldConfig, newConfig)`, which mirrors the existing attribute/alarm/script `ComputeEntityDiff` shape over the `FlattenedConfiguration.Connections` map and emits `DiffEntry` Added / Removed / Changed entries keyed by connection name (delegating equality to the existing `ConnectionsEqual` helper). Kept the new diff as a parallel method on `DiffService` rather than extending `ConfigurationDiff` (which lives in `ZB.MOM.WW.ScadaBridge.Commons`, outside this fix's scope); the public-record extension and Central UI plumbing are a paired Commons follow-up. Regression tests: `ComputeConnectionsDiff_NewBindingAdded_ReportedAsAdded`, `ComputeConnectionsDiff_BindingCleared_ReportedAsRemoved`, `ComputeConnectionsDiff_EndpointEdit_ReportedAsChanged`, `ComputeConnectionsDiff_IdenticalConnections_NoEntries`. **Description** @@ -957,7 +957,7 @@ _Unresolved._ | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateResolver.cs:117`, `src/ScadaLink.TemplateEngine/TemplateResolver.cs:123` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateResolver.cs:117`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateResolver.cs:123` | **Resolution (2026-05-28):** `BuildInheritanceChain` now walks the parent chain via the `int?` `ParentTemplateId` directly — only a missing (`null`) value means "no parent", so a real template Id of 0 walks the chain like any other node (matching the duplicate-tolerant `BuildLookup` and the TemplateEngine-013 `CycleDetector` fix). Regression tests: `BuildInheritanceChain_RealIdZero_IsTreatedAsParentReferenceNotAsNoParent`, `BuildInheritanceChain_ParentChainThroughIdZero_DoesNotTruncateChainAtZero`, and the end-to-end `ResolveAllMembers_TemplateWithRealIdZero_StillResolvesItsMembers`. @@ -1019,7 +1019,7 @@ _Unresolved._ | Severity | Medium | | Category | Code organization & conventions | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateService.cs:77`, `src/ScadaLink.TemplateEngine/TemplateService.cs:256`, `src/ScadaLink.TemplateEngine/TemplateService.cs:407`, `src/ScadaLink.TemplateEngine/TemplateService.cs:556`, `src/ScadaLink.TemplateEngine/TemplateService.cs:734`, `src/ScadaLink.TemplateEngine/SharedScriptService.cs:71` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:77`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:256`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:407`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:556`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:734`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/SharedScriptService.cs:71` | **Resolution (2026-05-28):** Every `Create*` path in `TemplateService` (`CreateTemplateAsync`, `AddAttributeAsync`, `AddAlarmAsync`, `AddScriptAsync`, `AddCompositionAsync`) and `SharedScriptService.CreateSharedScriptAsync` now follows the `InstanceService.CreateInstanceAsync` shape — save the entity first so EF Core populates the auto-generated key, then log the audit row with the real `entity.Id`, then save the audit row. `AddCompositionAsync` already saved the composition row inside `CreateCascadedCompositionAsync` before returning, so only its `LogAsync` call needed to switch from `"0"` to `composition.Id.ToString()`. Regression tests assert the captured audit `entityId` equals the post-save id (not `"0"`): `CreateTemplate_AuditRowCarriesRealTemplateIdNotLiteralZero`, `AddAttribute_AuditRowCarriesRealAttributeIdNotLiteralZero`, `AddAlarm_AuditRowCarriesRealAlarmIdNotLiteralZero`, `AddScript_AuditRowCarriesRealScriptIdNotLiteralZero`, and `CreateSharedScript_AuditRowCarriesRealScriptIdNotLiteralZero`. @@ -1074,7 +1074,7 @@ _Unresolved._ | Severity | Medium | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/TemplateService.cs:173` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:173` | **Description** @@ -1131,7 +1131,7 @@ template in a *different* folder is not a collision). | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `src/ScadaLink.TemplateEngine/LockEnforcer.cs:109`, `src/ScadaLink.TemplateEngine/TemplateService.cs:323`, `src/ScadaLink.TemplateEngine/TemplateService.cs:476`, `src/ScadaLink.TemplateEngine/TemplateService.cs:623` | +| Location | `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/LockEnforcer.cs:109`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:323`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:476`, `src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs:623` | **Description** diff --git a/code-reviews/Transport/findings.md b/code-reviews/Transport/findings.md index a96ad103..9a4ed67f 100644 --- a/code-reviews/Transport/findings.md +++ b/code-reviews/Transport/findings.md @@ -2,7 +2,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.Transport` | +| Module | `src/ZB.MOM.WW.ScadaBridge.Transport` | | Design doc | `docs/requirements/Component-Transport.md` | | Status | Reviewed | | Last reviewed | 2026-05-28 | @@ -54,7 +54,7 @@ entry-count / per-entry decompression cap). | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Import/BundleImporter.cs:844-851` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:844-851` | **Resolution** — Extended `ApplyTemplatesAsync`'s Overwrite branch with three new private diff-and-merge helpers (`SyncTemplateAttributesAsync`, @@ -101,7 +101,7 @@ template whose Scripts / Attributes / Alarms differ. | Severity | High | | Category | Correctness & logic bugs | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Import/BundleImporter.cs:1213-1221` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:1213-1221` | **Resolution** — Added a private `SyncExternalSystemMethodsAsync` helper to `BundleImporter` modeled on the T-001 `SyncTemplate*Async` helpers (dictionary- @@ -137,7 +137,7 @@ methods differ. | Severity | High | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Import/BundleImporter.cs:184-203`, `src/ScadaLink.CentralUI/Components/Pages/Design/TransportImport.razor.cs:267-309`, `src/ScadaLink.Commons/Types/Transport/BundleSession.cs:14-16` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:184-203`, `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Design/TransportImport.razor.cs:267-309`, `src/ZB.MOM.WW.ScadaBridge.Commons/Types/Transport/BundleSession.cs:14-16` | **Description** @@ -174,7 +174,7 @@ _Unresolved._ | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Transport/TransportOptions.cs:12`, `docs/requirements/Component-Transport.md` §11 | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/TransportOptions.cs:12`, `docs/requirements/Component-Transport.md` §11 | **Resolution (2026-05-28):** Added a new `BundleUnlockRateLimiter` class (in-memory, per-key sliding-window counter via `ConcurrentDictionary>` with per-bucket locking), registered as a singleton in `AddTransport`, and wired into `BundleImporter.LoadAsync` before the decrypt attempt — exceeding the per-window cap throws the new `BundleUnlockRateLimitedException` (429-equivalent). The importer keys the limiter on the bundle's `ContentHash` (it has no `IHttpContext` dependency by design); an IP-aware caller can use the limiter's public `TryRegisterAttempt(clientIp, max)` directly for true per-IP keying. `BundleUnlockRateLimiterTests` covers: N attempts allowed and N+1 rejected; full-window expiry releases the entire budget; partial expiry releases only the aged-out slots (sliding window); per-key isolation; argument validation. @@ -208,12 +208,12 @@ _Unresolved._ | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Encryption/BundleSecretEncryptor.cs:31-49`, `src/ScadaLink.Transport/Serialization/ManifestValidator.cs:29-53` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Encryption/BundleSecretEncryptor.cs:31-49`, `src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/ManifestValidator.cs:29-53` | **Description** AES-GCM is called with no Associated Authenticated Data (AAD). The `manifest` -fields — `SourceEnvironment`, `ExportedBy`, `ScadaLinkVersion`, `Summary`, +fields — `SourceEnvironment`, `ExportedBy`, `ScadaBridgeVersion`, `Summary`, `Contents`, `CreatedAtUtc`, etc. — are plaintext and only the `ContentHash` field is checked against the content bytes. An attacker who obtains a bundle can edit any non-`ContentHash` manifest field (e.g. rewrite the @@ -244,7 +244,7 @@ _Unresolved._ | Severity | Medium | | Category | Security | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Serialization/BundleSerializer.cs:121-156`, `src/ScadaLink.Transport/Import/BundleImporter.cs:132-143` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/BundleSerializer.cs:121-156`, `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:132-143` | **Description** @@ -277,7 +277,7 @@ _Unresolved._ | Severity | Medium | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Import/BundleImporter.cs:614-696`, `src/ScadaLink.Transport/Import/BundleSessionStore.cs:67-93` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:614-696`, `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleSessionStore.cs:67-93` | **Description** @@ -313,7 +313,7 @@ _Unresolved._ | Severity | Low | | Category | Performance & resource management | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Import/BundleImporter.cs:252-272` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:252-272` | **Resolution (2026-05-28):** Added a bulk `GetTemplatesWithChildrenAsync(IEnumerable names, CancellationToken)` method on `ITemplateEngineRepository` and implemented it on `TemplateEngineRepository` with a single `Where(t => names.Contains(t.Name))` + `Include(Attributes/Alarms/Scripts/Compositions).AsSplitQuery()` round-trip; null / empty / duplicate names are filtered before the IN clause. `BundleImporter.PreviewAsync` now calls the bulk method once with `content.Templates.Select(t => t.Name)` and indexes the result by name, replacing the previous `GetAllTemplatesAsync` scan + per-match `GetTemplateWithChildrenAsync(stub.Id)` round-trip pair. Regression tests: `TemplateEngineRepositoryTests.GetTemplatesWithChildrenAsync_*` (4 tests — bulk fetch, empty input, null enumerable, dedup) and `BundleImporterPreviewTests.PreviewAsync_multiple_templates_with_children_diffs_each_correctly` (asserts the bulk fetch hydrates all three templates' Attributes / Alarms / Scripts so the diff classifies each as Identical). @@ -346,7 +346,7 @@ _Unresolved._ | Severity | Low | | Category | Concurrency & thread safety | | Status | Resolved | -| Location | `src/ScadaLink.Transport/Import/BundleImporter.cs:528, 668, 703`, `src/ScadaLink.ConfigurationDatabase/Services/AuditCorrelationContext.cs` | +| Location | `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:528, 668, 703`, `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Services/AuditCorrelationContext.cs` | **Resolution (2026-05-28):** Took option (a). `AuditCorrelationContext` now backs `BundleImportId` with a `static AsyncLocal`, @@ -389,14 +389,14 @@ _Unresolved._ | Severity | Medium | | Category | Testing coverage | | Status | Resolved | -| Location | `tests/ScadaLink.Transport.IntegrationTests/ConflictResolutionTests.cs`, `tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs` | +| Location | `tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ConflictResolutionTests.cs`, `tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs` | **Resolution (2026-05-28):** Re-verified the listed gaps against the current tree. Each item the finding enumerated has landed in the recent fix commits: - **Template Overwrite with divergent Attributes / Alarms / Scripts** — covered by `ApplyAsync_Overwrite_synchronises_attributes_alarms_and_scripts_to_bundle` - in `tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs` + in `tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs` (added with the Transport-001 fix in commit `e3ca9af`). Asserts the bundle's child collections fully replace the divergent target shape AND that per-field audit rows (`TemplateAttributeAdded`/`Updated`/`Deleted`, the alarm and script @@ -406,10 +406,10 @@ tree. Each item the finding enumerated has landed in the recent fix commits: same file (Transport-002 fix, commit `e3ca9af`). Mirrors the T-001 shape with `ExternalSystemMethodAdded`/`Updated`/`Deleted` audit rows. - **Per-IP unlock-throttle behaviour (Transport-004)** — covered by - `tests/ScadaLink.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs` (12 + `tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs` (12 tests: under-limit, at-limit rejection, sliding-window reset, per-key isolation). - **Failed-apply session retention (Transport-007)** — covered by - `tests/ScadaLink.Transport.Tests/Import/BundleSessionStoreTests.cs`: + `tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleSessionStoreTests.cs`: `Get_after_TTL_returns_null_and_evicts`, `EvictExpired_removes_all_past_ttl`, `UnlockFailures_ExpireOnTtlAndGetReturnsZero`, and `UnlockFailures_EvictExpired_ClearsStaleEntries` collectively pin the TTL @@ -460,7 +460,7 @@ Add the missing integration tests above. Most can be modelled after | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `docs/requirements/Component-Transport.md` Import Flow Step 1, `src/ScadaLink.Transport/Import/BundleImporter.cs:124-203` | +| Location | `docs/requirements/Component-Transport.md` Import Flow Step 1, `src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs:124-203` | **Description** @@ -500,7 +500,7 @@ bundle prompt is surfaced AFTER the manifest+hash check, and that a dedicated | Severity | Low | | Category | Documentation & comments | | Status | Resolved | -| Location | `docs/requirements/Component-Transport.md` §Audit Trail, `src/ScadaLink.ConfigurationDatabase/Repositories/CentralUiRepository.cs:148` | +| Location | `docs/requirements/Component-Transport.md` §Audit Trail, `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Repositories/CentralUiRepository.cs:148` | **Description** diff --git a/code-reviews/_template/findings.md b/code-reviews/_template/findings.md index 2b56b6a2..f7c895aa 100644 --- a/code-reviews/_template/findings.md +++ b/code-reviews/_template/findings.md @@ -8,7 +8,7 @@ | Field | Value | |-------|-------| -| Module | `src/ScadaLink.` | +| Module | `src/ZB.MOM.WW.ScadaBridge.` | | Design doc | `docs/requirements/Component-.md` | | Status | Not yet reviewed \| In progress \| Reviewed | | Last reviewed | YYYY-MM-DD | @@ -50,7 +50,7 @@ Confirm every category was examined. Record "No issues found" where applicable. | Severity | Critical \| High \| Medium \| Low | | Category | | | Status | Open \| In Progress \| Resolved \| Won't Fix \| Deferred | -| Location | `src/ScadaLink./.cs:` | +| Location | `src/ZB.MOM.WW.ScadaBridge./.cs:` | **Description** diff --git a/code-reviews/regen-readme.py b/code-reviews/regen-readme.py index 9536ad95..881caf41 100755 --- a/code-reviews/regen-readme.py +++ b/code-reviews/regen-readme.py @@ -86,7 +86,7 @@ def build_readme(modules, per_module): add("# Code Reviews") add("") - add("Comprehensive, per-module code reviews of the ScadaLink codebase. Each module (one") + add("Comprehensive, per-module code reviews of the ScadaBridge codebase. Each module (one") add("buildable project under `src/`) has its own folder containing a `findings.md`. This") add("README is the aggregated index — the single place to see all outstanding work.") add("") diff --git a/deployments/README.md b/deployments/README.md index 394e1500..4ff641b1 100644 --- a/deployments/README.md +++ b/deployments/README.md @@ -1,6 +1,6 @@ # Deployments -Catalog of ScadaLink deployments. Each entry below has a corresponding markdown file with topology, ports, infrastructure dependencies, and operational commands. The deployment **ID** matches the `Transport.SourceEnvironment` value stamped into exported bundle manifests (Component #24), so an audit trail of "where did this bundle come from" maps 1:1 to a file in this folder. +Catalog of ScadaBridge deployments. Each entry below has a corresponding markdown file with topology, ports, infrastructure dependencies, and operational commands. The deployment **ID** matches the `Transport.SourceEnvironment` value stamped into exported bundle manifests (Component #24), so an audit trail of "where did this bundle come from" maps 1:1 to a file in this folder. | Deployment ID | Type | Topology | Doc | |---------------|------|----------|-----| diff --git a/deployments/docker-cluster-env2.md b/deployments/docker-cluster-env2.md index e6db6fdb..efbb1096 100644 --- a/deployments/docker-cluster-env2.md +++ b/deployments/docker-cluster-env2.md @@ -1,11 +1,11 @@ # docker-cluster-env2 -Secondary local Docker deployment — a minimal ScadaLink topology that runs **concurrently with** [`docker-cluster`](docker-cluster.md) so the Transport (#24) feature can be exercised end-to-end across two real environments (export a bundle from one, import into the other). +Secondary local Docker deployment — a minimal ScadaBridge topology that runs **concurrently with** [`docker-cluster`](docker-cluster.md) so the Transport (#24) feature can be exercised end-to-end across two real environments (export a bundle from one, import into the other). - **Deployment ID:** `docker-cluster-env2` - **Transport.SourceEnvironment:** `docker-cluster-env2` - **Source directory:** [`docker-env2/`](../docker-env2/) -- **Container-name prefix:** `scadalink-env2-` +- **Container-name prefix:** `scadabridge-env2-` - **Host-port range:** `91XX` (primary `90XX` + 100) ## Topology @@ -34,11 +34,11 @@ Same active/standby pattern as the primary, scaled down to a single site cluster | Node | Container Name | Host Web | Host Akka | Host gRPC | |------|----------------|----------|-----------|-----------| -| Traefik LB | `scadalink-env2-traefik` | 9100 | — | — | -| Central A | `scadalink-env2-central-a` | 9101 | 9111 | — | -| Central B | `scadalink-env2-central-b` | 9102 | 9112 | — | -| Site-X A | `scadalink-env2-site-x-a` | — | 9121 | 9123 | -| Site-X B | `scadalink-env2-site-x-b` | — | 9122 | 9124 | +| Traefik LB | `scadabridge-env2-traefik` | 9100 | — | — | +| Central A | `scadabridge-env2-central-a` | 9101 | 9111 | — | +| Central B | `scadabridge-env2-central-b` | 9102 | 9112 | — | +| Site-X A | `scadabridge-env2-site-x-a` | — | 9121 | 9123 | +| Site-X B | `scadabridge-env2-site-x-b` | — | 9122 | 9124 | ## Sites @@ -48,29 +48,29 @@ Same active/standby pattern as the primary, scaled down to a single site cluster ## Infrastructure Dependencies -Env2 reuses the primary's `infra/` containers via the shared `scadalink-net` bridge network — there is no separate `infra/` stack to start. +Env2 reuses the primary's `infra/` containers via the shared `scadabridge-net` bridge network — there is no separate `infra/` stack to start. | Service | Shared Container | What env2 uses it for | |---------|------------------|-----------------------| -| MS SQL | `scadalink-mssql` | Env2 databases `ScadaLinkConfig2` / `ScadaLinkMachineData2` (separate DBs on the same instance) | -| LDAP | `scadalink-ldap` | Authentication (same test users) | -| SMTP | `scadalink-smtp` | Notification capture (env2 emails distinguishable by `FromAddress`) | -| OPC UA | `scadalink-opcua` | Simulated tags for `site-x` data connections | -| REST API | `scadalink-restapi` | External REST integration testing | +| MS SQL | `scadabridge-mssql` | Env2 databases `ScadaBridgeConfig2` / `ScadaBridgeMachineData2` (separate DBs on the same instance) | +| LDAP | `scadabridge-ldap` | Authentication (same test users) | +| SMTP | `scadabridge-smtp` | Notification capture (env2 emails distinguishable by `FromAddress`) | +| OPC UA | `scadabridge-opcua` | Simulated tags for `site-x` data connections | +| REST API | `scadabridge-restapi` | External REST integration testing | ## Databases | Database | Owner | |----------|-------| -| `ScadaLinkConfig2` | Configuration Database (#17) — env2 instance | -| `ScadaLinkMachineData2` | Machine data — env2 instance | +| `ScadaBridgeConfig2` | Configuration Database (#17) — env2 instance | +| `ScadaBridgeMachineData2` | Machine data — env2 instance | Created by `docker-env2/init-db.sh`, which `deploy.sh` runs automatically. ## Commands ```bash -# Primary infra must already be up (creates scadalink-net + MS SQL + LDAP + SMTP + OPC UA + REST) +# Primary infra must already be up (creates scadabridge-net + MS SQL + LDAP + SMTP + OPC UA + REST) cd infra && docker compose up -d && cd .. # Build image (shared with primary), create env2 DBs, deploy env2 containers @@ -81,21 +81,21 @@ bash docker-env2/seed-sites.sh # View logs docker compose -f docker-env2/docker-compose.yml logs -f -docker logs -f scadalink-env2-central-a +docker logs -f scadabridge-env2-central-a # Stop env2 (preserves SQLite + logs) bash docker-env2/teardown.sh # Also drop env2 databases -docker exec scadalink-mssql /opt/mssql-tools18/bin/sqlcmd \ - -S localhost -U sa -P 'ScadaLink_Dev1#' -C \ - -Q "DROP DATABASE ScadaLinkConfig2; DROP DATABASE ScadaLinkMachineData2;" +docker exec scadabridge-mssql /opt/mssql-tools18/bin/sqlcmd \ + -S localhost -U sa -P 'ScadaBridge_Dev1#' -C \ + -Q "DROP DATABASE ScadaBridgeConfig2; DROP DATABASE ScadaBridgeMachineData2;" ``` ## CLI Access ```bash -dotnet run --project src/ScadaLink.CLI -- \ +dotnet run --project src/ZB.MOM.WW.ScadaBridge.CLI -- \ --url http://localhost:9100 \ --username multi-role --password password \ template list @@ -105,14 +105,14 @@ dotnet run --project src/ScadaLink.CLI -- \ - Single site (`site-x`) instead of three (`site-a`/`site-b`/`site-c`). - Host port range `91XX` instead of `90XX`. -- Container names prefixed `scadalink-env2-` instead of `scadalink-`. -- Databases `ScadaLinkConfig2` / `ScadaLinkMachineData2` on the **shared** `scadalink-mssql`. +- Container names prefixed `scadabridge-env2-` instead of `scadabridge-`. +- Databases `ScadaBridgeConfig2` / `ScadaBridgeMachineData2` on the **shared** `scadabridge-mssql`. - `Transport.SourceEnvironment = "docker-cluster-env2"` stamped into exported bundle manifests. - Distinct `Security.JwtSigningKey` so sessions cannot cross environments. ## Notes -- Concurrent with [`docker-cluster`](docker-cluster.md) — both stacks share `scadalink-net` and the `infra/` services. Disjoint host ports + DB names + container names allow them to run side-by-side. +- Concurrent with [`docker-cluster`](docker-cluster.md) — both stacks share `scadabridge-net` and the `infra/` services. Disjoint host ports + DB names + container names allow them to run side-by-side. - Design rationale: [`docs/plans/2026-05-24-second-environment-design.md`](../docs/plans/2026-05-24-second-environment-design.md). - Transport golden-path verification: [`docs/plans/2026-05-24-second-environment-verification.md`](../docs/plans/2026-05-24-second-environment-verification.md). - Setup details, port table, and CLI examples in [`docker-env2/README.md`](../docker-env2/README.md). diff --git a/deployments/docker-cluster.md b/deployments/docker-cluster.md index 5ad2e9aa..705b6ca0 100644 --- a/deployments/docker-cluster.md +++ b/deployments/docker-cluster.md @@ -1,11 +1,11 @@ # docker-cluster -Primary local Docker deployment — the full ScadaLink reference topology used for day-to-day development and integration testing. Runs on the developer workstation under Docker / OrbStack. +Primary local Docker deployment — the full ScadaBridge reference topology used for day-to-day development and integration testing. Runs on the developer workstation under Docker / OrbStack. - **Deployment ID:** `docker-cluster` - **Transport.SourceEnvironment:** `docker-cluster` - **Source directory:** [`docker/`](../docker/) -- **Container-name prefix:** `scadalink-` +- **Container-name prefix:** `scadabridge-` - **Host-port range:** `90XX` ## Topology @@ -35,15 +35,15 @@ Two-node active/standby everywhere. Central runs the Blazor UI, Template Engine, | Node | Container Name | Host Web | Host Akka | Host gRPC | |------|----------------|----------|-----------|-----------| -| Traefik LB | `scadalink-traefik` | 9000 | — | — | -| Central A | `scadalink-central-a` | 9001 | 9011 | — | -| Central B | `scadalink-central-b` | 9002 | 9012 | — | -| Site-A A | `scadalink-site-a-a` | — | 9021 | 9023 | -| Site-A B | `scadalink-site-a-b` | — | 9022 | 9024 | -| Site-B A | `scadalink-site-b-a` | — | 9031 | 9033 | -| Site-B B | `scadalink-site-b-b` | — | 9032 | 9034 | -| Site-C A | `scadalink-site-c-a` | — | 9041 | 9043 | -| Site-C B | `scadalink-site-c-b` | — | 9042 | 9044 | +| Traefik LB | `scadabridge-traefik` | 9000 | — | — | +| Central A | `scadabridge-central-a` | 9001 | 9011 | — | +| Central B | `scadabridge-central-b` | 9002 | 9012 | — | +| Site-A A | `scadabridge-site-a-a` | — | 9021 | 9023 | +| Site-A B | `scadabridge-site-a-b` | — | 9022 | 9024 | +| Site-B A | `scadabridge-site-b-a` | — | 9031 | 9033 | +| Site-B B | `scadabridge-site-b-b` | — | 9032 | 9034 | +| Site-C A | `scadabridge-site-c-a` | — | 9041 | 9043 | +| Site-C B | `scadabridge-site-c-b` | — | 9042 | 9044 | Port pattern: `90X1`/`90X2` (Akka), `90X3`/`90X4` (gRPC), where X = 0 (central), 2 (site-a), 3 (site-b), 4 (site-c). @@ -57,27 +57,27 @@ Port pattern: `90X1`/`90X2` (Akka), `90X3`/`90X4` (gRPC), where X = 0 (central), ## Infrastructure Dependencies -All from `infra/docker-compose.yml`, attached via the shared `scadalink-net` bridge network: +All from `infra/docker-compose.yml`, attached via the shared `scadabridge-net` bridge network: | Service | Container | Host Port | Purpose | |---------|-----------|-----------|---------| -| MS SQL 2022 | `scadalink-mssql` | 1433 | `ScadaLinkConfig`, `ScadaLinkMachineData` | -| LDAP (GLAuth) | `scadalink-ldap` | 3893 | Authentication | -| SMTP (Mailpit) | `scadalink-smtp` | 1025 / 8025 | Notification capture | -| OPC UA | `scadalink-opcua` | 50000 / 8080 | Simulated device tags | -| REST API | `scadalink-restapi` | 5200 | External REST integration testing | +| MS SQL 2022 | `scadabridge-mssql` | 1433 | `ScadaBridgeConfig`, `ScadaBridgeMachineData` | +| LDAP (GLAuth) | `scadabridge-ldap` | 3893 | Authentication | +| SMTP (Mailpit) | `scadabridge-smtp` | 1025 / 8025 | Notification capture | +| OPC UA | `scadabridge-opcua` | 50000 / 8080 | Simulated device tags | +| REST API | `scadabridge-restapi` | 5200 | External REST integration testing | ## Databases | Database | Owner | |----------|-------| -| `ScadaLinkConfig` | Configuration Database (#17) | -| `ScadaLinkMachineData` | Machine data (template/instance runtime data) | +| `ScadaBridgeConfig` | Configuration Database (#17) | +| `ScadaBridgeMachineData` | Machine data (template/instance runtime data) | ## Commands ```bash -# Start infra first (creates scadalink-net, MS SQL, LDAP, SMTP, OPC UA, REST API) +# Start infra first (creates scadabridge-net, MS SQL, LDAP, SMTP, OPC UA, REST API) cd infra && docker compose up -d && cd .. # Build image + deploy all 8 nodes @@ -88,7 +88,7 @@ bash docker/seed-sites.sh # View logs docker compose -f docker/docker-compose.yml logs -f -docker logs -f scadalink-central-a +docker logs -f scadabridge-central-a # Health curl -s http://localhost:9001/health/ready | python3 -m json.tool @@ -103,7 +103,7 @@ bash docker/teardown.sh The CLI talks to the Traefik LB, which routes to the active central node. ```bash -dotnet run --project src/ScadaLink.CLI -- \ +dotnet run --project src/ZB.MOM.WW.ScadaBridge.CLI -- \ --url http://localhost:9000 \ --username multi-role --password password \ template list @@ -125,5 +125,5 @@ All passwords are `password`. See `infra/glauth/config.toml` for the full list. ## Notes - Reference deployment for the project — when a change ships, it gets validated here first. -- Concurrent with [`docker-cluster-env2`](docker-cluster-env2.md) on the same host; the two stacks share the `scadalink-net` network and `infra/` services but use disjoint host ports (`90XX` vs `91XX`) and databases. +- Concurrent with [`docker-cluster-env2`](docker-cluster-env2.md) on the same host; the two stacks share the `scadabridge-net` network and `infra/` services but use disjoint host ports (`90XX` vs `91XX`) and databases. - Detailed setup, failover testing, and build-cache notes live in [`docker/README.md`](../docker/README.md). diff --git a/docker-env2/README.md b/docker-env2/README.md index 9064a3ea..45b2c2f2 100644 --- a/docker-env2/README.md +++ b/docker-env2/README.md @@ -1,6 +1,6 @@ -# ScadaLink Env2 Docker Infrastructure +# ScadaBridge Env2 Docker Infrastructure -A second Docker deployment of a minimal ScadaLink cluster topology, designed to run **concurrently with** the primary `docker/` stack so the Transport (#24) feature can be exercised end-to-end across two real environments. +A second Docker deployment of a minimal ScadaBridge cluster topology, designed to run **concurrently with** the primary `docker/` stack so the Transport (#24) feature can be exercised end-to-end across two real environments. See [`docs/plans/2026-05-24-second-environment-design.md`](../docs/plans/2026-05-24-second-environment-design.md) for the design rationale. @@ -40,30 +40,30 @@ Env2 host ports are the primary's ports + 100. Both stacks can run simultaneousl | Node | Container Name | Host Web | Host Akka | Host gRPC | Internal | |------|----------------|----------|-----------|-----------|----------| -| Traefik LB | `scadalink-env2-traefik` | 9100 | — | — | 80 (proxy), 8080 (dashboard host:8181) | -| Central A | `scadalink-env2-central-a` | 9101 | 9111 | — | 5000 (web), 8081 (Akka) | -| Central B | `scadalink-env2-central-b` | 9102 | 9112 | — | 5000 (web), 8081 (Akka) | -| Site-X A | `scadalink-env2-site-x-a` | — | 9121 | 9123 | 8082 (Akka), 8083 (gRPC) | -| Site-X B | `scadalink-env2-site-x-b` | — | 9122 | 9124 | 8082 (Akka), 8083 (gRPC) | +| Traefik LB | `scadabridge-env2-traefik` | 9100 | — | — | 80 (proxy), 8080 (dashboard host:8181) | +| Central A | `scadabridge-env2-central-a` | 9101 | 9111 | — | 5000 (web), 8081 (Akka) | +| Central B | `scadabridge-env2-central-b` | 9102 | 9112 | — | 5000 (web), 8081 (Akka) | +| Site-X A | `scadabridge-env2-site-x-a` | — | 9121 | 9123 | 8082 (Akka), 8083 (gRPC) | +| Site-X B | `scadabridge-env2-site-x-b` | — | 9122 | 9124 | 8082 (Akka), 8083 (gRPC) | ## Shared Infrastructure -Env2 attaches to the existing `scadalink-net` Docker bridge network and reuses these primary infra containers: +Env2 attaches to the existing `scadabridge-net` Docker bridge network and reuses these primary infra containers: | Service | Container | What env2 uses it for | |---------|-----------|-----------------------| -| MS SQL | `scadalink-mssql` | Env2-specific databases `ScadaLinkConfig2` / `ScadaLinkMachineData2` | -| LDAP | `scadalink-ldap` | Authentication (same test users) | -| SMTP | `scadalink-smtp` | Notification capture in Mailpit (env2 emails distinguishable by `FromAddress`) | -| OPC UA | `scadalink-opcua` | Simulated tags for site-x data connections | -| REST API | `scadalink-restapi` | External REST API testing | +| MS SQL | `scadabridge-mssql` | Env2-specific databases `ScadaBridgeConfig2` / `ScadaBridgeMachineData2` | +| LDAP | `scadabridge-ldap` | Authentication (same test users) | +| SMTP | `scadabridge-smtp` | Notification capture in Mailpit (env2 emails distinguishable by `FromAddress`) | +| OPC UA | `scadabridge-opcua` | Simulated tags for site-x data connections | +| REST API | `scadabridge-restapi` | External REST API testing | ## Commands ### First-Time Setup ```bash -# 1. Make sure primary infra is up (creates scadalink-net, scadalink-mssql, etc.) +# 1. Make sure primary infra is up (creates scadabridge-net, scadabridge-mssql, etc.) cd infra && docker compose up -d && cd .. # 2. Build image + create env2 databases + deploy env2 containers @@ -101,15 +101,15 @@ bash docker-env2/teardown.sh Containers stop, volumes (data + logs) preserved. To also drop the env2 databases: ```bash -docker exec scadalink-mssql /opt/mssql-tools18/bin/sqlcmd \ - -S localhost -U sa -P 'ScadaLink_Dev1#' -C \ - -Q "DROP DATABASE ScadaLinkConfig2; DROP DATABASE ScadaLinkMachineData2;" +docker exec scadabridge-mssql /opt/mssql-tools18/bin/sqlcmd \ + -S localhost -U sa -P 'ScadaBridge_Dev1#' -C \ + -Q "DROP DATABASE ScadaBridgeConfig2; DROP DATABASE ScadaBridgeMachineData2;" ``` ### CLI Access ```bash -dotnet run --project src/ScadaLink.CLI -- \ +dotnet run --project src/ZB.MOM.WW.ScadaBridge.CLI -- \ --url http://localhost:9100 \ --username multi-role --password password \ template list @@ -119,7 +119,7 @@ dotnet run --project src/ScadaLink.CLI -- \ ```bash docker compose -f docker-env2/docker-compose.yml logs -f -docker logs -f scadalink-env2-central-a +docker logs -f scadabridge-env2-central-a ``` ## Test Users @@ -134,7 +134,7 @@ See [`docs/plans/2026-05-24-second-environment-verification.md`](../docs/plans/2 - Single site (`site-x`) instead of three (`site-a/b/c`). - Host port range 91XX vs primary 90XX. -- Container names prefixed `scadalink-env2-`. -- Databases `ScadaLinkConfig2` / `ScadaLinkMachineData2` on the **shared** `scadalink-mssql`. +- Container names prefixed `scadabridge-env2-`. +- Databases `ScadaBridgeConfig2` / `ScadaBridgeMachineData2` on the **shared** `scadabridge-mssql`. - `Transport.SourceEnvironment` = `"docker-cluster-env2"` (stamped into exported bundle manifests). - Distinct `Security.JwtSigningKey` (sessions cannot cross envs). diff --git a/docker-env2/central-node-a/appsettings.Central.json b/docker-env2/central-node-a/appsettings.Central.json index 147fb4cb..9fcff378 100644 --- a/docker-env2/central-node-a/appsettings.Central.json +++ b/docker-env2/central-node-a/appsettings.Central.json @@ -1,15 +1,15 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Central", "NodeName": "central-a", - "NodeHostname": "scadalink-env2-central-a", + "NodeHostname": "scadabridge-env2-central-a", "RemotingPort": 8081 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-env2-central-a:8081", - "akka.tcp://scadalink@scadalink-env2-central-b:8081" + "akka.tcp://scadabridge@scadabridge-env2-central-a:8081", + "akka.tcp://scadabridge@scadabridge-env2-central-b:8081" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -18,18 +18,18 @@ "MinNrOfMembers": 1 }, "Database": { - "ConfigurationDb": "Server=scadalink-mssql,1433;Database=ScadaLinkConfig2;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true", - "MachineDataDb": "Server=scadalink-mssql,1433;Database=ScadaLinkMachineData2;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true" + "ConfigurationDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeConfig2;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true", + "MachineDataDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeMachineData2;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true" }, "Security": { - "LdapServer": "scadalink-ldap", + "LdapServer": "scadabridge-ldap", "LdapPort": 3893, "LdapUseTls": false, "AllowInsecureLdap": true, - "LdapSearchBase": "dc=scadalink,dc=local", - "LdapServiceAccountDn": "cn=admin,dc=scadalink,dc=local", + "LdapSearchBase": "dc=scadabridge,dc=local", + "LdapServiceAccountDn": "cn=admin,dc=scadabridge,dc=local", "LdapServiceAccountPassword": "password", - "JwtSigningKey": "scadalink-env2-dev-jwt-signing-key-must-be-at-least-32-characters-long", + "JwtSigningKey": "scadabridge-env2-dev-jwt-signing-key-must-be-at-least-32-characters-long", "JwtExpiryMinutes": 15, "IdleTimeoutMinutes": 30, "RequireHttpsCookie": false @@ -49,7 +49,7 @@ "DefaultMethodTimeout": "00:00:30" }, "Notification": { - "SmtpServer": "scadalink-smtp", + "SmtpServer": "scadabridge-smtp", "SmtpPort": 1025, "AuthMode": "None", "FromAddress": "scada-notifications-env2@company.com" diff --git a/docker-env2/central-node-b/appsettings.Central.json b/docker-env2/central-node-b/appsettings.Central.json index b9a6f466..c73b218d 100644 --- a/docker-env2/central-node-b/appsettings.Central.json +++ b/docker-env2/central-node-b/appsettings.Central.json @@ -1,15 +1,15 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Central", "NodeName": "central-b", - "NodeHostname": "scadalink-env2-central-b", + "NodeHostname": "scadabridge-env2-central-b", "RemotingPort": 8081 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-env2-central-a:8081", - "akka.tcp://scadalink@scadalink-env2-central-b:8081" + "akka.tcp://scadabridge@scadabridge-env2-central-a:8081", + "akka.tcp://scadabridge@scadabridge-env2-central-b:8081" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -18,18 +18,18 @@ "MinNrOfMembers": 1 }, "Database": { - "ConfigurationDb": "Server=scadalink-mssql,1433;Database=ScadaLinkConfig2;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true", - "MachineDataDb": "Server=scadalink-mssql,1433;Database=ScadaLinkMachineData2;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true" + "ConfigurationDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeConfig2;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true", + "MachineDataDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeMachineData2;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true" }, "Security": { - "LdapServer": "scadalink-ldap", + "LdapServer": "scadabridge-ldap", "LdapPort": 3893, "LdapUseTls": false, "AllowInsecureLdap": true, - "LdapSearchBase": "dc=scadalink,dc=local", - "LdapServiceAccountDn": "cn=admin,dc=scadalink,dc=local", + "LdapSearchBase": "dc=scadabridge,dc=local", + "LdapServiceAccountDn": "cn=admin,dc=scadabridge,dc=local", "LdapServiceAccountPassword": "password", - "JwtSigningKey": "scadalink-env2-dev-jwt-signing-key-must-be-at-least-32-characters-long", + "JwtSigningKey": "scadabridge-env2-dev-jwt-signing-key-must-be-at-least-32-characters-long", "JwtExpiryMinutes": 15, "IdleTimeoutMinutes": 30, "RequireHttpsCookie": false @@ -49,7 +49,7 @@ "DefaultMethodTimeout": "00:00:30" }, "Notification": { - "SmtpServer": "scadalink-smtp", + "SmtpServer": "scadabridge-smtp", "SmtpPort": 1025, "AuthMode": "None", "FromAddress": "scada-notifications-env2@company.com" diff --git a/docker-env2/deploy.sh b/docker-env2/deploy.sh index 22246a05..c3f545e8 100755 --- a/docker-env2/deploy.sh +++ b/docker-env2/deploy.sh @@ -3,12 +3,12 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -echo "=== ScadaLink Env2 Docker Deploy ===" +echo "=== ScadaBridge Env2 Docker Deploy ===" -# Reuse the primary build (same scadalink:latest image, same network creation) +# Reuse the primary build (same scadabridge:latest image, same network creation) "$SCRIPT_DIR/../docker/build.sh" -# Ensure env2 databases exist on the shared scadalink-mssql +# Ensure env2 databases exist on the shared scadabridge-mssql "$SCRIPT_DIR/init-db.sh" echo "" diff --git a/docker-env2/docker-compose.yml b/docker-env2/docker-compose.yml index cede121a..1e05da9e 100644 --- a/docker-env2/docker-compose.yml +++ b/docker-env2/docker-compose.yml @@ -1,7 +1,7 @@ services: central-a: - image: scadalink:latest - container_name: scadalink-env2-central-a + image: scadabridge:latest + container_name: scadabridge-env2-central-a environment: SCADALINK_CONFIG: Central ASPNETCORE_ENVIRONMENT: Development @@ -13,12 +13,12 @@ services: - ./central-node-a/appsettings.Central.json:/app/appsettings.Central.json:ro - ./central-node-a/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped central-b: - image: scadalink:latest - container_name: scadalink-env2-central-b + image: scadabridge:latest + container_name: scadabridge-env2-central-b environment: SCADALINK_CONFIG: Central ASPNETCORE_ENVIRONMENT: Development @@ -30,12 +30,12 @@ services: - ./central-node-b/appsettings.Central.json:/app/appsettings.Central.json:ro - ./central-node-b/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-x-a: - image: scadalink:latest - container_name: scadalink-env2-site-x-a + image: scadabridge:latest + container_name: scadabridge-env2-site-x-a environment: SCADALINK_CONFIG: Site ports: @@ -46,12 +46,12 @@ services: - ./site-x-node-a/data:/app/data - ./site-x-node-a/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-x-b: - image: scadalink:latest - container_name: scadalink-env2-site-x-b + image: scadabridge:latest + container_name: scadabridge-env2-site-x-b environment: SCADALINK_CONFIG: Site ports: @@ -62,12 +62,12 @@ services: - ./site-x-node-b/data:/app/data - ./site-x-node-b/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped traefik: image: traefik:v3.4 - container_name: scadalink-env2-traefik + container_name: scadabridge-env2-traefik ports: - "9100:80" # Env2 central load-balanced entrypoint - "8181:8080" # Env2 Traefik dashboard @@ -75,9 +75,9 @@ services: - ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro - ./traefik/dynamic.yml:/etc/traefik/dynamic.yml:ro networks: - - scadalink-net + - scadabridge-net restart: unless-stopped networks: - scadalink-net: + scadabridge-net: external: true diff --git a/docker-env2/init-db.sh b/docker-env2/init-db.sh index 7b7f527c..a7900efd 100755 --- a/docker-env2/init-db.sh +++ b/docker-env2/init-db.sh @@ -2,14 +2,14 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -if ! docker ps --format '{{.Names}}' | grep -q '^scadalink-mssql$'; then - echo "ERROR: scadalink-mssql is not running. Start it: cd infra && docker compose up -d" >&2 +if ! docker ps --format '{{.Names}}' | grep -q '^scadabridge-mssql$'; then + echo "ERROR: scadabridge-mssql is not running. Start it: cd infra && docker compose up -d" >&2 exit 1 fi echo "Applying env2 database setup..." -docker exec -i scadalink-mssql /opt/mssql-tools18/bin/sqlcmd \ - -S localhost -U sa -P 'ScadaLink_Dev1#' -C \ +docker exec -i scadabridge-mssql /opt/mssql-tools18/bin/sqlcmd \ + -S localhost -U sa -P 'ScadaBridge_Dev1#' -C \ < "$SCRIPT_DIR/../infra/mssql/setup-env2.sql" echo "Env2 databases ready." diff --git a/docker-env2/seed-sites.sh b/docker-env2/seed-sites.sh index 183bc6f7..3f3fe163 100755 --- a/docker-env2/seed-sites.sh +++ b/docker-env2/seed-sites.sh @@ -14,11 +14,11 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" -CLI="dotnet run --project $PROJECT_ROOT/src/ScadaLink.CLI --" +CLI="dotnet run --project $PROJECT_ROOT/src/ZB.MOM.WW.ScadaBridge.CLI --" AUTH="--username multi-role --password password" URL="--url http://localhost:9100" -echo "=== Seeding ScadaLink Env2 Sites ===" +echo "=== Seeding ScadaBridge Env2 Sites ===" echo "" echo "Creating Site-X (Env2 Site X)..." @@ -26,22 +26,22 @@ $CLI $URL $AUTH site create \ --name "Env2 Site X" \ --identifier "site-x" \ --description "Env2 test site - two-node cluster" \ - --node-a-address "akka.tcp://scadalink@scadalink-env2-site-x-a:8082" \ - --node-b-address "akka.tcp://scadalink@scadalink-env2-site-x-b:8082" \ - --grpc-node-a-address "http://scadalink-env2-site-x-a:8083" \ - --grpc-node-b-address "http://scadalink-env2-site-x-b:8083" \ + --node-a-address "akka.tcp://scadabridge@scadabridge-env2-site-x-a:8082" \ + --node-b-address "akka.tcp://scadabridge@scadabridge-env2-site-x-b:8082" \ + --grpc-node-a-address "http://scadabridge-env2-site-x-a:8083" \ + --grpc-node-b-address "http://scadabridge-env2-site-x-b:8083" \ || echo " (Site-X may already exist)" echo "" echo "Seeding LDAP group mappings (Design + Deployment)..." # SecurityConfiguration.HasData declares 4 mappings but the InitialSchema -# migration only inserts the Admin row, so a fresh ScadaLinkConfig2 starts +# migration only inserts the Admin row, so a fresh ScadaBridgeConfig2 starts # with multi-role getting Admin only -- no Design and no Deployment access. # Insert the missing three idempotently. (Same divergence exists on the # primary, but primary's database has the rows from earlier history.) -docker exec -i scadalink-mssql /opt/mssql-tools18/bin/sqlcmd \ - -S localhost -U sa -P 'ScadaLink_Dev1#' -C \ - -d ScadaLinkConfig2 -Q " +docker exec -i scadabridge-mssql /opt/mssql-tools18/bin/sqlcmd \ + -S localhost -U sa -P 'ScadaBridge_Dev1#' -C \ + -d ScadaBridgeConfig2 -Q " SET IDENTITY_INSERT LdapGroupMappings ON; IF NOT EXISTS (SELECT 1 FROM LdapGroupMappings WHERE Id = 2) INSERT INTO LdapGroupMappings (Id, LdapGroupName, Role) VALUES (2, 'SCADA-Designers', 'Design'); diff --git a/docker-env2/site-x-node-a/appsettings.Site.json b/docker-env2/site-x-node-a/appsettings.Site.json index 4fded73a..0cc7f03d 100644 --- a/docker-env2/site-x-node-a/appsettings.Site.json +++ b/docker-env2/site-x-node-a/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-a", - "NodeHostname": "scadalink-env2-site-x-a", + "NodeHostname": "scadabridge-env2-site-x-a", "SiteId": "site-x", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-env2-site-x-a:8082", - "akka.tcp://scadalink@scadalink-env2-site-x-b:8082" + "akka.tcp://scadabridge@scadabridge-env2-site-x-a:8082", + "akka.tcp://scadabridge@scadabridge-env2-site-x-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-env2-central-a:8081", - "akka.tcp://scadalink@scadalink-env2-central-b:8081" + "akka.tcp://scadabridge@scadabridge-env2-central-a:8081", + "akka.tcp://scadabridge@scadabridge-env2-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker-env2/site-x-node-b/appsettings.Site.json b/docker-env2/site-x-node-b/appsettings.Site.json index ea4b6797..a28728cf 100644 --- a/docker-env2/site-x-node-b/appsettings.Site.json +++ b/docker-env2/site-x-node-b/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-b", - "NodeHostname": "scadalink-env2-site-x-b", + "NodeHostname": "scadabridge-env2-site-x-b", "SiteId": "site-x", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-env2-site-x-a:8082", - "akka.tcp://scadalink@scadalink-env2-site-x-b:8082" + "akka.tcp://scadabridge@scadabridge-env2-site-x-a:8082", + "akka.tcp://scadabridge@scadabridge-env2-site-x-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-env2-central-a:8081", - "akka.tcp://scadalink@scadalink-env2-central-b:8081" + "akka.tcp://scadabridge@scadabridge-env2-central-a:8081", + "akka.tcp://scadabridge@scadabridge-env2-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker-env2/teardown.sh b/docker-env2/teardown.sh index 84667ff6..96b6ed8e 100755 --- a/docker-env2/teardown.sh +++ b/docker-env2/teardown.sh @@ -3,7 +3,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -echo "=== ScadaLink Env2 Docker Teardown ===" +echo "=== ScadaBridge Env2 Docker Teardown ===" echo "Stopping env2 application containers..." docker compose -f "$SCRIPT_DIR/docker-compose.yml" down @@ -12,8 +12,8 @@ echo "" echo "Teardown complete." echo "Site data (SQLite DBs) and logs are preserved in node directories." echo "" -echo "Env2 databases (ScadaLinkConfig2 / ScadaLinkMachineData2) remain on" -echo "the shared scadalink-mssql. To drop them:" -echo " docker exec scadalink-mssql /opt/mssql-tools18/bin/sqlcmd \\" -echo " -S localhost -U sa -P 'ScadaLink_Dev1#' -C \\" -echo " -Q \"DROP DATABASE ScadaLinkConfig2; DROP DATABASE ScadaLinkMachineData2;\"" +echo "Env2 databases (ScadaBridgeConfig2 / ScadaBridgeMachineData2) remain on" +echo "the shared scadabridge-mssql. To drop them:" +echo " docker exec scadabridge-mssql /opt/mssql-tools18/bin/sqlcmd \\" +echo " -S localhost -U sa -P 'ScadaBridge_Dev1#' -C \\" +echo " -Q \"DROP DATABASE ScadaBridgeConfig2; DROP DATABASE ScadaBridgeMachineData2;\"" diff --git a/docker-env2/traefik/dynamic.yml b/docker-env2/traefik/dynamic.yml index ae728d21..38287384 100644 --- a/docker-env2/traefik/dynamic.yml +++ b/docker-env2/traefik/dynamic.yml @@ -14,5 +14,5 @@ http: interval: 5s timeout: 3s servers: - - url: "http://scadalink-env2-central-a:5000" - - url: "http://scadalink-env2-central-b:5000" + - url: "http://scadabridge-env2-central-a:5000" + - url: "http://scadabridge-env2-central-b:5000" diff --git a/docker/Dockerfile b/docker/Dockerfile index bddb1b38..0315bc0d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,24 +3,24 @@ FROM mcr.microsoft.com/dotnet/sdk:10.0 AS restore WORKDIR /src # Copy all .csproj files first (rarely change) for restore layer caching -COPY src/ScadaLink.Commons/ScadaLink.Commons.csproj src/ScadaLink.Commons/ -COPY src/ScadaLink.Host/ScadaLink.Host.csproj src/ScadaLink.Host/ -COPY src/ScadaLink.TemplateEngine/ScadaLink.TemplateEngine.csproj src/ScadaLink.TemplateEngine/ -COPY src/ScadaLink.DeploymentManager/ScadaLink.DeploymentManager.csproj src/ScadaLink.DeploymentManager/ -COPY src/ScadaLink.SiteRuntime/ScadaLink.SiteRuntime.csproj src/ScadaLink.SiteRuntime/ -COPY src/ScadaLink.DataConnectionLayer/ScadaLink.DataConnectionLayer.csproj src/ScadaLink.DataConnectionLayer/ -COPY src/ScadaLink.Communication/ScadaLink.Communication.csproj src/ScadaLink.Communication/ -COPY src/ScadaLink.StoreAndForward/ScadaLink.StoreAndForward.csproj src/ScadaLink.StoreAndForward/ -COPY src/ScadaLink.ExternalSystemGateway/ScadaLink.ExternalSystemGateway.csproj src/ScadaLink.ExternalSystemGateway/ -COPY src/ScadaLink.NotificationService/ScadaLink.NotificationService.csproj src/ScadaLink.NotificationService/ -COPY src/ScadaLink.CentralUI/ScadaLink.CentralUI.csproj src/ScadaLink.CentralUI/ -COPY src/ScadaLink.Security/ScadaLink.Security.csproj src/ScadaLink.Security/ -COPY src/ScadaLink.HealthMonitoring/ScadaLink.HealthMonitoring.csproj src/ScadaLink.HealthMonitoring/ -COPY src/ScadaLink.SiteEventLogging/ScadaLink.SiteEventLogging.csproj src/ScadaLink.SiteEventLogging/ -COPY src/ScadaLink.ClusterInfrastructure/ScadaLink.ClusterInfrastructure.csproj src/ScadaLink.ClusterInfrastructure/ -COPY src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj src/ScadaLink.InboundAPI/ -COPY src/ScadaLink.ConfigurationDatabase/ScadaLink.ConfigurationDatabase.csproj src/ScadaLink.ConfigurationDatabase/ -COPY src/ScadaLink.ManagementService/ScadaLink.ManagementService.csproj src/ScadaLink.ManagementService/ +COPY src/ZB.MOM.WW.ScadaBridge.Commons/ZB.MOM.WW.ScadaBridge.Commons.csproj src/ZB.MOM.WW.ScadaBridge.Commons/ +COPY src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj src/ZB.MOM.WW.ScadaBridge.Host/ +COPY src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ZB.MOM.WW.ScadaBridge.TemplateEngine.csproj src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ +COPY src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ZB.MOM.WW.ScadaBridge.DeploymentManager.csproj src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ +COPY src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ZB.MOM.WW.ScadaBridge.SiteRuntime.csproj src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ +COPY src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.csproj src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/ +COPY src/ZB.MOM.WW.ScadaBridge.Communication/ZB.MOM.WW.ScadaBridge.Communication.csproj src/ZB.MOM.WW.ScadaBridge.Communication/ +COPY src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ZB.MOM.WW.ScadaBridge.StoreAndForward.csproj src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ +COPY src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.csproj src/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway/ +COPY src/ZB.MOM.WW.ScadaBridge.NotificationService/ZB.MOM.WW.ScadaBridge.NotificationService.csproj src/ZB.MOM.WW.ScadaBridge.NotificationService/ +COPY src/ZB.MOM.WW.ScadaBridge.CentralUI/ZB.MOM.WW.ScadaBridge.CentralUI.csproj src/ZB.MOM.WW.ScadaBridge.CentralUI/ +COPY src/ZB.MOM.WW.ScadaBridge.Security/ZB.MOM.WW.ScadaBridge.Security.csproj src/ZB.MOM.WW.ScadaBridge.Security/ +COPY src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/ZB.MOM.WW.ScadaBridge.HealthMonitoring.csproj src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/ +COPY src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ZB.MOM.WW.ScadaBridge.SiteEventLogging.csproj src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ +COPY src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.csproj src/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure/ +COPY src/ZB.MOM.WW.ScadaBridge.InboundAPI/ZB.MOM.WW.ScadaBridge.InboundAPI.csproj src/ZB.MOM.WW.ScadaBridge.InboundAPI/ +COPY src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.csproj src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ +COPY src/ZB.MOM.WW.ScadaBridge.ManagementService/ZB.MOM.WW.ScadaBridge.ManagementService.csproj src/ZB.MOM.WW.ScadaBridge.ManagementService/ # Central Package Management: every .csproj declares versionless PackageReferences # and the versions live in Directory.Packages.props. It must be present (above the @@ -29,12 +29,12 @@ COPY Directory.Packages.props ./ # Restore NuGet packages via Host project (follows ProjectReferences to all dependencies) # This layer is cached until any .csproj changes — source-only changes skip restore entirely -RUN dotnet restore src/ScadaLink.Host/ScadaLink.Host.csproj +RUN dotnet restore src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj # Stage 2: Build + Publish FROM restore AS build COPY src/ src/ -RUN dotnet publish src/ScadaLink.Host/ScadaLink.Host.csproj \ +RUN dotnet publish src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj \ -c Release -o /app/publish # Stage 3: Runtime (minimal image, no SDK) @@ -48,4 +48,4 @@ COPY --from=build /app/publish . EXPOSE 5000 8081 8082 -ENTRYPOINT ["dotnet", "ScadaLink.Host.dll"] +ENTRYPOINT ["dotnet", "ZB.MOM.WW.ScadaBridge.Host.dll"] diff --git a/docker/README.md b/docker/README.md index 64f53a6b..f1de06b7 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,6 +1,6 @@ -# ScadaLink Docker Infrastructure +# ScadaBridge Docker Infrastructure -Local Docker deployment of the full ScadaLink cluster topology: a 2-node central cluster and three 2-node site clusters. +Local Docker deployment of the full ScadaBridge cluster topology: a 2-node central cluster and three 2-node site clusters. ## Cluster Topology @@ -54,15 +54,15 @@ Each site cluster runs Site Runtime, Data Connection Layer, Store-and-Forward, a | Node | Container Name | Host Web Port | Host Akka Port | Host gRPC Port | Internal Ports | |------|---------------|---------------|----------------|----------------|----------------| -| Traefik LB | `scadalink-traefik` | 9000 | — | — | 80 (proxy), 8080 (dashboard) | -| Central A | `scadalink-central-a` | 9001 | 9011 | — | 5000 (web), 8081 (Akka) | -| Central B | `scadalink-central-b` | 9002 | 9012 | — | 5000 (web), 8081 (Akka) | -| Site-A A | `scadalink-site-a-a` | — | 9021 | 9023 | 8082 (Akka), 8083 (gRPC) | -| Site-A B | `scadalink-site-a-b` | — | 9022 | 9024 | 8082 (Akka), 8083 (gRPC) | -| Site-B A | `scadalink-site-b-a` | — | 9031 | 9033 | 8082 (Akka), 8083 (gRPC) | -| Site-B B | `scadalink-site-b-b` | — | 9032 | 9034 | 8082 (Akka), 8083 (gRPC) | -| Site-C A | `scadalink-site-c-a` | — | 9041 | 9043 | 8082 (Akka), 8083 (gRPC) | -| Site-C B | `scadalink-site-c-b` | — | 9042 | 9044 | 8082 (Akka), 8083 (gRPC) | +| Traefik LB | `scadabridge-traefik` | 9000 | — | — | 80 (proxy), 8080 (dashboard) | +| Central A | `scadabridge-central-a` | 9001 | 9011 | — | 5000 (web), 8081 (Akka) | +| Central B | `scadabridge-central-b` | 9002 | 9012 | — | 5000 (web), 8081 (Akka) | +| Site-A A | `scadabridge-site-a-a` | — | 9021 | 9023 | 8082 (Akka), 8083 (gRPC) | +| Site-A B | `scadabridge-site-a-b` | — | 9022 | 9024 | 8082 (Akka), 8083 (gRPC) | +| Site-B A | `scadabridge-site-b-a` | — | 9031 | 9033 | 8082 (Akka), 8083 (gRPC) | +| Site-B B | `scadabridge-site-b-b` | — | 9032 | 9034 | 8082 (Akka), 8083 (gRPC) | +| Site-C A | `scadabridge-site-c-a` | — | 9041 | 9043 | 8082 (Akka), 8083 (gRPC) | +| Site-C B | `scadabridge-site-c-b` | — | 9042 | 9044 | 8082 (Akka), 8083 (gRPC) | Port block pattern: `90X1`/`90X2` (Akka), `90X3`/`90X4` (gRPC) where X = 0 (central), 2 (site-a), 3 (site-b), 4 (site-c). gRPC streaming ports are used by central nodes to subscribe to real-time site data streams. @@ -70,13 +70,13 @@ Port block pattern: `90X1`/`90X2` (Akka), `90X3`/`90X4` (gRPC) where X = 0 (cent | Service | Container Name | Host Port | Purpose | |---------|---------------|-----------|---------| -| MS SQL 2022 | `scadalink-mssql` | 1433 | Configuration and machine data databases | -| LDAP (GLAuth) | `scadalink-ldap` | 3893 | Authentication with test users | -| SMTP (Mailpit) | `scadalink-smtp` | 1025 / 8025 | Email capture (SMTP / web UI) | -| OPC UA | `scadalink-opcua` | 50000 / 8080 | Simulated OPC UA server (protocol / web UI) | -| REST API | `scadalink-restapi` | 5200 | External REST API for integration testing | +| MS SQL 2022 | `scadabridge-mssql` | 1433 | Configuration and machine data databases | +| LDAP (GLAuth) | `scadabridge-ldap` | 3893 | Authentication with test users | +| SMTP (Mailpit) | `scadabridge-smtp` | 1025 / 8025 | Email capture (SMTP / web UI) | +| OPC UA | `scadabridge-opcua` | 50000 / 8080 | Simulated OPC UA server (protocol / web UI) | +| REST API | `scadabridge-restapi` | 5200 | External REST API for integration testing | -All containers communicate over the shared `scadalink-net` Docker bridge network using container names as hostnames. +All containers communicate over the shared `scadabridge-net` Docker bridge network using container names as hostnames. ## Directory Structure @@ -130,7 +130,7 @@ Start infrastructure services first, then build and deploy the application: # 1. Start test infrastructure (MS SQL, LDAP, SMTP, OPC UA) cd infra && docker compose up -d && cd .. -# 2. Build and deploy all 8 ScadaLink nodes +# 2. Build and deploy all 8 ScadaBridge nodes docker/deploy.sh # 3. Seed test sites (first-time only, after cluster is healthy) @@ -167,7 +167,7 @@ cd infra && docker compose down && cd .. docker compose -f docker/docker-compose.yml logs -f # Single node -docker logs -f scadalink-central-a +docker logs -f scadabridge-central-a # Filter by site cluster docker compose -f docker/docker-compose.yml logs -f site-a-a site-a-b @@ -181,7 +181,7 @@ ls docker/central-node-a/logs/ ### Restart a Single Node ```bash -docker restart scadalink-central-a +docker restart scadabridge-central-a ``` ### Check Cluster Health @@ -199,7 +199,7 @@ curl -s http://localhost:9002/health/ready | python3 -m json.tool The CLI connects to the Central Host's HTTP management API via the Traefik load balancer at `http://localhost:9000`, which routes to the active central node: ```bash -dotnet run --project src/ScadaLink.CLI -- \ +dotnet run --project src/ZB.MOM.WW.ScadaBridge.CLI -- \ --url http://localhost:9000 \ --username multi-role --password password \ template list @@ -209,7 +209,7 @@ Direct access to individual nodes is also available at `http://localhost:9001` ( > **Note:** The `multi-role` test user has Admin, Design, and Deployment roles. The `admin` user only has the Admin role and cannot perform design or deployment operations. See `infra/glauth/config.toml` for all test users and their group memberships. -A recommended `~/.scadalink/config.json` for the Docker test environment: +A recommended `~/.scadabridge/config.json` for the Docker test environment: ```json { @@ -220,7 +220,7 @@ A recommended `~/.scadalink/config.json` for the Docker test environment: With this config file in place, the URL is automatic: ```bash -dotnet run --project src/ScadaLink.CLI -- \ +dotnet run --project src/ZB.MOM.WW.ScadaBridge.CLI -- \ --username multi-role --password password \ template list ``` @@ -232,19 +232,19 @@ Remove SQLite databases to reset site state (deployed configs, S&F buffers): ```bash # Single site rm -rf docker/site-a-node-a/data docker/site-a-node-b/data -docker restart scadalink-site-a-a scadalink-site-a-b +docker restart scadabridge-site-a-a scadabridge-site-a-b # All sites rm -rf docker/site-*/data -docker restart scadalink-site-a-a scadalink-site-a-b \ - scadalink-site-b-a scadalink-site-b-b \ - scadalink-site-c-a scadalink-site-c-b +docker restart scadabridge-site-a-a scadabridge-site-a-b \ + scadabridge-site-b-a scadabridge-site-b-b \ + scadabridge-site-c-a scadabridge-site-c-b ``` ### Rebuild Image From Scratch (no cache) ```bash -docker build --no-cache -t scadalink:latest -f docker/Dockerfile . +docker build --no-cache -t scadabridge:latest -f docker/Dockerfile . ``` ## Build Cache @@ -274,31 +274,31 @@ All test passwords are `password`. See `infra/glauth/config.toml` for the full l ```bash # Stop the active central node -docker stop scadalink-central-a +docker stop scadabridge-central-a # Verify central-b takes over (check logs for leader election) -docker logs -f scadalink-central-b +docker logs -f scadabridge-central-b # Access UI on standby node open http://localhost:9002 # Restore the original node -docker start scadalink-central-a +docker start scadabridge-central-a ``` ### Site Failover ```bash # Stop the active site-a node -docker stop scadalink-site-a-a +docker stop scadabridge-site-a-a # Verify site-a-b takes over singleton (DeploymentManager) -docker logs -f scadalink-site-a-b +docker logs -f scadabridge-site-a-b # Restore -docker start scadalink-site-a-a +docker start scadabridge-site-a-a ``` -Same pattern applies for site-b (`scadalink-site-b-a`/`scadalink-site-b-b`) and site-c (`scadalink-site-c-a`/`scadalink-site-c-b`). +Same pattern applies for site-b (`scadabridge-site-b-a`/`scadabridge-site-b-b`) and site-c (`scadabridge-site-c-a`/`scadabridge-site-c-b`). Failover takes approximately 25 seconds (2s heartbeat + 10s detection threshold + 15s stable-after for split-brain resolver). diff --git a/docker/build.sh b/docker/build.sh index ca4e3218..ebbe69f9 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -4,19 +4,19 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" -echo "=== ScadaLink Docker Build ===" +echo "=== ScadaBridge Docker Build ===" # Ensure the shared network exists -if ! docker network inspect scadalink-net >/dev/null 2>&1; then - echo "Creating scadalink-net network..." - docker network create scadalink-net +if ! docker network inspect scadabridge-net >/dev/null 2>&1; then + echo "Creating scadabridge-net network..." + docker network create scadabridge-net fi # Build from repo root (so COPY paths in Dockerfile resolve correctly) -echo "Building scadalink:latest image..." +echo "Building scadabridge:latest image..." docker build \ - -t scadalink:latest \ + -t scadabridge:latest \ -f "$SCRIPT_DIR/Dockerfile" \ "$REPO_ROOT" -echo "Build complete: scadalink:latest" +echo "Build complete: scadabridge:latest" diff --git a/docker/central-node-a/appsettings.Central.json b/docker/central-node-a/appsettings.Central.json index 89aa8062..125f11c6 100644 --- a/docker/central-node-a/appsettings.Central.json +++ b/docker/central-node-a/appsettings.Central.json @@ -1,15 +1,15 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Central", "NodeName": "central-a", - "NodeHostname": "scadalink-central-a", + "NodeHostname": "scadabridge-central-a", "RemotingPort": 8081 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -18,18 +18,18 @@ "MinNrOfMembers": 1 }, "Database": { - "ConfigurationDb": "Server=scadalink-mssql,1433;Database=ScadaLinkConfig;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true", - "MachineDataDb": "Server=scadalink-mssql,1433;Database=ScadaLinkMachineData;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true" + "ConfigurationDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeConfig;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true", + "MachineDataDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeMachineData;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true" }, "Security": { - "LdapServer": "scadalink-ldap", + "LdapServer": "scadabridge-ldap", "LdapPort": 3893, "LdapUseTls": false, "AllowInsecureLdap": true, - "LdapSearchBase": "dc=scadalink,dc=local", - "LdapServiceAccountDn": "cn=admin,dc=scadalink,dc=local", + "LdapSearchBase": "dc=scadabridge,dc=local", + "LdapServiceAccountDn": "cn=admin,dc=scadabridge,dc=local", "LdapServiceAccountPassword": "password", - "JwtSigningKey": "scadalink-dev-jwt-signing-key-must-be-at-least-32-characters-long", + "JwtSigningKey": "scadabridge-dev-jwt-signing-key-must-be-at-least-32-characters-long", "JwtExpiryMinutes": 15, "IdleTimeoutMinutes": 30, "RequireHttpsCookie": false @@ -49,7 +49,7 @@ "DefaultMethodTimeout": "00:00:30" }, "Notification": { - "SmtpServer": "scadalink-smtp", + "SmtpServer": "scadabridge-smtp", "SmtpPort": 1025, "AuthMode": "None", "FromAddress": "scada-notifications@company.com" diff --git a/docker/central-node-b/appsettings.Central.json b/docker/central-node-b/appsettings.Central.json index ea4e7342..2acd4219 100644 --- a/docker/central-node-b/appsettings.Central.json +++ b/docker/central-node-b/appsettings.Central.json @@ -1,15 +1,15 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Central", "NodeName": "central-b", - "NodeHostname": "scadalink-central-b", + "NodeHostname": "scadabridge-central-b", "RemotingPort": 8081 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -18,18 +18,18 @@ "MinNrOfMembers": 1 }, "Database": { - "ConfigurationDb": "Server=scadalink-mssql,1433;Database=ScadaLinkConfig;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true", - "MachineDataDb": "Server=scadalink-mssql,1433;Database=ScadaLinkMachineData;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true" + "ConfigurationDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeConfig;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true", + "MachineDataDb": "Server=scadabridge-mssql,1433;Database=ScadaBridgeMachineData;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true" }, "Security": { - "LdapServer": "scadalink-ldap", + "LdapServer": "scadabridge-ldap", "LdapPort": 3893, "LdapUseTls": false, "AllowInsecureLdap": true, - "LdapSearchBase": "dc=scadalink,dc=local", - "LdapServiceAccountDn": "cn=admin,dc=scadalink,dc=local", + "LdapSearchBase": "dc=scadabridge,dc=local", + "LdapServiceAccountDn": "cn=admin,dc=scadabridge,dc=local", "LdapServiceAccountPassword": "password", - "JwtSigningKey": "scadalink-dev-jwt-signing-key-must-be-at-least-32-characters-long", + "JwtSigningKey": "scadabridge-dev-jwt-signing-key-must-be-at-least-32-characters-long", "JwtExpiryMinutes": 15, "IdleTimeoutMinutes": 30, "RequireHttpsCookie": false @@ -49,7 +49,7 @@ "DefaultMethodTimeout": "00:00:30" }, "Notification": { - "SmtpServer": "scadalink-smtp", + "SmtpServer": "scadabridge-smtp", "SmtpPort": 1025, "AuthMode": "None", "FromAddress": "scada-notifications@company.com" diff --git a/docker/deploy.sh b/docker/deploy.sh index 0ae076c5..6d47cdf2 100755 --- a/docker/deploy.sh +++ b/docker/deploy.sh @@ -3,7 +3,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -echo "=== ScadaLink Docker Deploy ===" +echo "=== ScadaBridge Docker Deploy ===" # Build image (creates network if needed) "$SCRIPT_DIR/build.sh" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index e5904cac..b52669ed 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,7 +1,7 @@ services: central-a: - image: scadalink:latest - container_name: scadalink-central-a + image: scadabridge:latest + container_name: scadabridge-central-a environment: SCADALINK_CONFIG: Central ASPNETCORE_ENVIRONMENT: Development @@ -13,12 +13,12 @@ services: - ./central-node-a/appsettings.Central.json:/app/appsettings.Central.json:ro - ./central-node-a/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped central-b: - image: scadalink:latest - container_name: scadalink-central-b + image: scadabridge:latest + container_name: scadabridge-central-b environment: SCADALINK_CONFIG: Central ASPNETCORE_ENVIRONMENT: Development @@ -30,12 +30,12 @@ services: - ./central-node-b/appsettings.Central.json:/app/appsettings.Central.json:ro - ./central-node-b/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-a-a: - image: scadalink:latest - container_name: scadalink-site-a-a + image: scadabridge:latest + container_name: scadabridge-site-a-a environment: SCADALINK_CONFIG: Site ports: @@ -46,12 +46,12 @@ services: - ./site-a-node-a/data:/app/data - ./site-a-node-a/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-a-b: - image: scadalink:latest - container_name: scadalink-site-a-b + image: scadabridge:latest + container_name: scadabridge-site-a-b environment: SCADALINK_CONFIG: Site ports: @@ -62,12 +62,12 @@ services: - ./site-a-node-b/data:/app/data - ./site-a-node-b/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-b-a: - image: scadalink:latest - container_name: scadalink-site-b-a + image: scadabridge:latest + container_name: scadabridge-site-b-a environment: SCADALINK_CONFIG: Site ports: @@ -78,12 +78,12 @@ services: - ./site-b-node-a/data:/app/data - ./site-b-node-a/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-b-b: - image: scadalink:latest - container_name: scadalink-site-b-b + image: scadabridge:latest + container_name: scadabridge-site-b-b environment: SCADALINK_CONFIG: Site ports: @@ -94,12 +94,12 @@ services: - ./site-b-node-b/data:/app/data - ./site-b-node-b/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-c-a: - image: scadalink:latest - container_name: scadalink-site-c-a + image: scadabridge:latest + container_name: scadabridge-site-c-a environment: SCADALINK_CONFIG: Site ports: @@ -110,12 +110,12 @@ services: - ./site-c-node-a/data:/app/data - ./site-c-node-a/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped site-c-b: - image: scadalink:latest - container_name: scadalink-site-c-b + image: scadabridge:latest + container_name: scadabridge-site-c-b environment: SCADALINK_CONFIG: Site ports: @@ -126,12 +126,12 @@ services: - ./site-c-node-b/data:/app/data - ./site-c-node-b/logs:/app/logs networks: - - scadalink-net + - scadabridge-net restart: unless-stopped traefik: image: traefik:v3.4 - container_name: scadalink-traefik + container_name: scadabridge-traefik ports: - "9000:80" # Central load-balanced entrypoint - "8180:8080" # Traefik dashboard @@ -139,9 +139,9 @@ services: - ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro - ./traefik/dynamic.yml:/etc/traefik/dynamic.yml:ro networks: - - scadalink-net + - scadabridge-net restart: unless-stopped networks: - scadalink-net: + scadabridge-net: external: true diff --git a/docker/regen-proto.sh b/docker/regen-proto.sh index 710043c8..d1c2ab29 100755 --- a/docker/regen-proto.sh +++ b/docker/regen-proto.sh @@ -4,7 +4,7 @@ # # Background: protoc (linux/arm64) segfaults inside our Docker build container # (Grpc.Tools 2.71.0). As a workaround the generated Sitestream.cs + -# SitestreamGrpc.cs are checked into src/ScadaLink.Communication/SiteStreamGrpc/ +# SitestreamGrpc.cs are checked into src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/ # and the Protobuf ItemGroup in the .csproj is commented out — Docker just # compiles the checked-in C# files. # @@ -23,8 +23,8 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" -COMM_DIR="$REPO_ROOT/src/ScadaLink.Communication" -CSPROJ="$COMM_DIR/ScadaLink.Communication.csproj" +COMM_DIR="$REPO_ROOT/src/ZB.MOM.WW.ScadaBridge.Communication" +CSPROJ="$COMM_DIR/ZB.MOM.WW.ScadaBridge.Communication.csproj" GEN_DIR="$COMM_DIR/SiteStreamGrpc" echo "=== Regenerating gRPC files from sitestream.proto ===" @@ -88,5 +88,5 @@ trap - ERR echo "" echo "Done. Review and commit:" -echo " git diff src/ScadaLink.Communication/Protos/sitestream.proto" -echo " git diff src/ScadaLink.Communication/SiteStreamGrpc/" +echo " git diff src/ZB.MOM.WW.ScadaBridge.Communication/Protos/sitestream.proto" +echo " git diff src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/" diff --git a/docker/seed-sites.sh b/docker/seed-sites.sh index 2151e672..f14f7237 100755 --- a/docker/seed-sites.sh +++ b/docker/seed-sites.sh @@ -14,11 +14,11 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" -CLI="dotnet run --project $PROJECT_ROOT/src/ScadaLink.CLI --" +CLI="dotnet run --project $PROJECT_ROOT/src/ZB.MOM.WW.ScadaBridge.CLI --" AUTH="--username multi-role --password password" URL="--url http://localhost:9000" -echo "=== Seeding ScadaLink Sites ===" +echo "=== Seeding ScadaBridge Sites ===" echo "" echo "Creating Site-A (Test Plant A)..." @@ -26,10 +26,10 @@ $CLI $URL $AUTH site create \ --name "Test Plant A" \ --identifier "site-a" \ --description "Test site A - two-node cluster" \ - --node-a-address "akka.tcp://scadalink@scadalink-site-a-a:8082" \ - --node-b-address "akka.tcp://scadalink@scadalink-site-a-b:8082" \ - --grpc-node-a-address "http://scadalink-site-a-a:8083" \ - --grpc-node-b-address "http://scadalink-site-a-b:8083" \ + --node-a-address "akka.tcp://scadabridge@scadabridge-site-a-a:8082" \ + --node-b-address "akka.tcp://scadabridge@scadabridge-site-a-b:8082" \ + --grpc-node-a-address "http://scadabridge-site-a-a:8083" \ + --grpc-node-b-address "http://scadabridge-site-a-b:8083" \ || echo " (Site-A may already exist)" echo "" @@ -38,10 +38,10 @@ $CLI $URL $AUTH site create \ --name "Test Plant B" \ --identifier "site-b" \ --description "Test site B - two-node cluster" \ - --node-a-address "akka.tcp://scadalink@scadalink-site-b-a:8082" \ - --node-b-address "akka.tcp://scadalink@scadalink-site-b-b:8082" \ - --grpc-node-a-address "http://scadalink-site-b-a:8083" \ - --grpc-node-b-address "http://scadalink-site-b-b:8083" \ + --node-a-address "akka.tcp://scadabridge@scadabridge-site-b-a:8082" \ + --node-b-address "akka.tcp://scadabridge@scadabridge-site-b-b:8082" \ + --grpc-node-a-address "http://scadabridge-site-b-a:8083" \ + --grpc-node-b-address "http://scadabridge-site-b-b:8083" \ || echo " (Site-B may already exist)" echo "" @@ -50,10 +50,10 @@ $CLI $URL $AUTH site create \ --name "Test Plant C" \ --identifier "site-c" \ --description "Test site C - two-node cluster" \ - --node-a-address "akka.tcp://scadalink@scadalink-site-c-a:8082" \ - --node-b-address "akka.tcp://scadalink@scadalink-site-c-b:8082" \ - --grpc-node-a-address "http://scadalink-site-c-a:8083" \ - --grpc-node-b-address "http://scadalink-site-c-b:8083" \ + --node-a-address "akka.tcp://scadabridge@scadabridge-site-c-a:8082" \ + --node-b-address "akka.tcp://scadabridge@scadabridge-site-c-b:8082" \ + --grpc-node-a-address "http://scadabridge-site-c-a:8083" \ + --grpc-node-b-address "http://scadabridge-site-c-b:8083" \ || echo " (Site-C may already exist)" echo "" diff --git a/docker/site-a-node-a/appsettings.Site.json b/docker/site-a-node-a/appsettings.Site.json index 807e3725..841b93e1 100644 --- a/docker/site-a-node-a/appsettings.Site.json +++ b/docker/site-a-node-a/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-a", - "NodeHostname": "scadalink-site-a-a", + "NodeHostname": "scadabridge-site-a-a", "SiteId": "site-a", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-site-a-a:8082", - "akka.tcp://scadalink@scadalink-site-a-b:8082" + "akka.tcp://scadabridge@scadabridge-site-a-a:8082", + "akka.tcp://scadabridge@scadabridge-site-a-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker/site-a-node-b/appsettings.Site.json b/docker/site-a-node-b/appsettings.Site.json index 3af07f80..1ab9fbb8 100644 --- a/docker/site-a-node-b/appsettings.Site.json +++ b/docker/site-a-node-b/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-b", - "NodeHostname": "scadalink-site-a-b", + "NodeHostname": "scadabridge-site-a-b", "SiteId": "site-a", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-site-a-a:8082", - "akka.tcp://scadalink@scadalink-site-a-b:8082" + "akka.tcp://scadabridge@scadabridge-site-a-a:8082", + "akka.tcp://scadabridge@scadabridge-site-a-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker/site-b-node-a/appsettings.Site.json b/docker/site-b-node-a/appsettings.Site.json index 3e826b6d..fda43640 100644 --- a/docker/site-b-node-a/appsettings.Site.json +++ b/docker/site-b-node-a/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-a", - "NodeHostname": "scadalink-site-b-a", + "NodeHostname": "scadabridge-site-b-a", "SiteId": "site-b", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-site-b-a:8082", - "akka.tcp://scadalink@scadalink-site-b-b:8082" + "akka.tcp://scadabridge@scadabridge-site-b-a:8082", + "akka.tcp://scadabridge@scadabridge-site-b-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker/site-b-node-b/appsettings.Site.json b/docker/site-b-node-b/appsettings.Site.json index 72a55205..451f9650 100644 --- a/docker/site-b-node-b/appsettings.Site.json +++ b/docker/site-b-node-b/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-b", - "NodeHostname": "scadalink-site-b-b", + "NodeHostname": "scadabridge-site-b-b", "SiteId": "site-b", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-site-b-a:8082", - "akka.tcp://scadalink@scadalink-site-b-b:8082" + "akka.tcp://scadabridge@scadabridge-site-b-a:8082", + "akka.tcp://scadabridge@scadabridge-site-b-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker/site-c-node-a/appsettings.Site.json b/docker/site-c-node-a/appsettings.Site.json index faad6d58..3af46da7 100644 --- a/docker/site-c-node-a/appsettings.Site.json +++ b/docker/site-c-node-a/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-a", - "NodeHostname": "scadalink-site-c-a", + "NodeHostname": "scadabridge-site-c-a", "SiteId": "site-c", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-site-c-a:8082", - "akka.tcp://scadalink@scadalink-site-c-b:8082" + "akka.tcp://scadabridge@scadabridge-site-c-a:8082", + "akka.tcp://scadabridge@scadabridge-site-c-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker/site-c-node-b/appsettings.Site.json b/docker/site-c-node-b/appsettings.Site.json index 8b23299b..eec984d1 100644 --- a/docker/site-c-node-b/appsettings.Site.json +++ b/docker/site-c-node-b/appsettings.Site.json @@ -1,17 +1,17 @@ { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeName": "node-b", - "NodeHostname": "scadalink-site-c-b", + "NodeHostname": "scadabridge-site-c-b", "SiteId": "site-c", "RemotingPort": 8082, "GrpcPort": 8083 }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@scadalink-site-c-a:8082", - "akka.tcp://scadalink@scadalink-site-c-b:8082" + "akka.tcp://scadabridge@scadabridge-site-c-a:8082", + "akka.tcp://scadabridge@scadabridge-site-c-b:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -20,7 +20,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "/app/data/scadalink.db" + "SiteDbPath": "/app/data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,8 +33,8 @@ }, "Communication": { "CentralContactPoints": [ - "akka.tcp://scadalink@scadalink-central-a:8081", - "akka.tcp://scadalink@scadalink-central-b:8081" + "akka.tcp://scadabridge@scadabridge-central-a:8081", + "akka.tcp://scadabridge@scadabridge-central-b:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/docker/teardown.sh b/docker/teardown.sh index aa5c2f3a..e577670a 100755 --- a/docker/teardown.sh +++ b/docker/teardown.sh @@ -3,9 +3,9 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -echo "=== ScadaLink Docker Teardown ===" +echo "=== ScadaBridge Docker Teardown ===" -echo "Stopping ScadaLink application containers..." +echo "Stopping ScadaBridge application containers..." docker compose -f "$SCRIPT_DIR/docker-compose.yml" down echo "" diff --git a/docker/traefik/dynamic.yml b/docker/traefik/dynamic.yml index ffecd2ba..886bef88 100644 --- a/docker/traefik/dynamic.yml +++ b/docker/traefik/dynamic.yml @@ -14,5 +14,5 @@ http: interval: 5s timeout: 3s servers: - - url: "http://scadalink-central-a:5000" - - url: "http://scadalink-central-b:5000" + - url: "http://scadabridge-central-a:5000" + - url: "http://scadabridge-central-b:5000" diff --git a/docs/deployment/installation-guide.md b/docs/deployment/installation-guide.md index 46b5aa32..1df8bf7c 100644 --- a/docs/deployment/installation-guide.md +++ b/docs/deployment/installation-guide.md @@ -1,4 +1,4 @@ -# ScadaLink Installation Guide +# ScadaBridge Installation Guide ## Prerequisites @@ -11,32 +11,32 @@ ## Single Binary Deployment -ScadaLink ships as a single executable (`ScadaLink.Host.exe`) that runs in either Central or Site role based on configuration. +ScadaBridge ships as a single executable (`ZB.MOM.WW.ScadaBridge.Host.exe`) that runs in either Central or Site role based on configuration. ### Windows Service Installation ```powershell # Central Node -sc.exe create "ScadaLink-Central" binPath="C:\ScadaLink\ScadaLink.Host.exe" start=auto -sc.exe description "ScadaLink-Central" "ScadaLink SCADA Central Hub" +sc.exe create "ScadaBridge-Central" binPath="C:\ScadaBridge\ZB.MOM.WW.ScadaBridge.Host.exe" start=auto +sc.exe description "ScadaBridge-Central" "ScadaBridge SCADA Central Hub" # Site Node -sc.exe create "ScadaLink-Site" binPath="C:\ScadaLink\ScadaLink.Host.exe" start=auto -sc.exe description "ScadaLink-Site" "ScadaLink SCADA Site Agent" +sc.exe create "ScadaBridge-Site" binPath="C:\ScadaBridge\ZB.MOM.WW.ScadaBridge.Host.exe" start=auto +sc.exe description "ScadaBridge-Site" "ScadaBridge SCADA Site Agent" ``` ### Directory Structure ``` -C:\ScadaLink\ - ScadaLink.Host.exe +C:\ScadaBridge\ + ZB.MOM.WW.ScadaBridge.Host.exe appsettings.json appsettings.Production.json data\ # Site: SQLite databases site.db # Deployed configs, static overrides store-and-forward.db # S&F message buffer logs\ # Rolling log files - scadalink-20260316.log + scadabridge-20260316.log ``` ## Configuration Templates @@ -45,7 +45,7 @@ C:\ScadaLink\ ```json { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Central", "NodeHostname": "central-01.example.com", @@ -53,13 +53,13 @@ C:\ScadaLink\ }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@central-01.example.com:8081", - "akka.tcp://scadalink@central-02.example.com:8081" + "akka.tcp://scadabridge@central-01.example.com:8081", + "akka.tcp://scadabridge@central-02.example.com:8081" ] }, "Database": { - "ConfigurationDb": "Server=sqlserver.example.com;Database=ScadaLink;User Id=scadalink_svc;Password=;Encrypt=true;TrustServerCertificate=false", - "MachineDataDb": "Server=sqlserver.example.com;Database=ScadaLink_MachineData;User Id=scadalink_svc;Password=;Encrypt=true;TrustServerCertificate=false" + "ConfigurationDb": "Server=sqlserver.example.com;Database=ScadaBridge;User Id=scadabridge_svc;Password=;Encrypt=true;TrustServerCertificate=false", + "MachineDataDb": "Server=sqlserver.example.com;Database=ScadaBridge_MachineData;User Id=scadabridge_svc;Password=;Encrypt=true;TrustServerCertificate=false" }, "Security": { "LdapServer": "ldap.example.com", @@ -95,7 +95,7 @@ C:\ScadaLink\ ```json { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeHostname": "site-01-node-a.example.com", @@ -104,19 +104,19 @@ C:\ScadaLink\ }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@site-01-node-a.example.com:8081", - "akka.tcp://scadalink@site-01-node-b.example.com:8081" + "akka.tcp://scadabridge@site-01-node-a.example.com:8081", + "akka.tcp://scadabridge@site-01-node-b.example.com:8081" ] }, "Database": { - "SiteDbPath": "C:\\ScadaLink\\data\\site.db" + "SiteDbPath": "C:\\ScadaBridge\\data\\site.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", "TagResolutionRetryInterval": "00:00:30" }, "StoreAndForward": { - "SqliteDbPath": "C:\\ScadaLink\\data\\store-and-forward.db", + "SqliteDbPath": "C:\\ScadaBridge\\data\\store-and-forward.db", "DefaultRetryInterval": "00:00:30", "DefaultMaxRetries": 50, "ReplicationEnabled": true @@ -131,7 +131,7 @@ C:\ScadaLink\ "PurgeIntervalHours": 24 }, "Communication": { - "CentralSeedNode": "akka.tcp://scadalink@central-01.example.com:8081" + "CentralSeedNode": "akka.tcp://scadabridge@central-01.example.com:8081" }, "HealthMonitoring": { "ReportInterval": "00:00:30" @@ -149,26 +149,26 @@ C:\ScadaLink\ 1. Create the configuration database: ```sql -CREATE DATABASE ScadaLink; -CREATE LOGIN scadalink_svc WITH PASSWORD = ''; -USE ScadaLink; -CREATE USER scadalink_svc FOR LOGIN scadalink_svc; -ALTER ROLE db_owner ADD MEMBER scadalink_svc; +CREATE DATABASE ScadaBridge; +CREATE LOGIN scadabridge_svc WITH PASSWORD = ''; +USE ScadaBridge; +CREATE USER scadabridge_svc FOR LOGIN scadabridge_svc; +ALTER ROLE db_owner ADD MEMBER scadabridge_svc; ``` 2. Create the machine data database: ```sql -CREATE DATABASE ScadaLink_MachineData; -USE ScadaLink_MachineData; -CREATE USER scadalink_svc FOR LOGIN scadalink_svc; -ALTER ROLE db_owner ADD MEMBER scadalink_svc; +CREATE DATABASE ScadaBridge_MachineData; +USE ScadaBridge_MachineData; +CREATE USER scadabridge_svc FOR LOGIN scadabridge_svc; +ALTER ROLE db_owner ADD MEMBER scadabridge_svc; ``` 3. Apply EF Core migrations (development): - Migrations auto-apply on startup in Development environment. 4. Apply EF Core migrations (production): - - Generate SQL script: `dotnet ef migrations script --project src/ScadaLink.ConfigurationDatabase` + - Generate SQL script: `dotnet ef migrations script --project src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase` - Review and execute the SQL script against the production database. ## Network Requirements @@ -189,7 +189,7 @@ Ensure bidirectional TCP connectivity between all Akka.NET cluster peers. The re ## Post-Installation Verification -1. Start the service: `sc.exe start ScadaLink-Central` -2. Check the log file: `type C:\ScadaLink\logs\scadalink-*.log` +1. Start the service: `sc.exe start ScadaBridge-Central` +2. Check the log file: `type C:\ScadaBridge\logs\scadabridge-*.log` 3. Verify the readiness endpoint: `curl http://localhost:5000/health/ready` 4. For Central: verify the UI is accessible at `https://central-01.example.com/` diff --git a/docs/deployment/production-checklist.md b/docs/deployment/production-checklist.md index a62cb360..17b6ca88 100644 --- a/docs/deployment/production-checklist.md +++ b/docs/deployment/production-checklist.md @@ -1,26 +1,26 @@ -# ScadaLink Production Deployment Checklist +# ScadaBridge Production Deployment Checklist ## Pre-Deployment ### Configuration Verification -- [ ] `ScadaLink:Node:Role` is set correctly (`Central` or `Site`) -- [ ] `ScadaLink:Node:NodeHostname` matches the machine's resolvable hostname -- [ ] `ScadaLink:Cluster:SeedNodes` contains exactly 2 entries for the cluster pair +- [ ] `ScadaBridge:Node:Role` is set correctly (`Central` or `Site`) +- [ ] `ScadaBridge:Node:NodeHostname` matches the machine's resolvable hostname +- [ ] `ScadaBridge:Cluster:SeedNodes` contains exactly 2 entries for the cluster pair - [ ] Seed node addresses use fully qualified hostnames (not `localhost`) - [ ] Remoting port (default 8081) is open bidirectionally between cluster peers ### Central Node -- [ ] `ScadaLink:Database:ConfigurationDb` connection string is valid and tested -- [ ] `ScadaLink:Database:MachineDataDb` connection string is valid and tested +- [ ] `ScadaBridge:Database:ConfigurationDb` connection string is valid and tested +- [ ] `ScadaBridge:Database:MachineDataDb` connection string is valid and tested - [ ] SQL Server login has `db_owner` role on both databases - [ ] EF Core migrations have been applied (SQL script reviewed and executed) -- [ ] `ScadaLink:Security:JwtSigningKey` is at least 32 characters, randomly generated +- [ ] `ScadaBridge:Security:JwtSigningKey` is at least 32 characters, randomly generated - [ ] **Both central nodes use the same JwtSigningKey** (required for JWT failover) -- [ ] `ScadaLink:Security:LdapServer` points to the production LDAP/AD server -- [ ] `ScadaLink:Security:LdapUseTls` is `true` (LDAPS required in production) -- [ ] `ScadaLink:Security:AllowInsecureLdap` is `false` +- [ ] `ScadaBridge:Security:LdapServer` points to the production LDAP/AD server +- [ ] `ScadaBridge:Security:LdapUseTls` is `true` (LDAPS required in production) +- [ ] `ScadaBridge:Security:AllowInsecureLdap` is `false` - [ ] LDAP search base DN is correct for the organization - [ ] LDAP group-to-role mappings are configured - [ ] Load balancer is configured in front of central UI (sticky sessions not required) @@ -29,10 +29,10 @@ ### Site Node -- [ ] `ScadaLink:Node:SiteId` is set and unique across all sites -- [ ] `ScadaLink:Database:SiteDbPath` points to a writable directory +- [ ] `ScadaBridge:Node:SiteId` is set and unique across all sites +- [ ] `ScadaBridge:Database:SiteDbPath` points to a writable directory - [ ] SQLite data directory has sufficient disk space (no max buffer size for S&F) -- [ ] `ScadaLink:Communication:CentralSeedNode` points to a reachable central node +- [ ] `ScadaBridge:Communication:CentralSeedNode` points to a reachable central node - [ ] OPC UA server endpoints are accessible from site nodes - [ ] OPC UA security certificates are configured if required diff --git a/docs/deployment/topology-guide.md b/docs/deployment/topology-guide.md index fe1cea6a..3dff1941 100644 --- a/docs/deployment/topology-guide.md +++ b/docs/deployment/topology-guide.md @@ -1,8 +1,8 @@ -# ScadaLink Cluster Topology Guide +# ScadaBridge Cluster Topology Guide ## Architecture Overview -ScadaLink uses a hub-and-spoke architecture: +ScadaBridge uses a hub-and-spoke architecture: - **Central Cluster**: Two-node active/standby Akka.NET cluster for management, UI, and coordination. - **Site Clusters**: Two-node active/standby Akka.NET clusters at each remote site for data collection and local processing. @@ -34,7 +34,7 @@ Both central nodes must be configured as seed nodes for each other: **Node A** (`central-01.example.com`): ```json { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Central", "NodeHostname": "central-01.example.com", @@ -42,8 +42,8 @@ Both central nodes must be configured as seed nodes for each other: }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@central-01.example.com:8081", - "akka.tcp://scadalink@central-02.example.com:8081" + "akka.tcp://scadabridge@central-01.example.com:8081", + "akka.tcp://scadabridge@central-02.example.com:8081" ] } } @@ -53,7 +53,7 @@ Both central nodes must be configured as seed nodes for each other: **Node B** (`central-02.example.com`): ```json { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Central", "NodeHostname": "central-02.example.com", @@ -61,8 +61,8 @@ Both central nodes must be configured as seed nodes for each other: }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@central-01.example.com:8081", - "akka.tcp://scadalink@central-02.example.com:8081" + "akka.tcp://scadabridge@central-01.example.com:8081", + "akka.tcp://scadabridge@central-02.example.com:8081" ] } } @@ -101,7 +101,7 @@ Each site has its own two-node cluster: **Site Node A** (`site-01-a.example.com`): ```json { - "ScadaLink": { + "ScadaBridge": { "Node": { "Role": "Site", "NodeHostname": "site-01-a.example.com", @@ -110,8 +110,8 @@ Each site has its own two-node cluster: }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@site-01-a.example.com:8081", - "akka.tcp://scadalink@site-01-b.example.com:8081" + "akka.tcp://scadabridge@site-01-a.example.com:8081", + "akka.tcp://scadabridge@site-01-b.example.com:8081" ] } } diff --git a/docs/operations/failover-procedures.md b/docs/operations/failover-procedures.md index c5715bff..5263915c 100644 --- a/docs/operations/failover-procedures.md +++ b/docs/operations/failover-procedures.md @@ -1,4 +1,4 @@ -# ScadaLink Failover Procedures +# ScadaBridge Failover Procedures ## Automatic Failover (No Intervention Required) @@ -105,7 +105,7 @@ 1. Restore SQL Server access. 2. Central nodes will automatically reconnect (EF Core connection resiliency). 3. Verify `/health/ready` returns 200. -4. No manual intervention needed on ScadaLink nodes. +4. No manual intervention needed on ScadaBridge nodes. ### Scenario 5: Forced Singleton Migration @@ -113,7 +113,7 @@ **Procedure:** 1. Initiate graceful shutdown on the degraded node: - - Stop the Windows Service: `sc.exe stop ScadaLink-Central` + - Stop the Windows Service: `sc.exe stop ScadaBridge-Central` - CoordinatedShutdown will migrate singletons to the standby. 2. Wait for the standby to take over (check logs for "Singleton acquired"). 3. Fix the issue on the original node. diff --git a/docs/operations/maintenance-procedures.md b/docs/operations/maintenance-procedures.md index 2d891779..c9a5b61d 100644 --- a/docs/operations/maintenance-procedures.md +++ b/docs/operations/maintenance-procedures.md @@ -1,4 +1,4 @@ -# ScadaLink Maintenance Procedures +# ScadaBridge Maintenance Procedures ## SQL Server Maintenance (Central) @@ -17,7 +17,7 @@ ```sql -- Rebuild fragmented indexes on configuration database -USE ScadaLink; +USE ScadaBridge; EXEC sp_MSforeachtable 'ALTER INDEX ALL ON ? REBUILD WITH (ONLINE = ON)'; ``` @@ -43,8 +43,8 @@ Consider partitioning the AuditLogEntries table by month for efficient purging. ```sql -- Check database sizes -EXEC sp_helpdb 'ScadaLink'; -EXEC sp_helpdb 'ScadaLink_MachineData'; +EXEC sp_helpdb 'ScadaBridge'; +EXEC sp_helpdb 'ScadaBridge_MachineData'; -- Check table sizes SELECT @@ -72,7 +72,7 @@ ORDER BY TotalSpaceMB DESC; ```powershell # Check SQLite file sizes -Get-ChildItem C:\ScadaLink\data\*.db | Select-Object Name, @{N='SizeMB';E={[math]::Round($_.Length/1MB,2)}} +Get-ChildItem C:\ScadaBridge\data\*.db | Select-Object Name, @{N='SizeMB';E={[math]::Round($_.Length/1MB,2)}} ``` ### S&F Database Growth @@ -92,14 +92,14 @@ The S&F database has **no max buffer size** by design. During extended outages, SQLite does not reclaim disk space after deleting rows. Periodically vacuum: ```powershell -# Stop the ScadaLink service first -sc.exe stop ScadaLink-Site +# Stop the ScadaBridge service first +sc.exe stop ScadaBridge-Site # Vacuum the S&F database -sqlite3 C:\ScadaLink\data\store-and-forward.db "VACUUM;" +sqlite3 C:\ScadaBridge\data\store-and-forward.db "VACUUM;" # Restart the service -sc.exe start ScadaLink-Site +sc.exe start ScadaBridge-Site ``` **Important:** Only vacuum when the service is stopped. SQLite does not support concurrent vacuum. @@ -108,16 +108,16 @@ sc.exe start ScadaLink-Site ```powershell # Hot backup using SQLite backup API (safe while service is running) -sqlite3 C:\ScadaLink\data\site.db ".backup C:\Backups\site-$(Get-Date -Format yyyyMMdd).db" -sqlite3 C:\ScadaLink\data\store-and-forward.db ".backup C:\Backups\sf-$(Get-Date -Format yyyyMMdd).db" +sqlite3 C:\ScadaBridge\data\site.db ".backup C:\Backups\site-$(Get-Date -Format yyyyMMdd).db" +sqlite3 C:\ScadaBridge\data\store-and-forward.db ".backup C:\Backups\sf-$(Get-Date -Format yyyyMMdd).db" ``` ## Log Rotation ### Serilog File Sink -ScadaLink uses Serilog's rolling file sink with daily rotation: -- New file created each day: `scadalink-20260316.log` +ScadaBridge uses Serilog's rolling file sink with daily rotation: +- New file created each day: `scadabridge-20260316.log` - Files are not automatically deleted. ### Log Retention Policy @@ -126,16 +126,16 @@ Implement a scheduled task to delete old log files: ```powershell # Delete log files older than 30 days -Get-ChildItem C:\ScadaLink\logs\scadalink-*.log | +Get-ChildItem C:\ScadaBridge\logs\scadabridge-*.log | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force ``` Schedule this as a Windows Task: ```powershell -$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -Command `"Get-ChildItem C:\ScadaLink\logs\scadalink-*.log | Where-Object { `$_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force`"" +$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -Command `"Get-ChildItem C:\ScadaBridge\logs\scadabridge-*.log | Where-Object { `$_.LastWriteTime -lt (Get-Date).AddDays(-30) } | Remove-Item -Force`"" $trigger = New-ScheduledTaskTrigger -Daily -At "03:00" -Register-ScheduledTask -TaskName "ScadaLink-LogCleanup" -Action $action -Trigger $trigger -Description "Clean up ScadaLink log files older than 30 days" +Register-ScheduledTask -TaskName "ScadaBridge-LogCleanup" -Action $action -Trigger $trigger -Description "Clean up ScadaBridge log files older than 30 days" ``` ### Log Disk Space @@ -164,13 +164,13 @@ If event log storage is consuming excessive disk space: ```powershell # Stop the service -sc.exe stop ScadaLink-Site +sc.exe stop ScadaBridge-Site # Delete the event log database and let it be recreated -Remove-Item C:\ScadaLink\data\event-log.db +Remove-Item C:\ScadaBridge\data\event-log.db # Restart the service -sc.exe start ScadaLink-Site +sc.exe start ScadaBridge-Site ``` ## Certificate Management @@ -180,7 +180,7 @@ sc.exe start ScadaLink-Site If using LDAPS (port 636), the LDAP server's TLS certificate must be trusted: 1. Export the CA certificate from Active Directory. 2. Import into the Windows certificate store on both central nodes. -3. Restart the ScadaLink service. +3. Restart the ScadaBridge service. ### OPC UA Certificates diff --git a/docs/operations/troubleshooting-guide.md b/docs/operations/troubleshooting-guide.md index 6cc3c1fe..79c07b4f 100644 --- a/docs/operations/troubleshooting-guide.md +++ b/docs/operations/troubleshooting-guide.md @@ -1,10 +1,10 @@ -# ScadaLink Troubleshooting Guide +# ScadaBridge Troubleshooting Guide ## Log Analysis ### Log Location -- **File logs:** `C:\ScadaLink\logs\scadalink-YYYYMMDD.log` +- **File logs:** `C:\ScadaBridge\logs\scadabridge-YYYYMMDD.log` - **Console output:** Available when running interactively (not as a Windows Service) ### Log Format @@ -24,7 +24,7 @@ All log entries are enriched with: | Pattern | Meaning | |---------|---------| -| `Starting ScadaLink host as {Role}` | Node startup | +| `Starting ScadaBridge host as {Role}` | Node startup | | `Member joined` | Cluster peer connected | | `Member removed` | Cluster peer departed | | `Singleton acquired` | This node became the active singleton holder | @@ -41,13 +41,13 @@ Use the structured log properties for targeted analysis: ```powershell # Find all errors for a specific site -Select-String -Path "logs\scadalink-*.log" -Pattern "\[ERR\].*site-01" +Select-String -Path "logs\scadabridge-*.log" -Pattern "\[ERR\].*site-01" # Find S&F activity -Select-String -Path "logs\scadalink-*.log" -Pattern "store-and-forward|buffered|parked" +Select-String -Path "logs\scadabridge-*.log" -Pattern "store-and-forward|buffered|parked" # Find failover events -Select-String -Path "logs\scadalink-*.log" -Pattern "Singleton|Member joined|Member removed" +Select-String -Path "logs\scadabridge-*.log" -Pattern "Singleton|Member joined|Member removed" ``` ## Common Issues @@ -60,7 +60,7 @@ Select-String -Path "logs\scadalink-*.log" -Pattern "Singleton|Member joined|Mem 3. Health report interval has not elapsed since site startup. **Diagnosis:** -1. Check if the site service is running: `sc.exe query ScadaLink-Site` +1. Check if the site service is running: `sc.exe query ScadaBridge-Site` 2. Check site logs for errors. 3. Verify network: `Test-NetConnection -ComputerName central-01.example.com -Port 8081` 4. Wait 60 seconds (the offline detection threshold). diff --git a/docs/plans/2026-03-17-deploy-artifacts-remove-configdb.md b/docs/plans/2026-03-17-deploy-artifacts-remove-configdb.md index ef6e80e4..7fcf3174 100644 --- a/docs/plans/2026-03-17-deploy-artifacts-remove-configdb.md +++ b/docs/plans/2026-03-17-deploy-artifacts-remove-configdb.md @@ -13,7 +13,7 @@ ### Task 1: Create SiteExternalSystemRepository **Files:** -- Create: `src/ScadaLink.SiteRuntime/Repositories/SiteExternalSystemRepository.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteExternalSystemRepository.cs` **Step 1:** Create `SiteExternalSystemRepository` implementing `IExternalSystemRepository`. Read-only methods query `SiteStorageService` SQLite tables. Write methods throw `NotSupportedException` (site is read-only for these configs). @@ -36,7 +36,7 @@ The `external_systems` table stores `method_definitions` as JSON. Parse it into ### Task 2: Create SiteNotificationRepository **Files:** -- Create: `src/ScadaLink.SiteRuntime/Repositories/SiteNotificationRepository.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteNotificationRepository.cs` **Step 1:** Create `SiteNotificationRepository` implementing `INotificationRepository`. Read-only methods query `SiteStorageService` SQLite tables. @@ -75,9 +75,9 @@ CREATE TABLE IF NOT EXISTS smtp_configurations ( ### Task 3: Add data connections to DeployArtifactsCommand **Files:** -- Modify: `src/ScadaLink.Commons/Messages/Artifacts/DeployArtifactsCommand.cs` -- Modify: `src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs` (HandleDeployArtifacts) -- Modify: `src/ScadaLink.SiteRuntime/Persistence/SiteStorageService.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Artifacts/DeployArtifactsCommand.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs` (HandleDeployArtifacts) +- Modify: `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageService.cs` **Step 1:** Add `DataConnectionArtifact` record and include it in `DeployArtifactsCommand`: @@ -115,9 +115,9 @@ CREATE TABLE IF NOT EXISTS data_connection_definitions ( ### Task 4: Wire site-local repositories into DI **Files:** -- Modify: `src/ScadaLink.Host/Program.cs` (Site role, lines ~155-160) -- Modify: `src/ScadaLink.Host/appsettings.Site.json` -- Modify: `src/ScadaLink.SiteRuntime/ServiceCollectionExtensions.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs` (Site role, lines ~155-160) +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json` +- Modify: `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ServiceCollectionExtensions.cs` **Step 1:** In `ServiceCollectionExtensions.AddSiteRuntime()`, register the site-local repositories: @@ -139,7 +139,7 @@ services.AddScoped(); ### Task 5: Add Deploy Artifacts button to Sites admin page **Files:** -- Modify: `src/ScadaLink.CentralUI/Components/Pages/Admin/Sites.razor` +- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Sites.razor` **Step 1:** Inject `ArtifactDeploymentService` and add a "Deploy Artifacts" button in each site's action column (next to Edit/Delete). @@ -160,7 +160,7 @@ services.AddScoped(); ### Task 6: Update ArtifactDeploymentService to include all artifact types **Files:** -- Modify: `src/ScadaLink.DeploymentManager/ArtifactDeploymentService.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.DeploymentManager/ArtifactDeploymentService.cs` **Step 1:** Inject `ISiteRepository` (for data connections) and `INotificationRepository` (for SMTP configs). Update the command-building logic to include: - Data connections from `ISiteRepository.GetAllDataConnectionsAsync()` diff --git a/docs/plans/2026-03-17-management-service-cli.md b/docs/plans/2026-03-17-management-service-cli.md index e78dcdb2..0a7768f0 100644 --- a/docs/plans/2026-03-17-management-service-cli.md +++ b/docs/plans/2026-03-17-management-service-cli.md @@ -13,11 +13,11 @@ ### Task 1: Create ManagementService project and test project **Files:** -- Create: `src/ScadaLink.ManagementService/ScadaLink.ManagementService.csproj` -- Create: `src/ScadaLink.ManagementService/ServiceCollectionExtensions.cs` -- Create: `src/ScadaLink.ManagementService/ManagementServiceOptions.cs` -- Create: `tests/ScadaLink.ManagementService.Tests/ScadaLink.ManagementService.Tests.csproj` -- Modify: `ScadaLink.slnx` — add both projects +- Create: `src/ZB.MOM.WW.ScadaBridge.ManagementService/ZB.MOM.WW.ScadaBridge.ManagementService.csproj` +- Create: `src/ZB.MOM.WW.ScadaBridge.ManagementService/ServiceCollectionExtensions.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementServiceOptions.cs` +- Create: `tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests.csproj` +- Modify: `ZB.MOM.WW.ScadaBridge.slnx` — add both projects **Step 1:** Create the csproj following the existing pattern (net10.0, TreatWarningsAsErrors, ImplicitUsings). Reference Commons plus all service component projects needed: TemplateEngine, DeploymentManager, Communication, ExternalSystemGateway, NotificationService, Security, HealthMonitoring. Add Akka.Cluster.Tools 1.5.62. @@ -25,9 +25,9 @@ **Step 3:** Create the test project csproj (xUnit, NSubstitute, reference ManagementService + Commons). -**Step 4:** Add both projects to `ScadaLink.slnx`. +**Step 4:** Add both projects to `ZB.MOM.WW.ScadaBridge.slnx`. -**Step 5:** Build: `dotnet build ScadaLink.slnx` +**Step 5:** Build: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` **Step 6:** Commit: `feat: scaffold ManagementService project and test project` @@ -36,18 +36,18 @@ ### Task 2: Define management message contracts in Commons **Files:** -- Create: `src/ScadaLink.Commons/Messages/Management/ManagementEnvelope.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/ManagementResponse.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/TemplateCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/InstanceCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/SiteCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/DataConnectionCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/DeploymentCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/ExternalSystemCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/NotificationCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/SecurityCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/AuditLogCommands.cs` -- Create: `src/ScadaLink.Commons/Messages/Management/HealthCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/ManagementEnvelope.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/ManagementResponse.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/TemplateCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/InstanceCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/SiteCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/DataConnectionCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/DeploymentCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/ExternalSystemCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/NotificationCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/SecurityCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/AuditLogCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/HealthCommands.cs` **Step 1:** Create `ManagementEnvelope.cs` — wrapper record carrying `AuthenticatedUser` (username, displayName, roles, permittedSiteIds) and the inner command: ```csharp @@ -67,7 +67,7 @@ public record ManagementUnauthorized(string CorrelationId, string Message); - `InstanceCommands.cs`: `ListInstancesCommand(int? SiteId, int? TemplateId)`, `CreateInstanceCommand(string Name, int TemplateId, int SiteId)`, `DeployInstanceCommand(int InstanceId)`, `EnableInstanceCommand(int InstanceId)`, etc. - Continue for all 10 message groups from the component doc. -**Step 4:** Build: `dotnet build ScadaLink.slnx` +**Step 4:** Build: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` **Step 5:** Commit: `feat: define management message contracts in Commons` @@ -76,7 +76,7 @@ public record ManagementUnauthorized(string CorrelationId, string Message); ### Task 3: Implement ManagementActor **Files:** -- Create: `src/ScadaLink.ManagementService/ManagementActor.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs` **Step 1:** Create `ManagementActor` extending `ReceiveActor`. Constructor takes `IServiceProvider` (to resolve scoped services per request). Register `Receive` handler. @@ -89,7 +89,7 @@ public record ManagementUnauthorized(string CorrelationId, string Message); **Step 3:** Implement handler methods for each command group. Each handler follows the same pattern — resolve service from scope, call the existing service method, wrap result in response. Start with Templates and Instances as they're the most exercised. -**Step 4:** Build: `dotnet build ScadaLink.slnx` +**Step 4:** Build: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` **Step 5:** Commit: `feat: implement ManagementActor with all command handlers` @@ -98,9 +98,9 @@ public record ManagementUnauthorized(string CorrelationId, string Message); ### Task 4: Register ManagementActor on Central and set up ClusterClientReceptionist **Files:** -- Modify: `src/ScadaLink.Host/Actors/AkkaHostedService.cs` — RegisterCentralActors -- Modify: `src/ScadaLink.Host/Program.cs` — Central role, add `services.AddManagementService()` -- Modify: `src/ScadaLink.ManagementService/ServiceCollectionExtensions.cs` — ensure DI is wired +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs` — RegisterCentralActors +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs` — Central role, add `services.AddManagementService()` +- Modify: `src/ZB.MOM.WW.ScadaBridge.ManagementService/ServiceCollectionExtensions.cs` — ensure DI is wired **Step 1:** In `RegisterCentralActors()`, after creating CentralCommunicationActor: ```csharp @@ -123,15 +123,15 @@ _logger.LogInformation("ManagementActor registered with ClusterClientReceptionis ### Task 5: Create CLI project with System.CommandLine scaffolding **Files:** -- Create: `src/ScadaLink.CLI/ScadaLink.CLI.csproj` -- Create: `src/ScadaLink.CLI/Program.cs` -- Create: `src/ScadaLink.CLI/CliConfig.cs` -- Create: `src/ScadaLink.CLI/ClusterConnection.cs` -- Modify: `ScadaLink.slnx` — add CLI project +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/ZB.MOM.WW.ScadaBridge.CLI.csproj` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Program.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/CliConfig.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/ClusterConnection.cs` +- Modify: `ZB.MOM.WW.ScadaBridge.slnx` — add CLI project **Step 1:** Create csproj as console app. Reference Commons (for messages), Akka + Akka.Remote + Akka.Cluster.Tools (for ClusterClient), System.CommandLine, Novell.Directory.Ldap.NETStandard (for LDAP auth — same lib used by Security component). -**Step 2:** Create `CliConfig.cs` — reads config from env vars, `~/.scadalink/config.json`, and CLI options. Properties: ContactPoints, LdapServer, LdapPort, LdapUseTls, DefaultFormat. +**Step 2:** Create `CliConfig.cs` — reads config from env vars, `~/.scadabridge/config.json`, and CLI options. Properties: ContactPoints, LdapServer, LdapPort, LdapUseTls, DefaultFormat. **Step 3:** Create `ClusterConnection.cs` — manages the ActorSystem and ClusterClient lifecycle: ```csharp @@ -145,7 +145,7 @@ public class ClusterConnection : IAsyncDisposable **Step 4:** Create `Program.cs` with root command, global options (`--contact-points`, `--username`, `--password`, `--format`), and placeholder subcommands. Wire up LDAP auth flow in the root handler. -**Step 5:** Add to `ScadaLink.slnx`. Build: `dotnet build ScadaLink.slnx`. +**Step 5:** Add to `ZB.MOM.WW.ScadaBridge.slnx`. Build: `dotnet build ZB.MOM.WW.ScadaBridge.slnx`. **Step 6:** Commit: `feat: scaffold CLI project with ClusterClient connection` @@ -154,17 +154,17 @@ public class ClusterConnection : IAsyncDisposable ### Task 6: Implement CLI command groups **Files:** -- Create: `src/ScadaLink.CLI/Commands/TemplateCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/InstanceCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/SiteCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/DeployCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/DataConnectionCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/ExternalSystemCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/NotificationCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/SecurityCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/AuditLogCommands.cs` -- Create: `src/ScadaLink.CLI/Commands/HealthCommands.cs` -- Create: `src/ScadaLink.CLI/OutputFormatter.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/TemplateCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/InstanceCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/SiteCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DeployCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DataConnectionCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/ExternalSystemCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/NotificationCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/SecurityCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/AuditLogCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/HealthCommands.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CLI/OutputFormatter.cs` **Step 1:** Create `OutputFormatter.cs` — handles JSON and table output: ```csharp @@ -182,7 +182,7 @@ public static class OutputFormatter **Step 3:** Register all command groups in Program.cs root command. -**Step 4:** Build: `dotnet build ScadaLink.slnx` +**Step 4:** Build: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` **Step 5:** Commit: `feat: implement all CLI command groups` @@ -191,7 +191,7 @@ public static class OutputFormatter ### Task 7: Write ManagementActor unit tests **Files:** -- Create: `tests/ScadaLink.ManagementService.Tests/ManagementActorTests.cs` +- Create: `tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorTests.cs` **Step 1:** Test authorization enforcement — send commands without required role, verify `ManagementUnauthorized` response. @@ -199,7 +199,7 @@ public static class OutputFormatter **Step 3:** Test instance operations — mock services, send `CreateInstanceCommand`, verify delegation. -**Step 4:** Run tests: `dotnet test tests/ScadaLink.ManagementService.Tests/` +**Step 4:** Run tests: `dotnet test tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/` **Step 5:** Commit: `test: add ManagementActor unit tests` @@ -209,7 +209,7 @@ public static class OutputFormatter **Step 1:** Start Central with ManagementActor registered. Verify log shows "ManagementActor registered with ClusterClientReceptionist". -**Step 2:** Run CLI: `dotnet run --project src/ScadaLink.CLI -- --contact-points akka.tcp://scadalink@localhost:8081 --username admin --password password template list` +**Step 2:** Run CLI: `dotnet run --project src/ZB.MOM.WW.ScadaBridge.CLI -- --contact-points akka.tcp://scadabridge@localhost:8081 --username admin --password password template list` **Step 3:** Verify CLI connects, authenticates, sends command, receives response, prints templates. diff --git a/docs/plans/2026-03-21-grpc-streaming-channel.md b/docs/plans/2026-03-21-grpc-streaming-channel.md index ee7992c1..23a32e54 100644 --- a/docs/plans/2026-03-21-grpc-streaming-channel.md +++ b/docs/plans/2026-03-21-grpc-streaming-channel.md @@ -15,17 +15,17 @@ ### Task 0: Proto Definition & Stub Generation **Files:** -- Create: `src/ScadaLink.Communication/Protos/sitestream.proto` -- Create: `src/ScadaLink.Communication/SiteStreamGrpc/` (generated stubs) -- Modify: `src/ScadaLink.Communication/ScadaLink.Communication.csproj` +- Create: `src/ZB.MOM.WW.ScadaBridge.Communication/Protos/sitestream.proto` +- Create: `src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/` (generated stubs) +- Modify: `src/ZB.MOM.WW.ScadaBridge.Communication/ZB.MOM.WW.ScadaBridge.Communication.csproj` **Step 1: Create the proto file** -Create `src/ScadaLink.Communication/Protos/sitestream.proto` with the proto definition from `docs/plans/grpc_streams.md` "Proto Improvements" section (V1 review notes version with enums and `google.protobuf.Timestamp`): +Create `src/ZB.MOM.WW.ScadaBridge.Communication/Protos/sitestream.proto` with the proto definition from `docs/plans/grpc_streams.md` "Proto Improvements" section (V1 review notes version with enums and `google.protobuf.Timestamp`): ```protobuf syntax = "proto3"; -option csharp_namespace = "ScadaLink.Communication.Grpc"; +option csharp_namespace = "ZB.MOM.WW.ScadaBridge.Communication.Grpc"; package sitestream; import "google/protobuf/timestamp.proto"; @@ -80,7 +80,7 @@ message AlarmStateUpdate { **Step 2: Add gRPC NuGet packages** -Add to `src/ScadaLink.Communication/ScadaLink.Communication.csproj`: +Add to `src/ZB.MOM.WW.ScadaBridge.Communication/ZB.MOM.WW.ScadaBridge.Communication.csproj`: ```xml @@ -92,16 +92,16 @@ Also add `` if not alre **Step 3: Generate C# stubs** -Run `protoc` locally to generate stubs. Check generated files into `src/ScadaLink.Communication/SiteStreamGrpc/` — pre-generated and checked in, no `protoc` at build time. +Run `protoc` locally to generate stubs. Check generated files into `src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/` — pre-generated and checked in, no `protoc` at build time. **Step 4: Verify build** -Run: `dotnet build src/ScadaLink.Communication/` +Run: `dotnet build src/ZB.MOM.WW.ScadaBridge.Communication/` Expected: Build succeeded, 0 errors **Step 5: Write proto roundtrip tests** -Create `tests/ScadaLink.Communication.Tests/Grpc/ProtoRoundtripTests.cs`: +Create `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoRoundtripTests.cs`: - Test `AttributeValueUpdate` serialization/deserialization with all Quality enum values - Test `AlarmStateUpdate` serialization/deserialization with all AlarmStateEnum values - Test `SiteStreamEvent` oneof discrimination (attribute vs alarm) @@ -109,13 +109,13 @@ Create `tests/ScadaLink.Communication.Tests/Grpc/ProtoRoundtripTests.cs`: **Step 6: Run tests** -Run: `dotnet test tests/ScadaLink.Communication.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` Expected: All pass including new proto tests **Step 7: Commit** ```bash -git add src/ScadaLink.Communication/Protos/ src/ScadaLink.Communication/SiteStreamGrpc/ src/ScadaLink.Communication/ScadaLink.Communication.csproj tests/ScadaLink.Communication.Tests/ +git add src/ZB.MOM.WW.ScadaBridge.Communication/Protos/ src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/ src/ZB.MOM.WW.ScadaBridge.Communication/ZB.MOM.WW.ScadaBridge.Communication.csproj tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ git commit -m "feat: add sitestream.proto definition and generated gRPC stubs" ``` @@ -124,10 +124,10 @@ git commit -m "feat: add sitestream.proto definition and generated gRPC stubs" ### Task 1: Site Config — GrpcPort in NodeOptions **Files:** -- Modify: `src/ScadaLink.Host/NodeOptions.cs:8` -- Modify: `src/ScadaLink.Host/StartupValidator.cs:43-48` -- Modify: `src/ScadaLink.Host/appsettings.Site.json:7` -- Test: `tests/ScadaLink.Host.Tests/` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/NodeOptions.cs:8` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs:43-48` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json:7` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Host.Tests/` **Step 1: Write failing test for GrpcPort validation** @@ -135,44 +135,44 @@ Add to existing startup validator tests: test that a site node with `GrpcPort` o **Step 2: Run test to verify it fails** -Run: `dotnet test tests/ScadaLink.Host.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Host.Tests/` Expected: New test FAILS (GrpcPort not validated yet) **Step 3: Add GrpcPort to NodeOptions** -In `src/ScadaLink.Host/NodeOptions.cs`, add: +In `src/ZB.MOM.WW.ScadaBridge.Host/NodeOptions.cs`, add: ```csharp public int GrpcPort { get; set; } = 8083; ``` **Step 4: Add validation in StartupValidator** -In `src/ScadaLink.Host/StartupValidator.cs`, after the existing site validation block (line ~43): +In `src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs`, after the existing site validation block (line ~43): ```csharp if (role == "Site") { var grpcPortStr = nodeSection["GrpcPort"]; if (grpcPortStr != null && (!int.TryParse(grpcPortStr, out var gp) || gp < 1 || gp > 65535)) - errors.Add("ScadaLink:Node:GrpcPort must be 1-65535"); + errors.Add("ScadaBridge:Node:GrpcPort must be 1-65535"); } ``` **Step 5: Add GrpcPort to appsettings.Site.json** -In `src/ScadaLink.Host/appsettings.Site.json`, add after `"RemotingPort": 8082`: +In `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json`, add after `"RemotingPort": 8082`: ```json "GrpcPort": 8083 ``` **Step 6: Run tests** -Run: `dotnet test tests/ScadaLink.Host.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Host.Tests/` Expected: All pass **Step 7: Commit** ```bash -git add src/ScadaLink.Host/ tests/ScadaLink.Host.Tests/ +git add src/ZB.MOM.WW.ScadaBridge.Host/ tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ git commit -m "feat: add GrpcPort config to NodeOptions with startup validation" ``` @@ -181,17 +181,17 @@ git commit -m "feat: add GrpcPort config to NodeOptions with startup validation" ### Task 2: Site Entity — gRPC Address Fields **Files:** -- Modify: `src/ScadaLink.Commons/Entities/Sites/Site.cs:9-10` -- Modify: `src/ScadaLink.Commons/Messages/Management/SiteCommands.cs:5-6` -- Modify: `src/ScadaLink.ConfigurationDatabase/` (migration) -- Modify: `src/ScadaLink.ManagementService/ManagementActor.cs` (handlers) -- Modify: `src/ScadaLink.CLI/Commands/SiteCommands.cs` -- Modify: `src/ScadaLink.CentralUI/Components/Pages/Admin/Sites.razor` -- Test: `tests/ScadaLink.Commons.Tests/` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Sites/Site.cs:9-10` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/SiteCommands.cs:5-6` +- Modify: `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/` (migration) +- Modify: `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs` (handlers) +- Modify: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/SiteCommands.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Sites.razor` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/` **Step 1: Add fields to Site entity** -In `src/ScadaLink.Commons/Entities/Sites/Site.cs`, add after `NodeBAddress`: +In `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Sites/Site.cs`, add after `NodeBAddress`: ```csharp public string? GrpcNodeAAddress { get; set; } public string? GrpcNodeBAddress { get; set; } @@ -199,38 +199,38 @@ public string? GrpcNodeBAddress { get; set; } **Step 2: Update management commands** -In `src/ScadaLink.Commons/Messages/Management/SiteCommands.cs`, add `GrpcNodeAAddress` and `GrpcNodeBAddress` optional params to `CreateSiteCommand` and `UpdateSiteCommand`. +In `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/SiteCommands.cs`, add `GrpcNodeAAddress` and `GrpcNodeBAddress` optional params to `CreateSiteCommand` and `UpdateSiteCommand`. **Step 3: Add EF Core migration** -Run: `dotnet ef migrations add AddGrpcNodeAddresses --project src/ScadaLink.ConfigurationDatabase/ --startup-project src/ScadaLink.Host/` +Run: `dotnet ef migrations add AddGrpcNodeAddresses --project src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ --startup-project src/ZB.MOM.WW.ScadaBridge.Host/` Or create manual migration adding nullable `GrpcNodeAAddress` and `GrpcNodeBAddress` string columns to Sites table. **Step 4: Update ManagementActor handlers** -In `src/ScadaLink.ManagementService/ManagementActor.cs`, update `HandleCreateSite` and `HandleUpdateSite` to pass gRPC addresses to the repository. +In `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs`, update `HandleCreateSite` and `HandleUpdateSite` to pass gRPC addresses to the repository. **Step 5: Update CLI SiteCommands** -In `src/ScadaLink.CLI/Commands/SiteCommands.cs`, add `--grpc-node-a-address` and `--grpc-node-b-address` options to `site create` and `site update` commands. +In `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/SiteCommands.cs`, add `--grpc-node-a-address` and `--grpc-node-b-address` options to `site create` and `site update` commands. **Step 6: Update Central UI Sites.razor** -In `src/ScadaLink.CentralUI/Components/Pages/Admin/Sites.razor`: +In `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/Sites.razor`: - Add `_formGrpcNodeAAddress` and `_formGrpcNodeBAddress` form fields - Add table columns for gRPC addresses - Wire into create/update handlers **Step 7: Run tests** -Run: `dotnet test tests/ScadaLink.Commons.Tests/ && dotnet test tests/ScadaLink.CLI.Tests/ && dotnet test tests/ScadaLink.Host.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.Host.Tests/` Expected: All pass **Step 8: Commit** ```bash -git add src/ScadaLink.Commons/ src/ScadaLink.ConfigurationDatabase/ src/ScadaLink.ManagementService/ src/ScadaLink.CLI/ src/ScadaLink.CentralUI/ +git add src/ZB.MOM.WW.ScadaBridge.Commons/ src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/ src/ZB.MOM.WW.ScadaBridge.ManagementService/ src/ZB.MOM.WW.ScadaBridge.CLI/ src/ZB.MOM.WW.ScadaBridge.CentralUI/ git commit -m "feat: add GrpcNodeAAddress/GrpcNodeBAddress to Site entity, CLI, and UI" ``` @@ -239,8 +239,8 @@ git commit -m "feat: add GrpcNodeAAddress/GrpcNodeBAddress to Site entity, CLI, ### Task 3: Site-Side gRPC Server — StreamRelayActor **Files:** -- Create: `src/ScadaLink.Communication/Grpc/StreamRelayActor.cs` -- Test: `tests/ScadaLink.Communication.Tests/Grpc/StreamRelayActorTests.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/StreamRelayActor.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs` **Step 1: Write failing test** @@ -248,12 +248,12 @@ Test that `StreamRelayActor` receives `AttributeValueChanged` and writes a corre **Step 2: Run test to verify it fails** -Run: `dotnet test tests/ScadaLink.Communication.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` Expected: FAIL (class doesn't exist) **Step 3: Implement StreamRelayActor** -Create `src/ScadaLink.Communication/Grpc/StreamRelayActor.cs`: +Create `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/StreamRelayActor.cs`: - `ReceiveActor` that receives `AttributeValueChanged` and `AlarmStateChanged` - Converts each to the proto `SiteStreamEvent` with correct enum mappings and `Timestamp` conversion - Writes to `ChannelWriter` via `TryWrite` @@ -261,13 +261,13 @@ Create `src/ScadaLink.Communication/Grpc/StreamRelayActor.cs`: **Step 4: Run tests** -Run: `dotnet test tests/ScadaLink.Communication.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` Expected: All pass **Step 5: Commit** ```bash -git add src/ScadaLink.Communication/Grpc/ tests/ScadaLink.Communication.Tests/ +git add src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/ tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ git commit -m "feat: add StreamRelayActor bridging Akka events to gRPC proto channel" ``` @@ -276,8 +276,8 @@ git commit -m "feat: add StreamRelayActor bridging Akka events to gRPC proto cha ### Task 4: Site-Side gRPC Server — SiteStreamGrpcServer **Files:** -- Create: `src/ScadaLink.Communication/Grpc/SiteStreamGrpcServer.cs` -- Test: `tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcServer.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs` **Step 1: Write failing tests** @@ -289,12 +289,12 @@ git commit -m "feat: add StreamRelayActor bridging Akka events to gRPC proto cha **Step 2: Run tests to verify they fail** -Run: `dotnet test tests/ScadaLink.Communication.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` Expected: FAIL **Step 3: Implement SiteStreamGrpcServer** -Create `src/ScadaLink.Communication/Grpc/SiteStreamGrpcServer.cs`: +Create `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcServer.cs`: - Inherits `SiteStreamService.SiteStreamServiceBase` - Injects `SiteStreamManager` (or interface), `ActorSystem` - Tracks active streams in `ConcurrentDictionary` @@ -304,13 +304,13 @@ Create `src/ScadaLink.Communication/Grpc/SiteStreamGrpcServer.cs`: **Step 4: Run tests** -Run: `dotnet test tests/ScadaLink.Communication.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` Expected: All pass **Step 5: Commit** ```bash -git add src/ScadaLink.Communication/Grpc/ tests/ScadaLink.Communication.Tests/ +git add src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/ tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ git commit -m "feat: add SiteStreamGrpcServer with Channel bridge and stream limits" ``` @@ -319,10 +319,10 @@ git commit -m "feat: add SiteStreamGrpcServer with Channel bridge and stream ### Task 5: Switch Site Host to WebApplicationBuilder + gRPC **Files:** -- Modify: `src/ScadaLink.Host/Program.cs:157-174` -- Modify: `src/ScadaLink.Host/appsettings.Site.json` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs:157-174` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json` - Modify: `docker/docker-compose.yml` -- Test: `tests/ScadaLink.Host.Tests/` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Host.Tests/` **Step 1: Write failing test** @@ -330,7 +330,7 @@ Site host startup test: verify `WebApplicationBuilder` starts, gRPC port is conf **Step 2: Switch site host from generic Host to WebApplicationBuilder** -In `src/ScadaLink.Host/Program.cs`, replace the `Host.CreateDefaultBuilder()` site section with `WebApplication.CreateBuilder()` + Kestrel HTTP/2 on `GrpcPort` + `AddGrpc()` + `MapGrpcService()`. Keep all existing service registrations via `SiteServiceRegistration.Configure()`. +In `src/ZB.MOM.WW.ScadaBridge.Host/Program.cs`, replace the `Host.CreateDefaultBuilder()` site section with `WebApplication.CreateBuilder()` + Kestrel HTTP/2 on `GrpcPort` + `AddGrpc()` + `MapGrpcService()`. Keep all existing service registrations via `SiteServiceRegistration.Configure()`. Add gRPC keepalive settings from `CommunicationOptions`: - `KeepAlivePingDelay = 15s` @@ -345,7 +345,7 @@ Expose gRPC port 8083 for each site node: **Step 4: Add gRPC keepalive config to CommunicationOptions** -Add to `src/ScadaLink.Communication/CommunicationOptions.cs`: +Add to `src/ZB.MOM.WW.ScadaBridge.Communication/CommunicationOptions.cs`: ```csharp public TimeSpan GrpcKeepAlivePingDelay { get; set; } = TimeSpan.FromSeconds(15); public TimeSpan GrpcKeepAlivePingTimeout { get; set; } = TimeSpan.FromSeconds(10); @@ -355,13 +355,13 @@ public int GrpcMaxConcurrentStreams { get; set; } = 100; **Step 5: Run tests and build** -Run: `dotnet build src/ScadaLink.Host/ && dotnet test tests/ScadaLink.Host.Tests/` +Run: `dotnet build src/ZB.MOM.WW.ScadaBridge.Host/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.Host.Tests/` Expected: All pass **Step 6: Commit** ```bash -git add src/ScadaLink.Host/ src/ScadaLink.Communication/ docker/ +git add src/ZB.MOM.WW.ScadaBridge.Host/ src/ZB.MOM.WW.ScadaBridge.Communication/ docker/ git commit -m "feat: switch site host to WebApplicationBuilder with Kestrel gRPC server" ``` @@ -370,10 +370,10 @@ git commit -m "feat: switch site host to WebApplicationBuilder with Kestrel gRPC ### Task 6: Central-Side gRPC Client **Files:** -- Create: `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClient.cs` -- Create: `src/ScadaLink.Communication/Grpc/SiteStreamGrpcClientFactory.cs` -- Test: `tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs` -- Test: `tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClientFactory.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs` **Step 1: Write failing tests for SiteStreamGrpcClient** @@ -402,13 +402,13 @@ git commit -m "feat: switch site host to WebApplicationBuilder with Kestrel gRPC **Step 5: Run tests** -Run: `dotnet test tests/ScadaLink.Communication.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` Expected: All pass **Step 6: Commit** ```bash -git add src/ScadaLink.Communication/Grpc/ tests/ScadaLink.Communication.Tests/ +git add src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/ tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ git commit -m "feat: add SiteStreamGrpcClient and SiteStreamGrpcClientFactory" ``` @@ -417,10 +417,10 @@ git commit -m "feat: add SiteStreamGrpcClient and SiteStreamGrpcClientFactory" ### Task 7: Update DebugStreamBridgeActor to Use gRPC **Files:** -- Modify: `src/ScadaLink.Communication/Actors/DebugStreamBridgeActor.cs` -- Modify: `src/ScadaLink.Communication/DebugStreamService.cs` -- Modify: `src/ScadaLink.Communication/ServiceCollectionExtensions.cs` -- Test: `tests/ScadaLink.Communication.Tests/` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/DebugStreamBridgeActor.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Communication/DebugStreamService.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Communication/ServiceCollectionExtensions.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` **Step 1: Write failing tests for updated bridge actor** @@ -446,20 +446,20 @@ Inject `SiteStreamGrpcClientFactory`. Resolve `GrpcNodeAAddress`/`GrpcNodeBAddre **Step 4: Register factory in DI** -In `src/ScadaLink.Communication/ServiceCollectionExtensions.cs`: +In `src/ZB.MOM.WW.ScadaBridge.Communication/ServiceCollectionExtensions.cs`: ```csharp services.AddSingleton(); ``` **Step 5: Run tests** -Run: `dotnet test tests/ScadaLink.Communication.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/` Expected: All pass **Step 6: Commit** ```bash -git add src/ScadaLink.Communication/ tests/ScadaLink.Communication.Tests/ +git add src/ZB.MOM.WW.ScadaBridge.Communication/ tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ git commit -m "feat: update DebugStreamBridgeActor to use gRPC for streaming events" ``` @@ -468,12 +468,12 @@ git commit -m "feat: update DebugStreamBridgeActor to use gRPC for streaming eve ### Task 8: Remove ClusterClient Streaming Path **Files:** -- Modify: `src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs` -- Modify: `src/ScadaLink.Communication/Actors/SiteCommunicationActor.cs` -- Modify: `src/ScadaLink.Communication/Actors/CentralCommunicationActor.cs` -- Delete: `src/ScadaLink.Commons/Messages/DebugView/DebugStreamEvent.cs` -- Test: `tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs` -- Test: `tests/ScadaLink.Commons.Tests/ArchitecturalConstraintTests.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/SiteCommunicationActor.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Communication/Actors/CentralCommunicationActor.cs` +- Delete: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/DebugView/DebugStreamEvent.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ArchitecturalConstraintTests.cs` **Step 1: Remove DebugStreamEvent from InstanceActor** @@ -491,7 +491,7 @@ Remove `Receive` handler and `HandleDebugStreamEvent` method. **Step 4: Delete DebugStreamEvent.cs** -Delete `src/ScadaLink.Commons/Messages/DebugView/DebugStreamEvent.cs`. +Delete `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/DebugView/DebugStreamEvent.cs`. **Step 5: Update InstanceActorIntegrationTests** @@ -499,11 +499,11 @@ Remove `DebugStreamEventForwarder` test helper. Update debug subscriber tests to **Step 6: Add architectural constraint test** -In `tests/ScadaLink.Commons.Tests/ArchitecturalConstraintTests.cs`, add test verifying `DebugStreamEvent` type no longer exists in the Commons assembly. +In `tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ArchitecturalConstraintTests.cs`, add test verifying `DebugStreamEvent` type no longer exists in the Commons assembly. **Step 7: Run full test suite** -Run: `dotnet test tests/ScadaLink.SiteRuntime.Tests/ && dotnet test tests/ScadaLink.Communication.Tests/ && dotnet test tests/ScadaLink.Commons.Tests/ && dotnet test tests/ScadaLink.Host.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.Host.Tests/` Expected: All pass **Step 8: Commit** @@ -520,7 +520,7 @@ git commit -m "refactor: remove ClusterClient streaming path (DebugStreamEvent), **Files:** - Modify: `docker/docker-compose.yml` - Modify: `docker/deploy.sh` (if needed) -- Create: `tests/ScadaLink.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs` +- Create: `tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs` **Step 1: Update docker-compose site appsettings** @@ -537,7 +537,7 @@ Expected: All containers start, gRPC ports exposed **Step 4: Manual end-to-end verification** -Run: `timeout 35 dotnet run --project src/ScadaLink.CLI -- --url http://localhost:9000 --username multi-role --password password debug stream --id 1 --format table` +Run: `timeout 35 dotnet run --project src/ZB.MOM.WW.ScadaBridge.CLI -- --url http://localhost:9000 --username multi-role --password password debug stream --id 1 --format table` Expected: Initial snapshot + streaming ATTR/ALARM rows via gRPC (not ClusterClient). @@ -549,7 +549,7 @@ python3 infra/tools/opcua_tool.py write --node "ns=3;s=JoeAppEngine.BTCS" --valu **Step 5: Commit** ```bash -git add tests/ScadaLink.IntegrationTests/ docker/ +git add tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ docker/ git commit -m "test: add gRPC stream integration test and docker config" ``` @@ -606,8 +606,8 @@ git commit -m "docs: update requirements and architecture for gRPC streaming cha ### Task 11: Final Guardrail Tests **Files:** -- Test: `tests/ScadaLink.Communication.Tests/Grpc/ProtoContractTests.cs` -- Test: `tests/ScadaLink.Communication.Tests/Grpc/CleanupVerificationTests.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoContractTests.cs` +- Test: `tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/CleanupVerificationTests.cs` **Step 1: Proto contract test** @@ -623,7 +623,7 @@ Integration test that subscribes via gRPC, triggers changes, and verifies events **Step 4: Run full test suite** -Run: `dotnet test tests/ScadaLink.Host.Tests/ && dotnet test tests/ScadaLink.Communication.Tests/ && dotnet test tests/ScadaLink.SiteRuntime.Tests/ && dotnet test tests/ScadaLink.Commons.Tests/ && dotnet test tests/ScadaLink.CLI.Tests/ && dotnet test tests/ScadaLink.ManagementService.Tests/` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ && dotnet test tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/` Expected: All pass, zero warnings **Step 5: Commit** diff --git a/docs/plans/2026-03-22-primary-backup-data-connections.md b/docs/plans/2026-03-22-primary-backup-data-connections.md index 571106bd..ba8ed878 100644 --- a/docs/plans/2026-03-22-primary-backup-data-connections.md +++ b/docs/plans/2026-03-22-primary-backup-data-connections.md @@ -15,9 +15,9 @@ ## Task 1: Entity Model & Database Migration **Files:** -- Modify: `src/ScadaLink.Commons/Entities/Sites/DataConnection.cs` -- Modify: `src/ScadaLink.ConfigurationDatabase/Configurations/SiteConfiguration.cs` (lines 32-56) -- Modify: `src/ScadaLink.Commons/Messages/Artifacts/DataConnectionArtifact.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Sites/DataConnection.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase/Configurations/SiteConfiguration.cs` (lines 32-56) +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Artifacts/DataConnectionArtifact.cs` ### Step 1: Update DataConnection entity @@ -61,9 +61,9 @@ builder.Property(d => d.FailoverRetryCount).HasDefaultValue(3); Run: ```bash -cd src/ScadaLink.ConfigurationDatabase +cd src/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase dotnet ef migrations add AddDataConnectionBackupEndpoint \ - --startup-project ../ScadaLink.Host + --startup-project ../ZB.MOM.WW.ScadaBridge.Host ``` Verify the migration renames `Configuration` → `PrimaryConfiguration` (should use `RenameColumn`, not drop+add). If the scaffolded migration drops and recreates, manually fix it: @@ -102,7 +102,7 @@ public record DataConnectionArtifact( ### Step 5: Build and fix compile errors -Run: `dotnet build ScadaLink.slnx` +Run: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` This will surface all references to the old `Configuration` and `ConfigurationJson` fields across the codebase. Fix each one — this includes: - ManagementActor handlers @@ -115,7 +115,7 @@ Fix only the field name renames in this step (use `PrimaryConfiguration` where ` ### Step 6: Run tests, fix failures -Run: `dotnet test ScadaLink.slnx` +Run: `dotnet test ZB.MOM.WW.ScadaBridge.slnx` Fix any test failures caused by the rename. @@ -131,8 +131,8 @@ git commit -m "feat(dcl): rename Configuration to PrimaryConfiguration, add Back ## Task 2: Update CreateConnectionCommand & Manager Actor **Files:** -- Modify: `src/ScadaLink.Commons/Messages/DataConnection/CreateConnectionCommand.cs` -- Modify: `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionManagerActor.cs` (lines 39-62) +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/DataConnection/CreateConnectionCommand.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionManagerActor.cs` (lines 39-62) ### Step 1: Update CreateConnectionCommand message @@ -187,7 +187,7 @@ Search for all places that construct `CreateConnectionCommand` and update them t ### Step 4: Build and test -Run: `dotnet build ScadaLink.slnx && dotnet test tests/ScadaLink.DataConnectionLayer.Tests` +Run: `dotnet build ZB.MOM.WW.ScadaBridge.slnx && dotnet test tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests` ### Step 5: Commit @@ -201,8 +201,8 @@ git commit -m "feat(dcl): extend CreateConnectionCommand with backup config and ## Task 3: DataConnectionActor Failover State Machine **Files:** -- Modify: `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs` -- Modify: `src/ScadaLink.DataConnectionLayer/DataConnectionFactory.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/DataConnectionFactory.cs` This is the core change. The actor gains failover logic in its Reconnecting state. @@ -315,7 +315,7 @@ And update the DataConnectionActor constructor to store `_factory`. ### Step 5: Build and run existing tests -Run: `dotnet build ScadaLink.slnx && dotnet test tests/ScadaLink.DataConnectionLayer.Tests` +Run: `dotnet build ZB.MOM.WW.ScadaBridge.slnx && dotnet test tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests` Existing tests must pass (they use single-endpoint configs, so no failover triggered). @@ -331,7 +331,7 @@ git commit -m "feat(dcl): add failover state machine to DataConnectionActor with ## Task 4: Failover Tests **Files:** -- Modify: `tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionActorTests.cs` +- Modify: `tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionActorTests.cs` ### Step 1: Write test — failover after N retries @@ -409,7 +409,7 @@ public async Task Failover_ReSubscribesAllTagsOnNewAdapter() ### Step 6: Run all tests -Run: `dotnet test tests/ScadaLink.DataConnectionLayer.Tests -v` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests -v` ### Step 7: Commit @@ -423,8 +423,8 @@ git commit -m "test(dcl): add failover state machine tests for DataConnectionAct ## Task 5: Health Reporting & Site Event Logging **Files:** -- Modify: `src/ScadaLink.Commons/Messages/DataConnection/DataConnectionHealthReport.cs` -- Modify: `src/ScadaLink.DataConnectionLayer/Actors/DataConnectionActor.cs` (ReplyWithHealthReport, HandleReconnectResult) +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/DataConnection/DataConnectionHealthReport.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Actors/DataConnectionActor.cs` (ReplyWithHealthReport, HandleReconnectResult) ### Step 1: Add ActiveEndpoint to health report @@ -489,7 +489,7 @@ if (_siteEventLogger != null) ### Step 5: Build and test -Run: `dotnet build ScadaLink.slnx && dotnet test tests/ScadaLink.DataConnectionLayer.Tests` +Run: `dotnet build ZB.MOM.WW.ScadaBridge.slnx && dotnet test tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests` ### Step 6: Commit @@ -503,8 +503,8 @@ git commit -m "feat(dcl): add active endpoint to health reports and log failover ## Task 6: Central UI Changes **Files:** -- Modify: `src/ScadaLink.CentralUI/Components/Pages/Admin/DataConnections.razor` -- Modify: `src/ScadaLink.CentralUI/Components/Pages/Admin/DataConnectionForm.razor` +- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/DataConnections.razor` +- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Admin/DataConnectionForm.razor` ### Step 1: Update DataConnections list page @@ -570,7 +570,7 @@ In edit mode, set `_showBackup = true` if `BackupConfiguration` is not null. ### Step 5: Build and verify visually -Run: `dotnet build ScadaLink.slnx` +Run: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` Visual verification requires running the cluster — document as manual test. @@ -586,9 +586,9 @@ git commit -m "feat(ui): add primary/backup endpoint fields to data connection f ## Task 7: CLI, Management API, and Deployment **Files:** -- Modify: `src/ScadaLink.Commons/Messages/Management/DataConnectionCommands.cs` -- Modify: `src/ScadaLink.CLI/Commands/DataConnectionCommands.cs` -- Modify: `src/ScadaLink.ManagementService/ManagementActor.cs` (lines 689-711) +- Modify: `src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Management/DataConnectionCommands.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.CLI/Commands/DataConnectionCommands.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs` (lines 689-711) - Modify: Deployment/flattening code that creates DataConnectionArtifact ### Step 1: Update management command messages @@ -631,11 +631,11 @@ Find where `DataConnectionArtifact` is constructed (in deployment/flattening cod ### Step 5: Build and test CLI -Run: `dotnet build ScadaLink.slnx` +Run: `dotnet build ZB.MOM.WW.ScadaBridge.slnx` Test CLI manually: ```bash -scadalink data-connection create --site-id 1 --name "Test" --protocol OpcUa \ +scadabridge data-connection create --site-id 1 --name "Test" --protocol OpcUa \ --primary-config '{"endpoint":"opc.tcp://localhost:50000"}' \ --backup-config '{"endpoint":"opc.tcp://localhost:50010"}' \ --failover-retry-count 3 diff --git a/docs/plans/2026-03-23-treeview-component.md b/docs/plans/2026-03-23-treeview-component.md index bb307928..ee018f75 100644 --- a/docs/plans/2026-03-23-treeview-component.md +++ b/docs/plans/2026-03-23-treeview-component.md @@ -13,19 +13,19 @@ ### Task 1: Create TreeView.razor — Core Rendering (R1, R2, R3, R4, R14) **Files:** -- Create: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor` +- Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor` **Step 1: Write the failing tests** Create test file with core rendering tests. -Create: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs` +Create: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs` ```csharp using Bunit; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; public class TreeViewTests : BunitContext { @@ -203,12 +203,12 @@ public class TreeViewTests : BunitContext **Step 2: Run tests to verify they fail** -Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal` Expected: Compilation error — `TreeView` component doesn't exist yet. **Step 3: Implement TreeView.razor** -Create: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor` +Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor` The component should: - Accept `@typeparam TItem` with all parameters from the API summary in the requirements doc. @@ -224,13 +224,13 @@ The component should: **Step 4: Run tests to verify they pass** -Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal` Expected: All tests PASS. **Step 5: Commit** ```bash -git add src/ScadaLink.CentralUI/Components/Shared/TreeView.razor tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs +git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs git commit -m "feat(ui): add TreeView component with core rendering, expand/collapse, ARIA (R1-R4, R14)" ``` @@ -239,8 +239,8 @@ git commit -m "feat(ui): add TreeView component with core rendering, expa ### Task 2: Add Selection Support (R5) **Files:** -- Modify: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor` -- Modify: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs` +- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor` +- Modify: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs` **Step 1: Write the failing tests** @@ -332,7 +332,7 @@ public void Selection_AriaSelected_SetOnSelectedNode() **Step 2: Run tests to verify they fail** -Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.Selection" -v minimal` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.Selection" -v minimal` Expected: FAIL **Step 3: Implement selection in TreeView.razor** @@ -345,13 +345,13 @@ Add to the component: **Step 4: Run tests to verify they pass** -Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests" -v minimal` Expected: All PASS. **Step 5: Commit** ```bash -git add src/ScadaLink.CentralUI/Components/Shared/TreeView.razor tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs +git add src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs git commit -m "feat(ui): add selection support to TreeView (R5)" ``` @@ -360,9 +360,9 @@ git commit -m "feat(ui): add selection support to TreeView (R5)" ### Task 3: Add Session Storage Persistence (R11) **Files:** -- Create: `src/ScadaLink.CentralUI/wwwroot/js/treeview-storage.js` -- Modify: `src/ScadaLink.CentralUI/Components/Shared/TreeView.razor` -- Modify: `tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs` +- Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/treeview-storage.js` +- Modify: `src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Shared/TreeView.razor` +- Modify: `tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs` **Step 1: Write the failing tests** @@ -426,12 +426,12 @@ public void SessionStorage_TakesPrecedenceOverInitiallyExpanded() **Step 2: Run tests to verify they fail** -Run: `dotnet test tests/ScadaLink.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.SessionStorage" -v minimal` +Run: `dotnet test tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ --filter "FullyQualifiedName~TreeViewTests.SessionStorage" -v minimal` Expected: FAIL **Step 3: Create JS interop file** -Create: `src/ScadaLink.CentralUI/wwwroot/js/treeview-storage.js` +Create: `src/ZB.MOM.WW.ScadaBridge.CentralUI/wwwroot/js/treeview-storage.js` ```javascript window.treeviewStorage = { @@ -458,13 +458,13 @@ Add a ` - - - - + + + + diff --git a/src/ScadaLink.Host/Components/Routes.razor b/src/ZB.MOM.WW.ScadaBridge.Host/Components/Routes.razor similarity index 78% rename from src/ScadaLink.Host/Components/Routes.razor rename to src/ZB.MOM.WW.ScadaBridge.Host/Components/Routes.razor index fabd23da..bb6fe2cb 100644 --- a/src/ScadaLink.Host/Components/Routes.razor +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Components/Routes.razor @@ -1,8 +1,8 @@ + AdditionalAssemblies="new[] { typeof(ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.MainLayout).Assembly }"> - + @if (context.User.Identity?.IsAuthenticated != true) { @@ -19,7 +19,7 @@ - +

Page Not Found

The requested page does not exist.

diff --git a/src/ScadaLink.Host/DatabaseOptions.cs b/src/ZB.MOM.WW.ScadaBridge.Host/DatabaseOptions.cs similarity index 82% rename from src/ScadaLink.Host/DatabaseOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/DatabaseOptions.cs index 6d3797c7..acf11b1f 100644 --- a/src/ScadaLink.Host/DatabaseOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/DatabaseOptions.cs @@ -1,7 +1,7 @@ -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// -/// Database connection string and path options bound from the ScadaLink:Database configuration section. +/// Database connection string and path options bound from the ScadaBridge:Database configuration section. /// public class DatabaseOptions { diff --git a/src/ScadaLink.Host/Health/ActiveNodeGate.cs b/src/ZB.MOM.WW.ScadaBridge.Host/Health/ActiveNodeGate.cs similarity index 94% rename from src/ScadaLink.Host/Health/ActiveNodeGate.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/Health/ActiveNodeGate.cs index 421bcb7f..c5fa790d 100644 --- a/src/ScadaLink.Host/Health/ActiveNodeGate.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Health/ActiveNodeGate.cs @@ -1,8 +1,8 @@ using Akka.Cluster; -using ScadaLink.Host.Actors; -using ScadaLink.InboundAPI; +using ZB.MOM.WW.ScadaBridge.Host.Actors; +using ZB.MOM.WW.ScadaBridge.InboundAPI; -namespace ScadaLink.Host.Health; +namespace ZB.MOM.WW.ScadaBridge.Host.Health; /// /// InboundAPI-008 / InboundAPI-022: production implementation of diff --git a/src/ScadaLink.Host/Health/ActiveNodeHealthCheck.cs b/src/ZB.MOM.WW.ScadaBridge.Host/Health/ActiveNodeHealthCheck.cs similarity index 95% rename from src/ScadaLink.Host/Health/ActiveNodeHealthCheck.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/Health/ActiveNodeHealthCheck.cs index 00858af1..6e887e3c 100644 --- a/src/ScadaLink.Host/Health/ActiveNodeHealthCheck.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Health/ActiveNodeHealthCheck.cs @@ -1,8 +1,8 @@ using Akka.Cluster; using Microsoft.Extensions.Diagnostics.HealthChecks; -using ScadaLink.Host.Actors; +using ZB.MOM.WW.ScadaBridge.Host.Actors; -namespace ScadaLink.Host.Health; +namespace ZB.MOM.WW.ScadaBridge.Host.Health; /// /// Health check that returns healthy only if this node is the active (leader) node diff --git a/src/ScadaLink.Host/Health/AkkaClusterHealthCheck.cs b/src/ZB.MOM.WW.ScadaBridge.Host/Health/AkkaClusterHealthCheck.cs similarity index 95% rename from src/ScadaLink.Host/Health/AkkaClusterHealthCheck.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/Health/AkkaClusterHealthCheck.cs index b55fc1fc..4356c7dd 100644 --- a/src/ScadaLink.Host/Health/AkkaClusterHealthCheck.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Health/AkkaClusterHealthCheck.cs @@ -1,8 +1,8 @@ using Akka.Cluster; using Microsoft.Extensions.Diagnostics.HealthChecks; -using ScadaLink.Host.Actors; +using ZB.MOM.WW.ScadaBridge.Host.Actors; -namespace ScadaLink.Host.Health; +namespace ZB.MOM.WW.ScadaBridge.Host.Health; /// /// Health check that verifies this node is an active member of the Akka.NET cluster. diff --git a/src/ScadaLink.Host/Health/AkkaClusterNodeProvider.cs b/src/ZB.MOM.WW.ScadaBridge.Host/Health/AkkaClusterNodeProvider.cs similarity index 93% rename from src/ScadaLink.Host/Health/AkkaClusterNodeProvider.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/Health/AkkaClusterNodeProvider.cs index ac067aa9..254c0728 100644 --- a/src/ScadaLink.Host/Health/AkkaClusterNodeProvider.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Health/AkkaClusterNodeProvider.cs @@ -1,10 +1,10 @@ using Akka.Actor; using Akka.Cluster; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.HealthMonitoring; -using ScadaLink.Host.Actors; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Host.Actors; -namespace ScadaLink.Host.Health; +namespace ZB.MOM.WW.ScadaBridge.Host.Health; /// /// Provides cluster node statuses from Akka.NET cluster membership for health reporting. diff --git a/src/ScadaLink.Host/Health/DatabaseHealthCheck.cs b/src/ZB.MOM.WW.ScadaBridge.Host/Health/DatabaseHealthCheck.cs similarity index 86% rename from src/ScadaLink.Host/Health/DatabaseHealthCheck.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/Health/DatabaseHealthCheck.cs index a0d20b6f..beb3c3cb 100644 --- a/src/ScadaLink.Host/Health/DatabaseHealthCheck.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Health/DatabaseHealthCheck.cs @@ -1,20 +1,20 @@ using Microsoft.Extensions.Diagnostics.HealthChecks; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.Host.Health; +namespace ZB.MOM.WW.ScadaBridge.Host.Health; /// /// Health check that verifies database connectivity for Central nodes. /// public class DatabaseHealthCheck : IHealthCheck { - private readonly ScadaLinkDbContext _dbContext; + private readonly ScadaBridgeDbContext _dbContext; /// /// Initializes a new . /// /// The EF Core database context used to test connectivity. - public DatabaseHealthCheck(ScadaLinkDbContext dbContext) + public DatabaseHealthCheck(ScadaBridgeDbContext dbContext) { _dbContext = dbContext; } diff --git a/src/ScadaLink.Host/LoggerConfigurationFactory.cs b/src/ZB.MOM.WW.ScadaBridge.Host/LoggerConfigurationFactory.cs similarity index 89% rename from src/ScadaLink.Host/LoggerConfigurationFactory.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/LoggerConfigurationFactory.cs index dcecda90..10da2c37 100644 --- a/src/ScadaLink.Host/LoggerConfigurationFactory.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/LoggerConfigurationFactory.cs @@ -1,13 +1,13 @@ using Serilog; using Serilog.Events; -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// /// Builds the Serilog for the Host process. /// /// REQ-HOST-8 / Host-011: the configured minimum level comes from -/// ScadaLink:Logging:MinimumLevel (bound to ) so an +/// ScadaBridge:Logging:MinimumLevel (bound to ) so an /// operator editing that key changes the effective log level. /// /// REQ-HOST-8 / Host-014: the console and file sinks are read from the standard @@ -16,7 +16,7 @@ namespace ScadaLink.Host; /// configuration-driven (defined in appsettings.json), not hard-coded. The /// explicit MinimumLevel.Is below pins the floor from . /// -/// Host-020: ScadaLink:Logging:MinimumLevel is the single source of truth +/// Host-020: ScadaBridge:Logging:MinimumLevel is the single source of truth /// for the floor — the explicit MinimumLevel.Is call deliberately runs /// AFTER ReadFrom.Configuration so a Serilog:MinimumLevel entry in /// configuration is overridden. To make that precedence visible (so an operator @@ -59,7 +59,7 @@ public static class LoggerConfigurationFactory TextWriter warningWriter) { var loggingOptions = new LoggingOptions(); - configuration.GetSection("ScadaLink:Logging").Bind(loggingOptions); + configuration.GetSection("ScadaBridge:Logging").Bind(loggingOptions); var minimumLevel = ParseLevel(loggingOptions.MinimumLevel, warningWriter); @@ -75,8 +75,8 @@ public static class LoggerConfigurationFactory { warningWriter.WriteLine( $"warning: Serilog:MinimumLevel ('{serilogMinimumLevel}') is being overridden by " + - $"ScadaLink:Logging:MinimumLevel ('{loggingOptions.MinimumLevel ?? "Information (default)"}'). " + - "ScadaLink:Logging:MinimumLevel is the documented source of truth for the floor (Host-011); " + + $"ScadaBridge:Logging:MinimumLevel ('{loggingOptions.MinimumLevel ?? "Information (default)"}'). " + + "ScadaBridge:Logging:MinimumLevel is the documented source of truth for the floor (Host-011); " + "remove the Serilog:MinimumLevel entry to silence this warning."); } @@ -92,7 +92,7 @@ public static class LoggerConfigurationFactory /// Parses a Serilog name, falling back to /// for null/blank/unrecognised values. /// - /// Host-022: when an operator sets ScadaLink:Logging:MinimumLevel to a + /// Host-022: when an operator sets ScadaBridge:Logging:MinimumLevel to a /// value that doesn't parse (e.g. the typo "Informaiton"), the helper must NOT /// throw — startup has to succeed so the rest of the system can come up — but /// it MUST make the silent fallback visible. The logger is not yet built at @@ -119,7 +119,7 @@ public static class LoggerConfigurationFactory if (!string.IsNullOrWhiteSpace(level)) warningWriter.WriteLine( - $"warning: ScadaLink:Logging:MinimumLevel value '{level}' is not a recognised Serilog LogEventLevel; falling back to Information."); + $"warning: ScadaBridge:Logging:MinimumLevel value '{level}' is not a recognised Serilog LogEventLevel; falling back to Information."); return LogEventLevel.Information; } diff --git a/src/ScadaLink.Host/LoggingOptions.cs b/src/ZB.MOM.WW.ScadaBridge.Host/LoggingOptions.cs similarity index 85% rename from src/ScadaLink.Host/LoggingOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/LoggingOptions.cs index 3d686ef0..0296d484 100644 --- a/src/ScadaLink.Host/LoggingOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/LoggingOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; public class LoggingOptions { diff --git a/src/ScadaLink.Host/NodeIdentityProvider.cs b/src/ZB.MOM.WW.ScadaBridge.Host/NodeIdentityProvider.cs similarity index 89% rename from src/ScadaLink.Host/NodeIdentityProvider.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/NodeIdentityProvider.cs index 6cc5c315..14529290 100644 --- a/src/ScadaLink.Host/NodeIdentityProvider.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/NodeIdentityProvider.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Options; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// /// Binds to . diff --git a/src/ScadaLink.Host/NodeOptions.cs b/src/ZB.MOM.WW.ScadaBridge.Host/NodeOptions.cs similarity index 96% rename from src/ScadaLink.Host/NodeOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/NodeOptions.cs index 2eeb11ea..8cad6907 100644 --- a/src/ScadaLink.Host/NodeOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/NodeOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; public class NodeOptions { diff --git a/src/ScadaLink.Host/Program.cs b/src/ZB.MOM.WW.ScadaBridge.Host/Program.cs similarity index 81% rename from src/ScadaLink.Host/Program.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/Program.cs index b0efcbf6..aee16d7e 100644 --- a/src/ScadaLink.Host/Program.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Program.cs @@ -1,36 +1,36 @@ using HealthChecks.UI.Client; using Microsoft.AspNetCore.Diagnostics.HealthChecks; -using ScadaLink.AuditLog; -using ScadaLink.CentralUI; -using ScadaLink.ClusterInfrastructure; -using ScadaLink.Communication; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.DeploymentManager; -using ScadaLink.ExternalSystemGateway; -using ScadaLink.HealthMonitoring; -using ScadaLink.Host; -using ScadaLink.Host.Actors; -using ScadaLink.Host.Health; -using ScadaLink.InboundAPI; -using ScadaLink.InboundAPI.Middleware; -using ScadaLink.ManagementService; -using ScadaLink.NotificationOutbox; -using ScadaLink.NotificationService; -using ScadaLink.Security; -using ScadaLink.SiteCallAudit; -using ScadaLink.TemplateEngine; -using ScadaLink.Transport; +using ZB.MOM.WW.ScadaBridge.AuditLog; +using ZB.MOM.WW.ScadaBridge.CentralUI; +using ZB.MOM.WW.ScadaBridge.ClusterInfrastructure; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.DeploymentManager; +using ZB.MOM.WW.ScadaBridge.ExternalSystemGateway; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Host; +using ZB.MOM.WW.ScadaBridge.Host.Actors; +using ZB.MOM.WW.ScadaBridge.Host.Health; +using ZB.MOM.WW.ScadaBridge.InboundAPI; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.ManagementService; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox; +using ZB.MOM.WW.ScadaBridge.NotificationService; +using ZB.MOM.WW.ScadaBridge.Security; +using ZB.MOM.WW.ScadaBridge.SiteCallAudit; +using ZB.MOM.WW.ScadaBridge.TemplateEngine; +using ZB.MOM.WW.ScadaBridge.Transport; using Serilog; // SCADALINK_CONFIG determines which role-specific config to load (Central or Site) // DOTNET_ENVIRONMENT/ASPNETCORE_ENVIRONMENT stay as "Development" for dev tooling (static assets, EF migrations, etc.) -var scadalinkConfig = Environment.GetEnvironmentVariable("SCADALINK_CONFIG") +var scadabridgeConfig = Environment.GetEnvironmentVariable("SCADALINK_CONFIG") ?? Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? "Production"; var configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: false) - .AddJsonFile($"appsettings.{scadalinkConfig}.json", optional: true) + .AddJsonFile($"appsettings.{scadabridgeConfig}.json", optional: true) .AddEnvironmentVariables() .AddCommandLine(args) .Build(); @@ -39,23 +39,23 @@ var configuration = new ConfigurationBuilder() StartupValidator.Validate(configuration); // Read node options for Serilog enrichment -var nodeRole = configuration["ScadaLink:Node:Role"]!; -var nodeHostname = configuration["ScadaLink:Node:NodeHostname"] ?? "unknown"; -var siteId = configuration["ScadaLink:Node:SiteId"] ?? "central"; +var nodeRole = configuration["ScadaBridge:Node:Role"]!; +var nodeHostname = configuration["ScadaBridge:Node:NodeHostname"] ?? "unknown"; +var siteId = configuration["ScadaBridge:Node:SiteId"] ?? "central"; // WP-14: Serilog structured logging. -// Host-011: minimum level is driven by ScadaLink:Logging:MinimumLevel (LoggingOptions). +// Host-011: minimum level is driven by ScadaBridge:Logging:MinimumLevel (LoggingOptions). // Host-014: console and file sinks are defined in the `Serilog` configuration // section (appsettings.json) and applied via ReadFrom.Configuration inside the // factory — the sink set, output template, file path and rolling interval are all // configuration-driven per REQ-HOST-8, not hard-coded here. -Log.Logger = ScadaLink.Host.LoggerConfigurationFactory +Log.Logger = ZB.MOM.WW.ScadaBridge.Host.LoggerConfigurationFactory .Build(configuration, nodeRole, siteId, nodeHostname) .CreateLogger(); try { - Log.Information("Starting ScadaLink host as {Role} on {Hostname}", nodeRole, nodeHostname); + Log.Information("Starting ScadaBridge host as {Role} on {Hostname}", nodeRole, nodeHostname); if (nodeRole.Equals("Central", StringComparison.OrdinalIgnoreCase)) { @@ -82,7 +82,7 @@ try // NotificationOutboxOptions via BindConfiguration, so no explicit Configure is needed. builder.Services.AddNotificationOutbox(); // Transport (#24) — central-only bundle export/import pipeline. Binds - // TransportOptions from ScadaLink:Transport via BindConfiguration; no + // TransportOptions from ScadaBridge:Transport via BindConfiguration; no // explicit Configure needed. builder.Services.AddTransport(); // Audit Log (#23) — central node owns the AuditLogIngestActor singleton + @@ -106,8 +106,8 @@ try builder.Services.AddInboundAPI(); builder.Services.AddManagementService(); - var configDbConnectionString = configuration["ScadaLink:Database:ConfigurationDb"] - ?? throw new InvalidOperationException("ScadaLink:Database:ConfigurationDb connection string is required for Central role."); + var configDbConnectionString = configuration["ScadaBridge:Database:ConfigurationDb"] + ?? throw new InvalidOperationException("ScadaBridge:Database:ConfigurationDb connection string is required for Central role."); builder.Services.AddConfigurationDatabase(configDbConnectionString); // WP-12: Health checks for readiness gating @@ -128,7 +128,7 @@ try // cluster-leadership check as ActiveNodeHealthCheck above, so the inbound // API and the /health/active endpoint Traefik routes against agree on // which node is active. - builder.Services.AddSingleton(); + builder.Services.AddSingleton(); // Cluster node status provider scoped to the Central role — feeds the // CentralHealthReportLoop so the central cluster appears on /monitoring/health. @@ -140,15 +140,15 @@ try // Options binding SiteServiceRegistration.BindSharedOptions(builder.Services, builder.Configuration); - builder.Services.Configure(builder.Configuration.GetSection("ScadaLink:Security")); - builder.Services.Configure(builder.Configuration.GetSection("ScadaLink:InboundApi")); + builder.Services.Configure(builder.Configuration.GetSection("ScadaBridge:Security")); + builder.Services.Configure(builder.Configuration.GetSection("ScadaBridge:InboundApi")); builder.Services.Configure( - builder.Configuration.GetSection(ScadaLink.DeploymentManager.ServiceCollectionExtensions.OptionsSection)); + builder.Configuration.GetSection(ZB.MOM.WW.ScadaBridge.DeploymentManager.ServiceCollectionExtensions.OptionsSection)); var app = builder.Build(); // Apply or validate database migrations (skip when running in test harness) - if (!string.Equals(configuration["ScadaLink:Database:SkipMigrations"], "true", StringComparison.OrdinalIgnoreCase)) + if (!string.Equals(configuration["ScadaBridge:Database:SkipMigrations"], "true", StringComparison.OrdinalIgnoreCase)) { var isDevelopment = app.Environment.IsDevelopment() || string.Equals(Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"), "Development", StringComparison.OrdinalIgnoreCase); @@ -170,7 +170,7 @@ try async ct => { using var scope = app.Services.CreateScope(); - var dbContext = scope.ServiceProvider.GetRequiredService(); + var dbContext = scope.ServiceProvider.GetRequiredService(); await MigrationHelper.ApplyOrValidateMigrationsAsync(dbContext, isDevelopment, migrationLogger, ct); }, maxAttempts: 8, @@ -233,20 +233,20 @@ try }); app.MapStaticAssets(); - app.MapCentralUI(); + app.MapCentralUI(); app.MapInboundAPI(); app.MapManagementAPI(); // Audit Log #23 (M8): CLI-facing /api/audit/{query,export} routes. Same // Basic-Auth + LDAP mechanism as /management; gated on the OperationalAudit // / AuditExport role sets. app.MapAuditAPI(); - app.MapHub("/hubs/debug-stream"); + app.MapHub("/hubs/debug-stream"); // Compile and register all Inbound API method scripts at startup using (var scope = app.Services.CreateScope()) { - var apiRepo = scope.ServiceProvider.GetRequiredService(); - var executor = app.Services.GetRequiredService(); + var apiRepo = scope.ServiceProvider.GetRequiredService(); + var executor = app.Services.GetRequiredService(); var methods = await apiRepo.GetAllApiMethodsAsync(); foreach (var method in methods) { @@ -268,7 +268,7 @@ try builder.Host.UseWindowsService(); // Read GrpcPort from config (NodeOptions already has default 8083) - var grpcPort = configuration.GetValue("ScadaLink:Node:GrpcPort", 8083); + var grpcPort = configuration.GetValue("ScadaBridge:Node:GrpcPort", 8083); // Configure Kestrel for HTTP/2 only on the gRPC port builder.WebHost.ConfigureKestrel(options => @@ -281,7 +281,7 @@ try // gRPC server registration builder.Services.AddGrpc(); - builder.Services.AddSingleton(); + builder.Services.AddSingleton(); // Existing site service registrations SiteServiceRegistration.Configure(builder.Services, builder.Configuration); @@ -289,7 +289,7 @@ try var app = builder.Build(); // Map gRPC service — resolves the singleton SiteStreamGrpcServer from DI - app.MapGrpcService(); + app.MapGrpcService(); // Host-017 / REQ-HOST-7: site-shutdown ordering. ApplicationStopping // fires BEFORE IHostedService.StopAsync runs, so the gRPC server @@ -300,7 +300,7 @@ try // time out via gRPC keepalive (~25 s), violating the documented // four-step sequence. var siteLifetime = app.Services.GetRequiredService(); - var siteGrpcServer = app.Services.GetRequiredService(); + var siteGrpcServer = app.Services.GetRequiredService(); siteLifetime.ApplicationStopping.Register(() => siteGrpcServer.CancelAllStreams()); await app.RunAsync(); @@ -312,7 +312,7 @@ try } catch (Exception ex) { - Log.Fatal(ex, "ScadaLink host terminated unexpectedly"); + Log.Fatal(ex, "ScadaBridge host terminated unexpectedly"); throw; } finally diff --git a/src/ScadaLink.Host/Properties/launchSettings.json b/src/ZB.MOM.WW.ScadaBridge.Host/Properties/launchSettings.json similarity index 92% rename from src/ScadaLink.Host/Properties/launchSettings.json rename to src/ZB.MOM.WW.ScadaBridge.Host/Properties/launchSettings.json index 44d591ee..d0043619 100644 --- a/src/ScadaLink.Host/Properties/launchSettings.json +++ b/src/ZB.MOM.WW.ScadaBridge.Host/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "ScadaLink Central": { + "ScadaBridge Central": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, @@ -12,7 +12,7 @@ "SCADALINK_CONFIG": "Central" } }, - "ScadaLink Site": { + "ScadaBridge Site": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": false, diff --git a/src/ScadaLink.Host/SiteIdentityProvider.cs b/src/ZB.MOM.WW.ScadaBridge.Host/SiteIdentityProvider.cs similarity index 88% rename from src/ScadaLink.Host/SiteIdentityProvider.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/SiteIdentityProvider.cs index 019cc478..7e35c7fc 100644 --- a/src/ScadaLink.Host/SiteIdentityProvider.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/SiteIdentityProvider.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Options; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// /// Provides the site identity from NodeOptions configuration. diff --git a/src/ScadaLink.Host/SiteServiceRegistration.cs b/src/ZB.MOM.WW.ScadaBridge.Host/SiteServiceRegistration.cs similarity index 80% rename from src/ScadaLink.Host/SiteServiceRegistration.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/SiteServiceRegistration.cs index 7746ea56..c5b9cddc 100644 --- a/src/ScadaLink.Host/SiteServiceRegistration.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/SiteServiceRegistration.cs @@ -1,18 +1,18 @@ -using ScadaLink.AuditLog; -using ScadaLink.ClusterInfrastructure; -using ScadaLink.Communication; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.DataConnectionLayer; -using ScadaLink.ExternalSystemGateway; -using ScadaLink.HealthMonitoring; -using ScadaLink.Host.Actors; -using ScadaLink.Host.Health; -using ScadaLink.NotificationService; -using ScadaLink.SiteEventLogging; -using ScadaLink.SiteRuntime; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.AuditLog; +using ZB.MOM.WW.ScadaBridge.ClusterInfrastructure; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer; +using ZB.MOM.WW.ScadaBridge.ExternalSystemGateway; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Host.Actors; +using ZB.MOM.WW.ScadaBridge.Host.Health; +using ZB.MOM.WW.ScadaBridge.NotificationService; +using ZB.MOM.WW.ScadaBridge.SiteEventLogging; +using ZB.MOM.WW.ScadaBridge.SiteRuntime; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// /// Extracted site-role DI registrations so both Program.cs and tests @@ -42,7 +42,7 @@ public static class SiteServiceRegistration // Site-only components — AddSiteRuntime registers SiteStorageService with SQLite path // and site-local repository implementations (IExternalSystemRepository, INotificationRepository) - var siteDbPath = config["ScadaLink:Database:SiteDbPath"] ?? "site.db"; + var siteDbPath = config["ScadaBridge:Database:SiteDbPath"] ?? "site.db"; services.AddSiteRuntime($"Data Source={siteDbPath}"); services.AddDataConnectionLayer(); // Audit Log #23 (M3 Bundle F): adapter that surfaces the site id to @@ -52,7 +52,7 @@ public static class SiteServiceRegistration // non-empty SiteId at construction time (otherwise the S&F service is // a singleton and the empty-string value would be cached for the // lifetime of the process). - services.AddSingleton(); + services.AddSingleton(); services.AddStoreAndForward(); services.AddSiteEventLogging(); @@ -84,10 +84,10 @@ public static class SiteServiceRegistration // Options binding BindSharedOptions(services, config); - services.Configure(config.GetSection("ScadaLink:SiteRuntime")); - services.Configure(config.GetSection("ScadaLink:DataConnection")); - services.Configure(config.GetSection("ScadaLink:StoreAndForward")); - services.Configure(config.GetSection("ScadaLink:SiteEventLog")); + services.Configure(config.GetSection("ScadaBridge:SiteRuntime")); + services.Configure(config.GetSection("ScadaBridge:DataConnection")); + services.Configure(config.GetSection("ScadaBridge:StoreAndForward")); + services.Configure(config.GetSection("ScadaBridge:SiteEventLog")); } /// Binds shared options sections (Node, Cluster, Database, Communication, etc.) used by both site and central roles. @@ -95,15 +95,15 @@ public static class SiteServiceRegistration /// Application configuration supplying the option values. public static void BindSharedOptions(IServiceCollection services, IConfiguration config) { - services.Configure(config.GetSection("ScadaLink:Node")); - services.Configure(config.GetSection("ScadaLink:Cluster")); - services.Configure(config.GetSection("ScadaLink:Database")); - services.Configure(config.GetSection("ScadaLink:Communication")); - services.Configure(config.GetSection("ScadaLink:HealthMonitoring")); - services.Configure(config.GetSection("ScadaLink:Notification")); - services.Configure(config.GetSection("ScadaLink:Logging")); + services.Configure(config.GetSection("ScadaBridge:Node")); + services.Configure(config.GetSection("ScadaBridge:Cluster")); + services.Configure(config.GetSection("ScadaBridge:Database")); + services.Configure(config.GetSection("ScadaBridge:Communication")); + services.Configure(config.GetSection("ScadaBridge:HealthMonitoring")); + services.Configure(config.GetSection("ScadaBridge:Notification")); + services.Configure(config.GetSection("ScadaBridge:Logging")); - // Audit Log (#23) — exposes ScadaLink:Node:NodeName to downstream audit + // Audit Log (#23) — exposes ScadaBridge:Node:NodeName to downstream audit // writers so they can stamp the SourceNode column. Registered here in // shared bootstrap because every node (central + site) needs it. services.AddSingleton(); diff --git a/src/ScadaLink.Host/StartupRetry.cs b/src/ZB.MOM.WW.ScadaBridge.Host/StartupRetry.cs similarity index 99% rename from src/ScadaLink.Host/StartupRetry.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/StartupRetry.cs index 7e4ae38b..fbed19b2 100644 --- a/src/ScadaLink.Host/StartupRetry.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/StartupRetry.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// /// Bounded retry-with-backoff for startup preconditions. diff --git a/src/ScadaLink.Host/StartupValidator.cs b/src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs similarity index 69% rename from src/ScadaLink.Host/StartupValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs index 065904d0..90cda76a 100644 --- a/src/ScadaLink.Host/StartupValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/StartupValidator.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// /// Validates required configuration before Akka.NET actor system creation. @@ -12,55 +12,55 @@ public static class StartupValidator { var errors = new List(); - var nodeSection = configuration.GetSection("ScadaLink:Node"); + var nodeSection = configuration.GetSection("ScadaBridge:Node"); var role = nodeSection["Role"]; if (string.IsNullOrEmpty(role) || (role != "Central" && role != "Site")) - errors.Add("ScadaLink:Node:Role must be 'Central' or 'Site'"); + errors.Add("ScadaBridge:Node:Role must be 'Central' or 'Site'"); if (string.IsNullOrEmpty(nodeSection["NodeHostname"])) - errors.Add("ScadaLink:Node:NodeHostname is required"); + errors.Add("ScadaBridge:Node:NodeHostname is required"); var portStr = nodeSection["RemotingPort"]; if (!int.TryParse(portStr, out var port) || port < 1 || port > 65535) - errors.Add("ScadaLink:Node:RemotingPort must be 1-65535"); + errors.Add("ScadaBridge:Node:RemotingPort must be 1-65535"); if (role == "Site" && string.IsNullOrEmpty(nodeSection["SiteId"])) - errors.Add("ScadaLink:Node:SiteId is required for Site nodes"); + errors.Add("ScadaBridge:Node:SiteId is required for Site nodes"); if (role == "Central") { - var dbSection = configuration.GetSection("ScadaLink:Database"); + var dbSection = configuration.GetSection("ScadaBridge:Database"); if (string.IsNullOrEmpty(dbSection["ConfigurationDb"])) - errors.Add("ScadaLink:Database:ConfigurationDb connection string required for Central"); + errors.Add("ScadaBridge:Database:ConfigurationDb connection string required for Central"); - var secSection = configuration.GetSection("ScadaLink:Security"); + var secSection = configuration.GetSection("ScadaBridge:Security"); if (string.IsNullOrEmpty(secSection["LdapServer"])) - errors.Add("ScadaLink:Security:LdapServer required for Central"); + errors.Add("ScadaBridge:Security:LdapServer required for Central"); if (string.IsNullOrEmpty(secSection["JwtSigningKey"])) - errors.Add("ScadaLink:Security:JwtSigningKey required for Central"); + errors.Add("ScadaBridge:Security:JwtSigningKey required for Central"); } - var seedNodes = configuration.GetSection("ScadaLink:Cluster:SeedNodes").Get>(); + var seedNodes = configuration.GetSection("ScadaBridge:Cluster:SeedNodes").Get>(); if (seedNodes == null || seedNodes.Count < 2) - errors.Add("ScadaLink:Cluster:SeedNodes must have at least 2 entries"); + errors.Add("ScadaBridge:Cluster:SeedNodes must have at least 2 entries"); if (role == "Site") { var grpcPortStr = nodeSection["GrpcPort"]; int grpcPort = 8083; // NodeOptions default when the key is absent if (grpcPortStr != null && (!int.TryParse(grpcPortStr, out grpcPort) || grpcPort < 1 || grpcPort > 65535)) - errors.Add("ScadaLink:Node:GrpcPort must be 1-65535"); + errors.Add("ScadaBridge:Node:GrpcPort must be 1-65535"); // Host-007 / REQ-HOST-4: the gRPC (Kestrel HTTP/2) port and the Akka // remoting port must differ. Identical values make Kestrel and // Akka.Remote contend for the same TCP port and fail opaquely at // runtime. Uses the resolved GrpcPort, including the 8083 default. if (port == grpcPort) - errors.Add("ScadaLink:Node:GrpcPort must differ from RemotingPort"); + errors.Add("ScadaBridge:Node:GrpcPort must differ from RemotingPort"); - var dbSection = configuration.GetSection("ScadaLink:Database"); + var dbSection = configuration.GetSection("ScadaBridge:Database"); if (string.IsNullOrEmpty(dbSection["SiteDbPath"])) - errors.Add("ScadaLink:Database:SiteDbPath required for Site nodes"); + errors.Add("ScadaBridge:Database:SiteDbPath required for Site nodes"); // Host-004: a seed node must reference an Akka.Remote endpoint, never the // Kestrel HTTP/2 gRPC port. A seed entry whose port equals this node's @@ -72,7 +72,7 @@ public static class StartupValidator { if (SeedNodePort(seed) == grpcPort) errors.Add( - $"ScadaLink:Cluster:SeedNodes entry '{seed}' must not target the gRPC port " + + $"ScadaBridge:Cluster:SeedNodes entry '{seed}' must not target the gRPC port " + $"({grpcPort}); seed nodes must reference Akka remoting ports"); } } diff --git a/src/ScadaLink.Host/StoreAndForwardSiteContext.cs b/src/ZB.MOM.WW.ScadaBridge.Host/StoreAndForwardSiteContext.cs similarity index 89% rename from src/ScadaLink.Host/StoreAndForwardSiteContext.cs rename to src/ZB.MOM.WW.ScadaBridge.Host/StoreAndForwardSiteContext.cs index 7aedaf12..68900025 100644 --- a/src/ScadaLink.Host/StoreAndForwardSiteContext.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Host/StoreAndForwardSiteContext.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Options; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.Host; +namespace ZB.MOM.WW.ScadaBridge.Host; /// /// Audit Log #23 (M3 Bundle F): Host-side adapter implementing the @@ -30,6 +30,6 @@ public class StoreAndForwardSiteContext : IStoreAndForwardSiteContext // surfaces at composition time rather than at the first cached call. SiteId = nodeOptions.Value.SiteId ?? throw new InvalidOperationException( - "ScadaLink:Node:SiteId is required for the site role's StoreAndForward wiring."); + "ScadaBridge:Node:SiteId is required for the site role's StoreAndForward wiring."); } } diff --git a/src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj b/src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj new file mode 100644 index 00000000..b569121b --- /dev/null +++ b/src/ZB.MOM.WW.ScadaBridge.Host/ZB.MOM.WW.ScadaBridge.Host.csproj @@ -0,0 +1,58 @@ + + + + net10.0 + enable + enable + true + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ScadaLink.Host/_Imports.razor b/src/ZB.MOM.WW.ScadaBridge.Host/_Imports.razor similarity index 84% rename from src/ScadaLink.Host/_Imports.razor rename to src/ZB.MOM.WW.ScadaBridge.Host/_Imports.razor index 89d7d6e1..2632af5b 100644 --- a/src/ScadaLink.Host/_Imports.razor +++ b/src/ZB.MOM.WW.ScadaBridge.Host/_Imports.razor @@ -5,4 +5,4 @@ @using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Web @using static Microsoft.AspNetCore.Components.Web.RenderMode -@using ScadaLink.CentralUI.Components.Shared +@using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared diff --git a/src/ScadaLink.Host/appsettings.Central.json b/src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Central.json similarity index 84% rename from src/ScadaLink.Host/appsettings.Central.json rename to src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Central.json index f8464b05..efee2da5 100644 --- a/src/ScadaLink.Host/appsettings.Central.json +++ b/src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Central.json @@ -1,5 +1,5 @@ { - "ScadaLink": { + "ScadaBridge": { "_nodeName": "Host-018: NodeName stamps SourceNode on AuditLog/Notifications/SiteCalls rows (CLAUDE.md 'Centralized Audit Log' decision) and backs IX_AuditLog_Node_Occurred. Convention: 'central-a'/'central-b' for central nodes, 'node-a'/'node-b' for site nodes. Override per-node in multi-node deployments (the docker per-node configs do this). When left at the default below, single-node dev rows are stamped with 'central-a'; an empty value normalises to a NULL SourceNode.", "Node": { "Role": "Central", @@ -9,8 +9,8 @@ }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@localhost:8081", - "akka.tcp://scadalink@localhost:8082" + "akka.tcp://scadabridge@localhost:8081", + "akka.tcp://scadabridge@localhost:8082" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -18,7 +18,7 @@ "FailureDetectionThreshold": "00:00:10", "MinNrOfMembers": 1 }, - "_secrets": "Host-003: Secrets are NOT committed in this file. Supply them via environment variables, which the Host's configuration builder (AddEnvironmentVariables) overlays over this file. Required: ScadaLink__Database__ConfigurationDb, ScadaLink__Security__LdapServiceAccountPassword, ScadaLink__Security__JwtSigningKey. The ${...} placeholders below are intentionally non-functional and must be overridden per environment.", + "_secrets": "Host-003: Secrets are NOT committed in this file. Supply them via environment variables, which the Host's configuration builder (AddEnvironmentVariables) overlays over this file. Required: ScadaBridge__Database__ConfigurationDb, ScadaBridge__Security__LdapServiceAccountPassword, ScadaBridge__Security__JwtSigningKey. The ${...} placeholders below are intentionally non-functional and must be overridden per environment.", "Database": { "ConfigurationDb": "${SCADALINK_CONFIGURATIONDB_CONNECTION_STRING}" }, @@ -27,8 +27,8 @@ "LdapPort": 3893, "LdapUseTls": false, "AllowInsecureLdap": true, - "LdapSearchBase": "dc=scadalink,dc=local", - "LdapServiceAccountDn": "cn=admin,dc=scadalink,dc=local", + "LdapSearchBase": "dc=scadabridge,dc=local", + "LdapServiceAccountDn": "cn=admin,dc=scadabridge,dc=local", "LdapServiceAccountPassword": "${SCADALINK_LDAP_SERVICE_ACCOUNT_PASSWORD}", "JwtSigningKey": "${SCADALINK_JWT_SIGNING_KEY}", "JwtExpiryMinutes": 15, diff --git a/src/ScadaLink.Host/appsettings.Site.json b/src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json similarity index 80% rename from src/ScadaLink.Host/appsettings.Site.json rename to src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json index 93a6becd..b1faee82 100644 --- a/src/ScadaLink.Host/appsettings.Site.json +++ b/src/ZB.MOM.WW.ScadaBridge.Host/appsettings.Site.json @@ -1,5 +1,5 @@ { - "ScadaLink": { + "ScadaBridge": { "_nodeName": "Host-018: NodeName stamps SourceNode on AuditLog/Notifications/SiteCalls rows (CLAUDE.md 'Centralized Audit Log' decision) and backs IX_AuditLog_Node_Occurred. Convention: 'node-a'/'node-b' for site nodes, 'central-a'/'central-b' for central nodes. Override per-node in multi-node deployments (the docker per-node configs do this). When left at the default below, single-node dev rows are stamped with 'node-a'; an empty value normalises to a NULL SourceNode.", "Node": { "Role": "Site", @@ -11,8 +11,8 @@ }, "Cluster": { "SeedNodes": [ - "akka.tcp://scadalink@localhost:8082", - "akka.tcp://scadalink@localhost:8084" + "akka.tcp://scadabridge@localhost:8082", + "akka.tcp://scadabridge@localhost:8084" ], "SplitBrainResolverStrategy": "keep-oldest", "StableAfter": "00:00:15", @@ -21,7 +21,7 @@ "MinNrOfMembers": 1 }, "Database": { - "SiteDbPath": "./data/scadalink.db" + "SiteDbPath": "./data/scadabridge.db" }, "DataConnection": { "ReconnectInterval": "00:00:05", @@ -33,9 +33,9 @@ "ReplicationEnabled": true }, "Communication": { - "_centralContactPoints": "Host-016: each entry MUST be a central node's remoting endpoint, NOT this site's own remoting port. The single dev-loopback default below points only at central-a (localhost:8081). In a multi-central deployment add the second central node here (e.g. 'akka.tcp://scadalink@central-b-host:8081') so ClusterClient can fail over when central-a is down. The previous template listed localhost:8082 as the second contact — that is THIS site's own RemotingPort and is a permanent failure in the initial-contact rotation.", + "_centralContactPoints": "Host-016: each entry MUST be a central node's remoting endpoint, NOT this site's own remoting port. The single dev-loopback default below points only at central-a (localhost:8081). In a multi-central deployment add the second central node here (e.g. 'akka.tcp://scadabridge@central-b-host:8081') so ClusterClient can fail over when central-a is down. The previous template listed localhost:8082 as the second contact — that is THIS site's own RemotingPort and is a permanent failure in the initial-contact rotation.", "CentralContactPoints": [ - "akka.tcp://scadalink@localhost:8081" + "akka.tcp://scadabridge@localhost:8081" ], "DeploymentTimeout": "00:02:00", "LifecycleTimeout": "00:00:30", diff --git a/src/ScadaLink.Host/appsettings.json b/src/ZB.MOM.WW.ScadaBridge.Host/appsettings.json similarity index 66% rename from src/ScadaLink.Host/appsettings.json rename to src/ZB.MOM.WW.ScadaBridge.Host/appsettings.json index e2d67821..a0879e67 100644 --- a/src/ScadaLink.Host/appsettings.json +++ b/src/ZB.MOM.WW.ScadaBridge.Host/appsettings.json @@ -1,5 +1,5 @@ { - "_logging": "Host-021: Serilog is the sole logger provider (Program.cs calls builder.Host.UseSerilog()), so the standard Microsoft 'Logging:LogLevel' block has no effect and was removed. The minimum level is set via 'ScadaLink:Logging:MinimumLevel' (bound to LoggingOptions per Host-011); sinks are defined under the 'Serilog' section below and applied via ReadFrom.Configuration (Host-014). See LoggerConfigurationFactory + Component-Host.md REQ-HOST-8.", + "_logging": "Host-021: Serilog is the sole logger provider (Program.cs calls builder.Host.UseSerilog()), so the standard Microsoft 'Logging:LogLevel' block has no effect and was removed. The minimum level is set via 'ScadaBridge:Logging:MinimumLevel' (bound to LoggingOptions per Host-011); sinks are defined under the 'Serilog' section below and applied via ReadFrom.Configuration (Host-014). See LoggerConfigurationFactory + Component-Host.md REQ-HOST-8.", "Serilog": { "Using": [ "Serilog.Sinks.Console", @@ -15,7 +15,7 @@ { "Name": "File", "Args": { - "path": "logs/scadalink-.log", + "path": "logs/scadabridge-.log", "rollingInterval": "Day" } } diff --git a/src/ScadaLink.Host/wwwroot/.gitkeep b/src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/.gitkeep similarity index 100% rename from src/ScadaLink.Host/wwwroot/.gitkeep rename to src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/.gitkeep diff --git a/src/ScadaLink.Host/wwwroot/js/treeview-storage.js b/src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/js/treeview-storage.js similarity index 100% rename from src/ScadaLink.Host/wwwroot/js/treeview-storage.js rename to src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/js/treeview-storage.js diff --git a/src/ScadaLink.Host/wwwroot/lib/bootstrap-icons/bootstrap-icons.css b/src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap-icons/bootstrap-icons.css similarity index 100% rename from src/ScadaLink.Host/wwwroot/lib/bootstrap-icons/bootstrap-icons.css rename to src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap-icons/bootstrap-icons.css diff --git a/src/ScadaLink.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff b/src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff similarity index 100% rename from src/ScadaLink.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff rename to src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff diff --git a/src/ScadaLink.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff2 b/src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff2 similarity index 100% rename from src/ScadaLink.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff2 rename to src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap-icons/fonts/bootstrap-icons.woff2 diff --git a/src/ScadaLink.Host/wwwroot/lib/bootstrap/css/bootstrap.min.css b/src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap/css/bootstrap.min.css similarity index 100% rename from src/ScadaLink.Host/wwwroot/lib/bootstrap/css/bootstrap.min.css rename to src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap/css/bootstrap.min.css diff --git a/src/ScadaLink.Host/wwwroot/lib/bootstrap/js/bootstrap.bundle.min.js b/src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap/js/bootstrap.bundle.min.js similarity index 100% rename from src/ScadaLink.Host/wwwroot/lib/bootstrap/js/bootstrap.bundle.min.js rename to src/ZB.MOM.WW.ScadaBridge.Host/wwwroot/lib/bootstrap/js/bootstrap.bundle.min.js diff --git a/src/ScadaLink.InboundAPI/ApiKeyValidator.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ApiKeyValidator.cs similarity index 96% rename from src/ScadaLink.InboundAPI/ApiKeyValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/ApiKeyValidator.cs index 220f7504..febc62de 100644 --- a/src/ScadaLink.InboundAPI/ApiKeyValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ApiKeyValidator.cs @@ -1,10 +1,10 @@ using System.Security.Cryptography; using System.Text; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// WP-1: Validates API keys from X-API-Key header. diff --git a/src/ScadaLink.InboundAPI/CommunicationServiceInstanceRouter.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/CommunicationServiceInstanceRouter.cs similarity index 91% rename from src/ScadaLink.InboundAPI/CommunicationServiceInstanceRouter.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/CommunicationServiceInstanceRouter.cs index 4b4ae4e8..01e001e1 100644 --- a/src/ScadaLink.InboundAPI/CommunicationServiceInstanceRouter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/CommunicationServiceInstanceRouter.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Messages.InboundApi; -using ScadaLink.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Communication; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// Default implementation. Delegates every routed diff --git a/src/ScadaLink.InboundAPI/EndpointExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/EndpointExtensions.cs similarity index 98% rename from src/ScadaLink.InboundAPI/EndpointExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/EndpointExtensions.cs index e4f687b6..ba451c54 100644 --- a/src/ScadaLink.InboundAPI/EndpointExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/EndpointExtensions.cs @@ -5,9 +5,9 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// WP-1: POST /api/{methodName} endpoint registration. diff --git a/src/ScadaLink.InboundAPI/ForbiddenApiChecker.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ForbiddenApiChecker.cs similarity index 98% rename from src/ScadaLink.InboundAPI/ForbiddenApiChecker.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/ForbiddenApiChecker.cs index 50f6b054..66f69bef 100644 --- a/src/ScadaLink.InboundAPI/ForbiddenApiChecker.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ForbiddenApiChecker.cs @@ -2,10 +2,10 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// -/// InboundAPI-005: Enforces the ScadaLink script trust model on inbound API method +/// InboundAPI-005: Enforces the ScadaBridge script trust model on inbound API method /// scripts before they are compiled into executable handlers. /// /// The trust model (CLAUDE.md, Akka.NET conventions) forbids scripts from reaching diff --git a/src/ScadaLink.InboundAPI/IActiveNodeGate.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/IActiveNodeGate.cs similarity index 95% rename from src/ScadaLink.InboundAPI/IActiveNodeGate.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/IActiveNodeGate.cs index 0fd01d44..59b991f5 100644 --- a/src/ScadaLink.InboundAPI/IActiveNodeGate.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/IActiveNodeGate.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// InboundAPI-008: abstraction the inbound API endpoint uses to determine whether diff --git a/src/ScadaLink.InboundAPI/IInstanceRouter.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/IInstanceRouter.cs similarity index 89% rename from src/ScadaLink.InboundAPI/IInstanceRouter.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/IInstanceRouter.cs index dcb35ff6..9ddc46e4 100644 --- a/src/ScadaLink.InboundAPI/IInstanceRouter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/IInstanceRouter.cs @@ -1,11 +1,11 @@ -using ScadaLink.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// Seam over the cross-site routing transport used by . /// The production implementation () -/// delegates to ScadaLink.Communication.CommunicationService; the interface +/// delegates to ZB.MOM.WW.ScadaBridge.Communication.CommunicationService; the interface /// exists so / can be unit tested /// without a live actor system (InboundAPI-017). /// diff --git a/src/ScadaLink.InboundAPI/InboundApiEndpointFilter.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundApiEndpointFilter.cs similarity index 98% rename from src/ScadaLink.InboundAPI/InboundApiEndpointFilter.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundApiEndpointFilter.cs index 46bdd214..56c8deaf 100644 --- a/src/ScadaLink.InboundAPI/InboundApiEndpointFilter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundApiEndpointFilter.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// Endpoint filter applied to POST /api/{methodName} that enforces two diff --git a/src/ScadaLink.InboundAPI/InboundApiOptions.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundApiOptions.cs similarity index 91% rename from src/ScadaLink.InboundAPI/InboundApiOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundApiOptions.cs index eb6d7f1f..0fba48ed 100644 --- a/src/ScadaLink.InboundAPI/InboundApiOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundApiOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; public class InboundApiOptions { @@ -27,7 +27,7 @@ public class InboundApiOptions /// /// This is a secret: supply a strong, random value via configuration or a secret /// store, never hard-coded. It must be present and at least - /// + /// /// characters — AddInboundAPI fails fast otherwise. /// /// diff --git a/src/ScadaLink.InboundAPI/InboundScriptExecutor.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs similarity index 98% rename from src/ScadaLink.InboundAPI/InboundScriptExecutor.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs index 0d9af7fd..3f26fe5d 100644 --- a/src/ScadaLink.InboundAPI/InboundScriptExecutor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/InboundScriptExecutor.cs @@ -3,11 +3,11 @@ using System.Text.Json; using Microsoft.CodeAnalysis.CSharp.Scripting; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Messages.InboundApi; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// WP-3: Executes the C# script associated with an inbound API method. diff --git a/src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddleware.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddleware.cs similarity index 97% rename from src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddleware.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddleware.cs index 57a84629..467690ff 100644 --- a/src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddleware.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddleware.cs @@ -5,12 +5,12 @@ using System.Text.Json; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.InboundAPI.Middleware; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; /// /// Audit Log #23 (M4 Bundle D, T7) — emits one @@ -58,7 +58,7 @@ namespace ScadaLink.InboundAPI.Middleware; /// cap + 1 bytes per body even when the client streams hundreds of MiB. /// The downstream handler and the real client still see every byte; only the /// audit copy is bounded. The cap is also enforced again by -/// (which OR's +/// (which OR's /// in its own determination), so a /// row truncated here remains truncated even if the filter is bypassed. /// @@ -71,7 +71,7 @@ public sealed class AuditWriteMiddleware /// succeeded. Exposed as a constant so the handler and middleware share a /// single source of truth (no stringly-typed coupling). /// - public const string AuditActorItemKey = "ScadaLink.InboundAPI.AuditActor"; + public const string AuditActorItemKey = "ZB.MOM.WW.ScadaBridge.InboundAPI.AuditActor"; /// /// Audit Log #23 (ParentExecutionId): key under @@ -83,7 +83,7 @@ public sealed class AuditWriteMiddleware /// . Exposed as a constant so the handler /// and middleware share a single source of truth (no stringly-typed coupling). /// - public const string InboundExecutionIdItemKey = "ScadaLink.InboundAPI.InboundExecutionId"; + public const string InboundExecutionIdItemKey = "ZB.MOM.WW.ScadaBridge.InboundAPI.InboundExecutionId"; private readonly RequestDelegate _next; private readonly ICentralAuditWriter _auditWriter; @@ -432,7 +432,7 @@ public sealed class AuditWriteMiddleware /// /// Mirrors the algorithm in DefaultAuditPayloadFilter.TruncateUtf8; /// kept local to avoid a backwards project reference from - /// ScadaLink.AuditLog into ScadaLink.InboundAPI. + /// ZB.MOM.WW.ScadaBridge.AuditLog into ZB.MOM.WW.ScadaBridge.InboundAPI. /// private static string DecodeUtf8Bounded(byte[] bytes, int validBytes, bool cutAtValidBytes) { diff --git a/src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddlewareExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddlewareExtensions.cs similarity index 87% rename from src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddlewareExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddlewareExtensions.cs index b8f0e79f..c73a6d72 100644 --- a/src/ScadaLink.InboundAPI/Middleware/AuditWriteMiddlewareExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/Middleware/AuditWriteMiddlewareExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Builder; -namespace ScadaLink.InboundAPI.Middleware; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; /// /// extensions for wiring @@ -14,7 +14,7 @@ public static class AuditWriteMiddlewareExtensions { /// /// Registers in the pipeline. - /// + /// /// must be registered in DI (typically via AddAuditLog) before this /// middleware runs. /// diff --git a/src/ScadaLink.InboundAPI/ParameterValidator.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ParameterValidator.cs similarity index 96% rename from src/ScadaLink.InboundAPI/ParameterValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/ParameterValidator.cs index e490e474..c99bf0e5 100644 --- a/src/ScadaLink.InboundAPI/ParameterValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ParameterValidator.cs @@ -1,7 +1,7 @@ using System.Text.Json; -using ScadaLink.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// WP-2: Validates and deserializes JSON request body against method parameter definitions. @@ -14,7 +14,7 @@ public static class ParameterValidator /// Returns deserialized parameters or an error message. /// /// The parsed JSON request body; null or undefined if no body was supplied. - /// JSON-serialized list of ; null or empty means no parameters are defined. + /// JSON-serialized list of ; null or empty means no parameters are defined. public static ParameterValidationResult Validate( JsonElement? body, string? parameterDefinitions) diff --git a/src/ScadaLink.InboundAPI/ReturnValueValidator.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ReturnValueValidator.cs similarity index 99% rename from src/ScadaLink.InboundAPI/ReturnValueValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/ReturnValueValidator.cs index e3495552..feac6528 100644 --- a/src/ScadaLink.InboundAPI/ReturnValueValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ReturnValueValidator.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// InboundAPI-014: validates a method script's return value against the method's diff --git a/src/ScadaLink.InboundAPI/RouteHelper.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/RouteHelper.cs similarity index 98% rename from src/ScadaLink.InboundAPI/RouteHelper.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/RouteHelper.cs index 1b069493..73b7ab10 100644 --- a/src/ScadaLink.InboundAPI/RouteHelper.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/RouteHelper.cs @@ -1,8 +1,8 @@ -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.InboundApi; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; /// /// WP-4: Route.To() helper for cross-site calls from inbound API scripts. diff --git a/src/ScadaLink.InboundAPI/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ServiceCollectionExtensions.cs similarity index 94% rename from src/ScadaLink.InboundAPI/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/ServiceCollectionExtensions.cs index 8b837d1a..fe33f39c 100644 --- a/src/ScadaLink.InboundAPI/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ServiceCollectionExtensions.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; -namespace ScadaLink.InboundAPI; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI; public static class ServiceCollectionExtensions { diff --git a/src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ZB.MOM.WW.ScadaBridge.InboundAPI.csproj similarity index 62% rename from src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj rename to src/ZB.MOM.WW.ScadaBridge.InboundAPI/ZB.MOM.WW.ScadaBridge.InboundAPI.csproj index 7e898aaf..3af1480c 100644 --- a/src/ScadaLink.InboundAPI/ScadaLink.InboundAPI.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.InboundAPI/ZB.MOM.WW.ScadaBridge.InboundAPI.csproj @@ -12,15 +12,15 @@ - - + + - + - + diff --git a/src/ScadaLink.ManagementService/AuditEndpoints.cs b/src/ZB.MOM.WW.ScadaBridge.ManagementService/AuditEndpoints.cs similarity index 98% rename from src/ScadaLink.ManagementService/AuditEndpoints.cs rename to src/ZB.MOM.WW.ScadaBridge.ManagementService/AuditEndpoints.cs index 4f7428cd..2d68087c 100644 --- a/src/ScadaLink.ManagementService/AuditEndpoints.cs +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/AuditEndpoints.cs @@ -6,18 +6,18 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Management; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.ManagementService; +namespace ZB.MOM.WW.ScadaBridge.ManagementService; /// /// Minimal-API endpoints exposing the central Audit Log (#23) over HTTP for the -/// ScadaLink CLI (M8). Two routes: +/// ScadaBridge CLI (M8). Two routes: /// /// GET /api/audit/query — keyset-paged JSON page, gated on the /// permission. diff --git a/src/ScadaLink.ManagementService/DebugStreamHub.cs b/src/ZB.MOM.WW.ScadaBridge.ManagementService/DebugStreamHub.cs similarity index 97% rename from src/ScadaLink.ManagementService/DebugStreamHub.cs rename to src/ZB.MOM.WW.ScadaBridge.ManagementService/DebugStreamHub.cs index 593b2831..4021ec67 100644 --- a/src/ScadaLink.ManagementService/DebugStreamHub.cs +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/DebugStreamHub.cs @@ -2,13 +2,13 @@ using System.Text; using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.DebugView; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Communication; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DebugView; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.ManagementService; +namespace ZB.MOM.WW.ScadaBridge.ManagementService; /// /// SignalR hub for real-time debug stream subscriptions. diff --git a/src/ScadaLink.ManagementService/ManagementActor.cs b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs similarity index 98% rename from src/ScadaLink.ManagementService/ManagementActor.cs rename to src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs index f8a65f04..5dfcb5af 100644 --- a/src/ScadaLink.ManagementService/ManagementActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActor.cs @@ -4,31 +4,31 @@ using System.Text.Json.Serialization; using Akka.Actor; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Security; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.DebugView; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Messages.Management; -using ScadaLink.Commons.Messages.RemoteQuery; -using ScadaLink.Commons.Types.InboundApi; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.DeploymentManager; -using ScadaLink.HealthMonitoring; -using ScadaLink.Communication; -using ScadaLink.Security; -using ScadaLink.TemplateEngine; -using ScadaLink.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DebugView; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.DeploymentManager; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Security; +using ZB.MOM.WW.ScadaBridge.TemplateEngine; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; -namespace ScadaLink.ManagementService; +namespace ZB.MOM.WW.ScadaBridge.ManagementService; /// /// Central actor that handles all management commands from the CLI (via ClusterClient). @@ -1380,7 +1380,7 @@ public class ManagementActor : ReceiveActor var svc = sp.GetRequiredService(); var attr = new TemplateAttribute(cmd.Name) { - DataType = Enum.Parse(cmd.DataType, ignoreCase: true), + DataType = Enum.Parse(cmd.DataType, ignoreCase: true), Value = cmd.Value, Description = cmd.Description, DataSourceReference = cmd.DataSourceReference, @@ -1395,7 +1395,7 @@ public class ManagementActor : ReceiveActor var svc = sp.GetRequiredService(); var attr = new TemplateAttribute(cmd.Name) { - DataType = Enum.Parse(cmd.DataType, ignoreCase: true), + DataType = Enum.Parse(cmd.DataType, ignoreCase: true), Value = cmd.Value, Description = cmd.Description, DataSourceReference = cmd.DataSourceReference, @@ -1417,7 +1417,7 @@ public class ManagementActor : ReceiveActor var svc = sp.GetRequiredService(); var alarm = new TemplateAlarm(cmd.Name) { - TriggerType = Enum.Parse(cmd.TriggerType, ignoreCase: true), + TriggerType = Enum.Parse(cmd.TriggerType, ignoreCase: true), PriorityLevel = cmd.PriorityLevel, Description = cmd.Description, TriggerConfiguration = cmd.TriggerConfiguration, @@ -1432,7 +1432,7 @@ public class ManagementActor : ReceiveActor var svc = sp.GetRequiredService(); var alarm = new TemplateAlarm(cmd.Name) { - TriggerType = Enum.Parse(cmd.TriggerType, ignoreCase: true), + TriggerType = Enum.Parse(cmd.TriggerType, ignoreCase: true), PriorityLevel = cmd.PriorityLevel, Description = cmd.Description, TriggerConfiguration = cmd.TriggerConfiguration, diff --git a/src/ScadaLink.ManagementService/ManagementActorHolder.cs b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActorHolder.cs similarity index 80% rename from src/ScadaLink.ManagementService/ManagementActorHolder.cs rename to src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActorHolder.cs index e9ae8c48..bf306e29 100644 --- a/src/ScadaLink.ManagementService/ManagementActorHolder.cs +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementActorHolder.cs @@ -1,6 +1,6 @@ using Akka.Actor; -namespace ScadaLink.ManagementService; +namespace ZB.MOM.WW.ScadaBridge.ManagementService; public class ManagementActorHolder { diff --git a/src/ScadaLink.ManagementService/ManagementEndpoints.cs b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementEndpoints.cs similarity index 98% rename from src/ScadaLink.ManagementService/ManagementEndpoints.cs rename to src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementEndpoints.cs index e97f21c2..c9ebb30e 100644 --- a/src/ScadaLink.ManagementService/ManagementEndpoints.cs +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementEndpoints.cs @@ -7,10 +7,10 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.Management; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.ManagementService; +namespace ZB.MOM.WW.ScadaBridge.ManagementService; public static class ManagementEndpoints { diff --git a/src/ScadaLink.ManagementService/ManagementServiceOptions.cs b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementServiceOptions.cs similarity index 83% rename from src/ScadaLink.ManagementService/ManagementServiceOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementServiceOptions.cs index faff0c90..d21150f2 100644 --- a/src/ScadaLink.ManagementService/ManagementServiceOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ManagementServiceOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.ManagementService; +namespace ZB.MOM.WW.ScadaBridge.ManagementService; public class ManagementServiceOptions { diff --git a/src/ScadaLink.ManagementService/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ServiceCollectionExtensions.cs similarity index 82% rename from src/ScadaLink.ManagementService/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.ManagementService/ServiceCollectionExtensions.cs index 723c2a44..6491b455 100644 --- a/src/ScadaLink.ManagementService/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ServiceCollectionExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace ScadaLink.ManagementService; +namespace ZB.MOM.WW.ScadaBridge.ManagementService; public static class ServiceCollectionExtensions { @@ -12,7 +12,7 @@ public static class ServiceCollectionExtensions { services.AddSingleton(); services.AddOptions() - .BindConfiguration("ScadaLink:ManagementService"); + .BindConfiguration("ScadaBridge:ManagementService"); return services; } } diff --git a/src/ZB.MOM.WW.ScadaBridge.ManagementService/ZB.MOM.WW.ScadaBridge.ManagementService.csproj b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ZB.MOM.WW.ScadaBridge.ManagementService.csproj new file mode 100644 index 00000000..56a0bf81 --- /dev/null +++ b/src/ZB.MOM.WW.ScadaBridge.ManagementService/ZB.MOM.WW.ScadaBridge.ManagementService.csproj @@ -0,0 +1,24 @@ + + + net10.0 + enable + enable + true + + + + + + + + + + + + + + + + + + diff --git a/src/ScadaLink.NotificationOutbox/Delivery/DeliveryOutcome.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/DeliveryOutcome.cs similarity index 96% rename from src/ScadaLink.NotificationOutbox/Delivery/DeliveryOutcome.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/DeliveryOutcome.cs index 8172fe2b..685ca5ac 100644 --- a/src/ScadaLink.NotificationOutbox/Delivery/DeliveryOutcome.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/DeliveryOutcome.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationOutbox.Delivery; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; /// /// Classification of a single delivery attempt. Transient failures are eligible for diff --git a/src/ScadaLink.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs similarity index 96% rename from src/ScadaLink.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs index 7395b904..97baed46 100644 --- a/src/ScadaLink.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/EmailNotificationDeliveryAdapter.cs @@ -1,16 +1,16 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationService; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationService; -namespace ScadaLink.NotificationOutbox.Delivery; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; /// /// Task 12: Email channel delivery adapter for the central notification outbox. /// -/// Reuses the SMTP primitives — +/// Reuses the SMTP primitives — /// , , /// and the typed . /// This adapter owns the full connect/auth/send/disconnect sequence and maps the diff --git a/src/ScadaLink.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs similarity index 83% rename from src/ScadaLink.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs index 54ced603..c8d15cc6 100644 --- a/src/ScadaLink.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Delivery/INotificationDeliveryAdapter.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.NotificationOutbox.Delivery; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; /// /// Channel-specific delivery strategy for outbox notifications. Each adapter handles diff --git a/src/ScadaLink.NotificationOutbox/Messages/InternalMessages.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Messages/InternalMessages.cs similarity index 98% rename from src/ScadaLink.NotificationOutbox/Messages/InternalMessages.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Messages/InternalMessages.cs index 69f57df4..d9357e9a 100644 --- a/src/ScadaLink.NotificationOutbox/Messages/InternalMessages.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/Messages/InternalMessages.cs @@ -1,6 +1,6 @@ using Akka.Actor; -namespace ScadaLink.NotificationOutbox.Messages; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; /// /// Actor-internal message types for the . These are diff --git a/src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs similarity index 98% rename from src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs index 0803c3f0..b205f5cf 100644 --- a/src/ScadaLink.NotificationOutbox/NotificationOutboxActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxActor.cs @@ -1,17 +1,17 @@ using Akka.Actor; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Notifications; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; -namespace ScadaLink.NotificationOutbox; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox; /// /// Central-side actor that owns the notification outbox. It accepts diff --git a/src/ScadaLink.NotificationOutbox/NotificationOutboxOptions.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxOptions.cs similarity index 97% rename from src/ScadaLink.NotificationOutbox/NotificationOutboxOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxOptions.cs index 3f98a005..7c10473d 100644 --- a/src/ScadaLink.NotificationOutbox/NotificationOutboxOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/NotificationOutboxOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationOutbox; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox; /// /// Configuration options for the Notification Outbox component: dispatch cadence, diff --git a/src/ScadaLink.NotificationOutbox/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/ServiceCollectionExtensions.cs similarity index 85% rename from src/ScadaLink.NotificationOutbox/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/ServiceCollectionExtensions.cs index 2645ad00..d3b8d0e2 100644 --- a/src/ScadaLink.NotificationOutbox/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/ServiceCollectionExtensions.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.DependencyInjection; -using ScadaLink.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; -namespace ScadaLink.NotificationOutbox; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox; /// /// DI registration for the Notification Outbox component: binds @@ -10,7 +10,7 @@ namespace ScadaLink.NotificationOutbox; public static class ServiceCollectionExtensions { /// Configuration section bound to . - public const string OptionsSection = "ScadaLink:NotificationOutbox"; + public const string OptionsSection = "ScadaBridge:NotificationOutbox"; /// /// Registers the Notification Outbox services: the @@ -18,14 +18,14 @@ public static class ServiceCollectionExtensions /// /// This extension covers only the outbox-specific registrations. The /// reuses the - /// SMTP machinery — + /// SMTP machinery — /// Func<ISmtpClientWrapper>, OAuth2TokenService and /// NotificationOptions — so the caller (the Host on the central node) must also /// call AddNotificationService(). Re-registering those services here would /// duplicate them; relying on AddNotificationService keeps a single source of truth. /// /// is registered scoped because it - /// takes a scoped + /// takes a scoped /// directly. The resolves the adapters from a fresh /// scope per dispatch sweep rather than holding them, so no scoped adapter is captured by /// the singleton actor. diff --git a/src/ScadaLink.NotificationOutbox/ScadaLink.NotificationOutbox.csproj b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/ZB.MOM.WW.ScadaBridge.NotificationOutbox.csproj similarity index 70% rename from src/ScadaLink.NotificationOutbox/ScadaLink.NotificationOutbox.csproj rename to src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/ZB.MOM.WW.ScadaBridge.NotificationOutbox.csproj index c52791b8..8498f29d 100644 --- a/src/ScadaLink.NotificationOutbox/ScadaLink.NotificationOutbox.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationOutbox/ZB.MOM.WW.ScadaBridge.NotificationOutbox.csproj @@ -13,22 +13,22 @@ - + - + - + - + diff --git a/src/ScadaLink.NotificationService/CredentialRedactor.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/CredentialRedactor.cs similarity index 98% rename from src/ScadaLink.NotificationService/CredentialRedactor.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/CredentialRedactor.cs index 257eb1c8..eb631030 100644 --- a/src/ScadaLink.NotificationService/CredentialRedactor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/CredentialRedactor.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// NS-009: Scrubs SMTP credential secrets out of free text (typically exception diff --git a/src/ScadaLink.NotificationService/EmailAddressValidator.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/EmailAddressValidator.cs similarity index 92% rename from src/ScadaLink.NotificationService/EmailAddressValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/EmailAddressValidator.cs index 62ee8d08..51b07ffa 100644 --- a/src/ScadaLink.NotificationService/EmailAddressValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/EmailAddressValidator.cs @@ -1,7 +1,7 @@ using MimeKit; -using ScadaLink.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// NS-008: Validates the sender and recipient email addresses before an SMTP diff --git a/src/ScadaLink.NotificationService/ISmtpClientWrapper.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/ISmtpClientWrapper.cs similarity index 98% rename from src/ScadaLink.NotificationService/ISmtpClientWrapper.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/ISmtpClientWrapper.cs index 14cff028..084a5c6d 100644 --- a/src/ScadaLink.NotificationService/ISmtpClientWrapper.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/ISmtpClientWrapper.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// Abstraction over SMTP client for testability. diff --git a/src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs similarity index 97% rename from src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs index 6396d5f3..2bb2f4f7 100644 --- a/src/ScadaLink.NotificationService/MailKitSmtpClientWrapper.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/MailKitSmtpClientWrapper.cs @@ -2,7 +2,7 @@ using MailKit.Net.Smtp; using MailKit.Security; using MimeKit; -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// WP-11: MailKit-based SMTP client wrapper. @@ -20,7 +20,7 @@ namespace ScadaLink.NotificationService; /// /// The DI registration (AddSingleton<Func<ISmtpClientWrapper>>) /// is therefore a per-delivery FACTORY, not a singleton wrapper: callers -/// () +/// () /// invoke the factory at the top of every DeliverAsync, run the /// connect/authenticate/send/disconnect sequence on the fresh wrapper, and /// dispose it at the end of the send. Each delivery pays a full TCP+TLS diff --git a/src/ScadaLink.NotificationService/NotificationOptions.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationOptions.cs similarity index 89% rename from src/ScadaLink.NotificationService/NotificationOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationOptions.cs index 6663778c..467f11fb 100644 --- a/src/ScadaLink.NotificationService/NotificationOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/NotificationOptions.cs @@ -1,8 +1,8 @@ -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// Configuration options for the Notification Service, bound from the -/// ScadaLink:Notification configuration section. +/// ScadaBridge:Notification configuration section. /// /// SMTP settings are primarily carried by the deployed SmtpConfiguration /// entity. NS-017: these values are the fallback used by the central diff --git a/src/ScadaLink.NotificationService/OAuth2TokenService.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/OAuth2TokenService.cs similarity index 98% rename from src/ScadaLink.NotificationService/OAuth2TokenService.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/OAuth2TokenService.cs index b44b7050..8855c36c 100644 --- a/src/ScadaLink.NotificationService/OAuth2TokenService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/OAuth2TokenService.cs @@ -4,7 +4,7 @@ using System.Text; using System.Text.Json; using Microsoft.Extensions.Logging; -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// WP-11: OAuth2 Client Credentials token lifecycle — fetch, cache, refresh on expiry. diff --git a/src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs similarity index 90% rename from src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs index 87e9da3e..8cf2189e 100644 --- a/src/ScadaLink.NotificationService/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/ServiceCollectionExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; public static class ServiceCollectionExtensions { @@ -11,13 +11,13 @@ public static class ServiceCollectionExtensions /// Central-only — sites no longer deliver notifications (see /// Component-NotificationService.md), and the orphaned site-shaped /// NotificationDeliveryService + INotificationDeliveryService contract - /// was removed (NS-019). Notification dispatch lives in ScadaLink.NotificationOutbox. + /// was removed (NS-019). Notification dispatch lives in ZB.MOM.WW.ScadaBridge.NotificationOutbox. /// /// The service collection to register into. public static IServiceCollection AddNotificationService(this IServiceCollection services) { services.AddOptions() - .BindConfiguration("ScadaLink:Notification"); + .BindConfiguration("ScadaBridge:Notification"); services.AddHttpClient(); services.AddSingleton(); diff --git a/src/ScadaLink.NotificationService/SmtpErrorClassifier.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpErrorClassifier.cs similarity index 98% rename from src/ScadaLink.NotificationService/SmtpErrorClassifier.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpErrorClassifier.cs index ff5b09b0..07ba56f8 100644 --- a/src/ScadaLink.NotificationService/SmtpErrorClassifier.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpErrorClassifier.cs @@ -2,7 +2,7 @@ using System.Net.Sockets; using MailKit; using MailKit.Net.Smtp; -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// NS-002/NS-003: The classification of an SMTP delivery failure. This decides diff --git a/src/ScadaLink.NotificationService/SmtpPermanentException.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpPermanentException.cs similarity index 91% rename from src/ScadaLink.NotificationService/SmtpPermanentException.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpPermanentException.cs index 26abeab7..373ef9d1 100644 --- a/src/ScadaLink.NotificationService/SmtpPermanentException.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpPermanentException.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// Signals a permanent SMTP failure (5xx) that should not be retried. diff --git a/src/ScadaLink.NotificationService/SmtpTlsMode.cs b/src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpTlsMode.cs similarity index 97% rename from src/ScadaLink.NotificationService/SmtpTlsMode.cs rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpTlsMode.cs index 011ba172..62196458 100644 --- a/src/ScadaLink.NotificationService/SmtpTlsMode.cs +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/SmtpTlsMode.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationService; +namespace ZB.MOM.WW.ScadaBridge.NotificationService; /// /// NS-005: The three TLS modes the design doc defines for SMTP connections. diff --git a/src/ScadaLink.NotificationService/ScadaLink.NotificationService.csproj b/src/ZB.MOM.WW.ScadaBridge.NotificationService/ZB.MOM.WW.ScadaBridge.NotificationService.csproj similarity index 68% rename from src/ScadaLink.NotificationService/ScadaLink.NotificationService.csproj rename to src/ZB.MOM.WW.ScadaBridge.NotificationService/ZB.MOM.WW.ScadaBridge.NotificationService.csproj index 43b11cf3..a0a11ddf 100644 --- a/src/ScadaLink.NotificationService/ScadaLink.NotificationService.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.NotificationService/ZB.MOM.WW.ScadaBridge.NotificationService.csproj @@ -16,12 +16,12 @@ - - + + - + diff --git a/src/ScadaLink.Security/AuthorizationPolicies.cs b/src/ZB.MOM.WW.ScadaBridge.Security/AuthorizationPolicies.cs similarity index 94% rename from src/ScadaLink.Security/AuthorizationPolicies.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/AuthorizationPolicies.cs index 78339572..421018d5 100644 --- a/src/ScadaLink.Security/AuthorizationPolicies.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/AuthorizationPolicies.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; /// /// Centralised authorization policy names + the role→permission mapping @@ -12,7 +12,7 @@ namespace ScadaLink.Security; /// permission, satisfied when the principal carries any role claim /// () that maps to that /// permission. Role names are free strings configured via -/// rows +/// rows /// (see ) — there is no permission claim, just a /// fan-out from role to allowed policies. /// @@ -107,10 +107,10 @@ public static class AuthorizationPolicies public static readonly string[] AuditExportRoles = { Roles.Admin, Roles.Audit }; /// - /// Registers the ScadaLink authorization policies (Admin, Design, Deployment, OperationalAudit, AuditExport). + /// Registers the ScadaBridge authorization policies (Admin, Design, Deployment, OperationalAudit, AuditExport). /// /// The service collection to register into. - public static IServiceCollection AddScadaLinkAuthorization(this IServiceCollection services) + public static IServiceCollection AddScadaBridgeAuthorization(this IServiceCollection services) { services.AddAuthorization(options => { diff --git a/src/ScadaLink.Security/JwtTokenService.cs b/src/ZB.MOM.WW.ScadaBridge.Security/JwtTokenService.cs similarity index 98% rename from src/ScadaLink.Security/JwtTokenService.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/JwtTokenService.cs index 381065f3..b0cc4285 100644 --- a/src/ScadaLink.Security/JwtTokenService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/JwtTokenService.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.IdentityModel.Tokens; -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; public class JwtTokenService { @@ -24,10 +24,10 @@ public class JwtTokenService /// between the two central nodes, accidental reuse of the same secret for an /// unrelated internal token would otherwise be silently exploitable. /// - public const string TokenIssuer = "scadalink-central"; + public const string TokenIssuer = "scadabridge-central"; /// Fixed audience bound into every token and required on validation. - public const string TokenAudience = "scadalink-central"; + public const string TokenAudience = "scadabridge-central"; /// Initializes the service and validates the JWT signing key meets the minimum length requirement. /// Security options containing the JWT signing key, expiry, and timeout settings. diff --git a/src/ScadaLink.Security/LdapAuthResult.cs b/src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthResult.cs similarity index 79% rename from src/ScadaLink.Security/LdapAuthResult.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthResult.cs index fff0caef..54cc23ea 100644 --- a/src/ScadaLink.Security/LdapAuthResult.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthResult.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; public record LdapAuthResult( bool Success, diff --git a/src/ScadaLink.Security/LdapAuthService.cs b/src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs similarity index 99% rename from src/ScadaLink.Security/LdapAuthService.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs index 2e139070..389506ad 100644 --- a/src/ScadaLink.Security/LdapAuthService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/LdapAuthService.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Novell.Directory.Ldap; -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; public class LdapAuthService { diff --git a/src/ScadaLink.Security/LdapTransport.cs b/src/ZB.MOM.WW.ScadaBridge.Security/LdapTransport.cs similarity index 94% rename from src/ScadaLink.Security/LdapTransport.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/LdapTransport.cs index 42508fde..c4cdc1a0 100644 --- a/src/ScadaLink.Security/LdapTransport.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/LdapTransport.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; /// /// Transport security mode for the LDAP connection. The design requires either diff --git a/src/ScadaLink.Security/RoleMapper.cs b/src/ZB.MOM.WW.ScadaBridge.Security/RoleMapper.cs similarity index 93% rename from src/ScadaLink.Security/RoleMapper.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/RoleMapper.cs index 65d97f85..314ff1a7 100644 --- a/src/ScadaLink.Security/RoleMapper.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/RoleMapper.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; public class RoleMapper { @@ -15,7 +15,7 @@ public class RoleMapper // virtual: a test seam so HTTP-pipeline tests (e.g. the #23 M8 audit // endpoints) can substitute the LDAP-group→role resolution. - /// Maps a list of LDAP group names to ScadaLink roles and computes site-scope permissions. + /// Maps a list of LDAP group names to ScadaBridge roles and computes site-scope permissions. /// LDAP group names from the authenticated user's directory entry. /// Cancellation token. /// A containing matched roles, permitted site IDs, and the system-wide flag. diff --git a/src/ScadaLink.Security/RoleMappingResult.cs b/src/ZB.MOM.WW.ScadaBridge.Security/RoleMappingResult.cs similarity index 77% rename from src/ScadaLink.Security/RoleMappingResult.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/RoleMappingResult.cs index 9ff45911..e0ad6133 100644 --- a/src/ScadaLink.Security/RoleMappingResult.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/RoleMappingResult.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; public record RoleMappingResult( IReadOnlyList Roles, diff --git a/src/ScadaLink.Security/Roles.cs b/src/ZB.MOM.WW.ScadaBridge.Security/Roles.cs similarity index 95% rename from src/ScadaLink.Security/Roles.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/Roles.cs index 0332b37c..77b8156c 100644 --- a/src/ScadaLink.Security/Roles.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/Roles.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; /// /// Single source of truth for role-name string literals used across the diff --git a/src/ScadaLink.Security/SecurityOptions.cs b/src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptions.cs similarity index 99% rename from src/ScadaLink.Security/SecurityOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptions.cs index c7922aa8..e4b8d5dc 100644 --- a/src/ScadaLink.Security/SecurityOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; public class SecurityOptions { diff --git a/src/ScadaLink.Security/SecurityOptionsValidator.cs b/src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptionsValidator.cs similarity index 98% rename from src/ScadaLink.Security/SecurityOptionsValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptionsValidator.cs index 178f07da..3c1fe144 100644 --- a/src/ScadaLink.Security/SecurityOptionsValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/SecurityOptionsValidator.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Options; -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; /// /// Security-020: validates at startup so a diff --git a/src/ScadaLink.Security/ServiceAccountBindException.cs b/src/ZB.MOM.WW.ScadaBridge.Security/ServiceAccountBindException.cs similarity index 93% rename from src/ScadaLink.Security/ServiceAccountBindException.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/ServiceAccountBindException.cs index 000419c0..0e3dd715 100644 --- a/src/ScadaLink.Security/ServiceAccountBindException.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/ServiceAccountBindException.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; /// /// Thrown by when the configured LDAP service-account diff --git a/src/ScadaLink.Security/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.Security/ServiceCollectionExtensions.cs similarity index 95% rename from src/ScadaLink.Security/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.Security/ServiceCollectionExtensions.cs index 32f3474e..33074a80 100644 --- a/src/ScadaLink.Security/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Security/ServiceCollectionExtensions.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace ScadaLink.Security; +namespace ZB.MOM.WW.ScadaBridge.Security; public static class ServiceCollectionExtensions { @@ -35,7 +35,7 @@ public static class ServiceCollectionExtensions { options.LoginPath = "/login"; options.LogoutPath = "/auth/logout"; - options.Cookie.Name = "ScadaLink.Auth"; + options.Cookie.Name = "ZB.MOM.WW.ScadaBridge.Auth"; options.Cookie.HttpOnly = true; options.Cookie.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.Strict; // Cookie.SecurePolicy is set in the PostConfigure block below so it @@ -79,12 +79,12 @@ public static class ServiceCollectionExtensions // explicit opt-out (typically the dev Docker cluster). if (!securityOptions.Value.RequireHttpsCookie) { - loggerFactory.CreateLogger("ScadaLink.Security").LogWarning( + loggerFactory.CreateLogger("ZB.MOM.WW.ScadaBridge.Security").LogWarning( "SecurityOptions:RequireHttpsCookie is DISABLED — auth cookie SecurePolicy is SameAsRequest. The cookie-embedded JWT will be transmitted in cleartext over plain HTTP. This setting is intended for local dev only — set SecurityOptions:RequireHttpsCookie=true in production."); } }); - services.AddScadaLinkAuthorization(); + services.AddScadaBridgeAuthorization(); return services; } diff --git a/src/ScadaLink.Security/ScadaLink.Security.csproj b/src/ZB.MOM.WW.ScadaBridge.Security/ZB.MOM.WW.ScadaBridge.Security.csproj similarity index 87% rename from src/ScadaLink.Security/ScadaLink.Security.csproj rename to src/ZB.MOM.WW.ScadaBridge.Security/ZB.MOM.WW.ScadaBridge.Security.csproj index c27ca875..6cf3e155 100644 --- a/src/ScadaLink.Security/ScadaLink.Security.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.Security/ZB.MOM.WW.ScadaBridge.Security.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/ScadaLink.SiteCallAudit/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/ServiceCollectionExtensions.cs similarity index 86% rename from src/ScadaLink.SiteCallAudit/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/ServiceCollectionExtensions.cs index d38cf098..d786440f 100644 --- a/src/ScadaLink.SiteCallAudit/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/ServiceCollectionExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace ScadaLink.SiteCallAudit; +namespace ZB.MOM.WW.ScadaBridge.SiteCallAudit; /// /// Composition root for the Site Call Audit (#22) component. @@ -13,7 +13,7 @@ namespace ScadaLink.SiteCallAudit; /// /// /// The repository (ISiteCallAuditRepository) is registered by -/// ScadaLink.ConfigurationDatabase.ServiceCollectionExtensions.AddConfigurationDatabase, +/// ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.ServiceCollectionExtensions.AddConfigurationDatabase, /// so callers (the Host on the central node) must also call that. The actor's /// Props are wired up in Host registration. /// @@ -21,7 +21,7 @@ namespace ScadaLink.SiteCallAudit; public static class ServiceCollectionExtensions { /// Configuration section bound to . - public const string OptionsSection = "ScadaLink:SiteCallAudit"; + public const string OptionsSection = "ScadaBridge:SiteCallAudit"; /// /// Registers Site Call Audit (#22) services: the diff --git a/src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs similarity index 98% rename from src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs index 9a8614f2..64361e7e 100644 --- a/src/ScadaLink.SiteCallAudit/SiteCallAuditActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditActor.cs @@ -1,20 +1,20 @@ using Akka.Actor; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Messages.RemoteQuery; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Communication; -namespace ScadaLink.SiteCallAudit; +namespace ZB.MOM.WW.ScadaBridge.SiteCallAudit; /// /// Central singleton for Site Call Audit (#22). Receives /// messages and persists each -/// row via +/// row via /// — idempotent monotonic /// upsert. Out-of-order or duplicate updates are silent no-ops at the /// repository layer; the actor always replies @@ -711,7 +711,7 @@ public class SiteCallAuditActor : ReceiveActor /// with the so it can relay Retry/Discard /// actions on parked cached calls to their owning sites. Sent by the Host after /// both actors exist. Lives here (not in Commons) because it carries an -/// and ScadaLink.Commons has no Akka reference — +/// and ZB.MOM.WW.ScadaBridge.Commons has no Akka reference — /// the same rationale as RegisterAuditIngest. /// public sealed record RegisterCentralCommunication(IActorRef CentralCommunication); diff --git a/src/ScadaLink.SiteCallAudit/SiteCallAuditOptions.cs b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditOptions.cs similarity index 98% rename from src/ScadaLink.SiteCallAudit/SiteCallAuditOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditOptions.cs index d29b71da..a5db3102 100644 --- a/src/ScadaLink.SiteCallAudit/SiteCallAuditOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/SiteCallAuditOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteCallAudit; +namespace ZB.MOM.WW.ScadaBridge.SiteCallAudit; /// /// Configuration options for the Site Call Audit (#22) read-side: stuck-call diff --git a/src/ScadaLink.SiteCallAudit/ScadaLink.SiteCallAudit.csproj b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/ZB.MOM.WW.ScadaBridge.SiteCallAudit.csproj similarity index 68% rename from src/ScadaLink.SiteCallAudit/ScadaLink.SiteCallAudit.csproj rename to src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/ZB.MOM.WW.ScadaBridge.SiteCallAudit.csproj index 0a46f34c..cca4f3eb 100644 --- a/src/ScadaLink.SiteCallAudit/ScadaLink.SiteCallAudit.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.SiteCallAudit/ZB.MOM.WW.ScadaBridge.SiteCallAudit.csproj @@ -18,21 +18,21 @@ - + - + - + in ZB.MOM.WW.ScadaBridge.Communication (no cycle: Communication does not reference SiteCallAudit). --> + - + diff --git a/src/ScadaLink.SiteEventLogging/EventLogHandlerActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogHandlerActor.cs similarity index 89% rename from src/ScadaLink.SiteEventLogging/EventLogHandlerActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogHandlerActor.cs index a77099ff..8ac83e28 100644 --- a/src/ScadaLink.SiteEventLogging/EventLogHandlerActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogHandlerActor.cs @@ -1,8 +1,8 @@ using Akka.Actor; using Akka.Event; -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; /// /// Akka actor bridge for . diff --git a/src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs similarity index 99% rename from src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs index 8b032bdc..2e97845d 100644 --- a/src/ScadaLink.SiteEventLogging/EventLogPurgeService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogPurgeService.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; /// /// SiteEventLogging-019: predicate the diff --git a/src/ScadaLink.SiteEventLogging/EventLogQueryService.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs similarity index 98% rename from src/ScadaLink.SiteEventLogging/EventLogQueryService.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs index e7bb1b41..22c6c01c 100644 --- a/src/ScadaLink.SiteEventLogging/EventLogQueryService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/EventLogQueryService.cs @@ -2,9 +2,9 @@ using System.Globalization; using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; /// /// Processes event log queries locally against SQLite. diff --git a/src/ScadaLink.SiteEventLogging/IEventLogQueryService.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/IEventLogQueryService.cs similarity index 82% rename from src/ScadaLink.SiteEventLogging/IEventLogQueryService.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/IEventLogQueryService.cs index ab3466bc..e7d01614 100644 --- a/src/ScadaLink.SiteEventLogging/IEventLogQueryService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/IEventLogQueryService.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; /// /// Interface for querying site event logs. diff --git a/src/ScadaLink.SiteEventLogging/ISiteEventLogger.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ISiteEventLogger.cs similarity index 97% rename from src/ScadaLink.SiteEventLogging/ISiteEventLogger.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ISiteEventLogger.cs index 22c467b7..7a4a5300 100644 --- a/src/ScadaLink.SiteEventLogging/ISiteEventLogger.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ISiteEventLogger.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; /// /// Interface for recording operational events to the local SQLite event log. diff --git a/src/ScadaLink.SiteEventLogging/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ServiceCollectionExtensions.cs similarity index 94% rename from src/ScadaLink.SiteEventLogging/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ServiceCollectionExtensions.cs index 66e07aae..180e267c 100644 --- a/src/ScadaLink.SiteEventLogging/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ServiceCollectionExtensions.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; public static class ServiceCollectionExtensions { @@ -38,7 +38,7 @@ public static class ServiceCollectionExtensions } // NOTE: EventLogHandlerActor is wired up directly in - // ScadaLink.Host/Actors/AkkaHostedService.cs as a cluster singleton, because the + // ZB.MOM.WW.ScadaBridge.Host/Actors/AkkaHostedService.cs as a cluster singleton, because the // actor must be created inside the ActorSystem with the resolved // IEventLogQueryService. There is intentionally no DI helper for that here — a // former AddSiteEventLoggingActors placeholder was dead code and has been removed. diff --git a/src/ScadaLink.SiteEventLogging/SiteEventLogOptions.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogOptions.cs similarity index 97% rename from src/ScadaLink.SiteEventLogging/SiteEventLogOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogOptions.cs index 6fa3b5c3..3b4b5258 100644 --- a/src/ScadaLink.SiteEventLogging/SiteEventLogOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; public class SiteEventLogOptions { diff --git a/src/ScadaLink.SiteEventLogging/SiteEventLogger.cs b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs similarity index 99% rename from src/ScadaLink.SiteEventLogging/SiteEventLogger.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs index a09e7275..c1937fda 100644 --- a/src/ScadaLink.SiteEventLogging/SiteEventLogger.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/SiteEventLogger.cs @@ -3,7 +3,7 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging; /// /// Records operational events to a local SQLite database. diff --git a/src/ScadaLink.SiteEventLogging/ScadaLink.SiteEventLogging.csproj b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ZB.MOM.WW.ScadaBridge.SiteEventLogging.csproj similarity index 80% rename from src/ScadaLink.SiteEventLogging/ScadaLink.SiteEventLogging.csproj rename to src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ZB.MOM.WW.ScadaBridge.SiteEventLogging.csproj index 587699f0..f6df1c1d 100644 --- a/src/ScadaLink.SiteEventLogging/ScadaLink.SiteEventLogging.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.SiteEventLogging/ZB.MOM.WW.ScadaBridge.SiteEventLogging.csproj @@ -17,11 +17,11 @@ - + - + diff --git a/src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs index c2ab08b1..bafd20d9 100644 --- a/src/ScadaLink.SiteRuntime/Actors/AlarmActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmActor.cs @@ -1,15 +1,15 @@ using Akka.Actor; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.HealthMonitoring; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Globalization; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; /// /// WP-16: Alarm Actor — coordinator actor, child of Instance Actor, peer to Script Actors. diff --git a/src/ScadaLink.SiteRuntime/Actors/AlarmExecutionActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmExecutionActor.cs similarity index 95% rename from src/ScadaLink.SiteRuntime/Actors/AlarmExecutionActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmExecutionActor.cs index b4707a54..0a8e1f6b 100644 --- a/src/ScadaLink.SiteRuntime/Actors/AlarmExecutionActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/AlarmExecutionActor.cs @@ -1,12 +1,12 @@ using Akka.Actor; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Scripts; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; /// /// WP-16: Alarm Execution Actor -- short-lived child of Alarm Actor. diff --git a/src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs index b617145c..65721653 100644 --- a/src/ScadaLink.SiteRuntime/Actors/DeploymentManagerActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/DeploymentManagerActor.cs @@ -1,20 +1,20 @@ using Akka.Actor; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Messages.Artifacts; -using ScadaLink.Commons.Messages.DebugView; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.InboundApi; -using ScadaLink.Commons.Messages.Instance; -using ScadaLink.Commons.Messages.Lifecycle; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.HealthMonitoring; -using ScadaLink.SiteRuntime.Messages; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.SiteRuntime.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Artifacts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DebugView; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Lifecycle; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Messages; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Streaming; -namespace ScadaLink.SiteRuntime.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; /// /// Site-side Deployment Manager — runs as a cluster singleton within the site cluster. diff --git a/src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs similarity index 97% rename from src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs index 0f8e9557..e34b2cab 100644 --- a/src/ScadaLink.SiteRuntime/Actors/InstanceActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/InstanceActor.cs @@ -1,20 +1,20 @@ using Akka.Actor; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Messages.DataConnection; -using ScadaLink.Commons.Messages.DebugView; -using ScadaLink.Commons.Messages.Instance; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.HealthMonitoring; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.SiteRuntime.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DataConnection; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DebugView; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Streaming; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; /// /// Represents a single deployed instance at runtime. Holds the in-memory attribute state @@ -549,7 +549,7 @@ public class InstanceActor : ReceiveActor /// WP-25: Debug view unsubscribe (SiteRuntime-013). /// This handler is a deliberate no-op acknowledgement: the Instance Actor holds /// no per-subscriber state. The real debug-stream subscription lifecycle lives in - /// + /// /// (Subscribe / Unsubscribe / RemoveSubscriber); the gRPC stream is torn down /// there when the central side cancels the call. Nothing is removed here. /// diff --git a/src/ScadaLink.SiteRuntime/Actors/ScriptActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptActor.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Actors/ScriptActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptActor.cs index 00820fd5..9372ede3 100644 --- a/src/ScadaLink.SiteRuntime/Actors/ScriptActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptActor.cs @@ -2,16 +2,16 @@ using Akka.Actor; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.HealthMonitoring; -using ScadaLink.SiteEventLogging; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.SiteEventLogging; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Globalization; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; /// /// WP-15: Script Actor — coordinator actor, child of Instance Actor. diff --git a/src/ScadaLink.SiteRuntime/Actors/ScriptExecutionActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptExecutionActor.cs similarity index 96% rename from src/ScadaLink.SiteRuntime/Actors/ScriptExecutionActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptExecutionActor.cs index c1514333..77d2e58f 100644 --- a/src/ScadaLink.SiteRuntime/Actors/ScriptExecutionActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/ScriptExecutionActor.cs @@ -2,16 +2,16 @@ using Akka.Actor; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Interfaces; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Types; -using ScadaLink.HealthMonitoring; -using ScadaLink.SiteEventLogging; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.SiteEventLogging; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.SiteRuntime.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; /// /// WP-15: Script Execution Actor -- short-lived child of Script Actor. @@ -20,7 +20,7 @@ namespace ScadaLink.SiteRuntime.Actors; /// /// The actor itself and its mailbox run on the default Akka dispatcher; only the /// script body is dispatched off the actor thread, onto the dedicated -/// +/// /// (SiteRuntime-009), so blocking script I/O cannot starve the shared thread pool /// or stall other Akka dispatchers. /// diff --git a/src/ScadaLink.SiteRuntime/Actors/SiteReplicationActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/SiteReplicationActor.cs similarity index 97% rename from src/ScadaLink.SiteRuntime/Actors/SiteReplicationActor.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/SiteReplicationActor.cs index 81e14d7d..84423503 100644 --- a/src/ScadaLink.SiteRuntime/Actors/SiteReplicationActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/SiteReplicationActor.cs @@ -2,11 +2,11 @@ using Akka.Actor; using Akka.Cluster; using Akka.Event; using Microsoft.Extensions.Logging; -using ScadaLink.SiteRuntime.Messages; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Messages; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.SiteRuntime.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; /// /// Runs on every site node (not a singleton). Handles both config and S&F replication diff --git a/src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs similarity index 93% rename from src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs index 5b0e0e6a..e28f1174 100644 --- a/src/ScadaLink.SiteRuntime/Messages/ReplicationMessages.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Messages/ReplicationMessages.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Messages.Artifacts; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Artifacts; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.SiteRuntime.Messages; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Messages; // Outbound messages — sent by local DeploymentManagerActor/S&F service // to the local SiteReplicationActor for forwarding to the peer node. diff --git a/src/ScadaLink.SiteRuntime/Persistence/SiteStorageInitializer.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageInitializer.cs similarity index 95% rename from src/ScadaLink.SiteRuntime/Persistence/SiteStorageInitializer.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageInitializer.cs index 84a981be..3fe17662 100644 --- a/src/ScadaLink.SiteRuntime/Persistence/SiteStorageInitializer.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageInitializer.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Hosting; -namespace ScadaLink.SiteRuntime.Persistence; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; /// /// Hosted service that initializes the SQLite schema on startup. diff --git a/src/ScadaLink.SiteRuntime/Persistence/SiteStorageService.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageService.cs similarity index 99% rename from src/ScadaLink.SiteRuntime/Persistence/SiteStorageService.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageService.cs index 7e35b214..4fdeb1ee 100644 --- a/src/ScadaLink.SiteRuntime/Persistence/SiteStorageService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Persistence/SiteStorageService.cs @@ -1,7 +1,7 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging; -namespace ScadaLink.SiteRuntime.Persistence; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; /// /// Direct SQLite persistence for site-local deployment state. diff --git a/src/ScadaLink.SiteRuntime/Repositories/SiteExternalSystemRepository.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteExternalSystemRepository.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Repositories/SiteExternalSystemRepository.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteExternalSystemRepository.cs index 4809c2e4..691289c1 100644 --- a/src/ScadaLink.SiteRuntime/Repositories/SiteExternalSystemRepository.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteExternalSystemRepository.cs @@ -1,10 +1,10 @@ using System.Text.Json; using Microsoft.Data.Sqlite; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; -namespace ScadaLink.SiteRuntime.Repositories; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Repositories; /// /// Site-side read-only implementation of diff --git a/src/ScadaLink.SiteRuntime/Repositories/SiteNotificationRepository.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteNotificationRepository.cs similarity index 97% rename from src/ScadaLink.SiteRuntime/Repositories/SiteNotificationRepository.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteNotificationRepository.cs index a8efb822..5fea2b96 100644 --- a/src/ScadaLink.SiteRuntime/Repositories/SiteNotificationRepository.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SiteNotificationRepository.cs @@ -1,10 +1,10 @@ using System.Text.Json; using Microsoft.Data.Sqlite; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; -namespace ScadaLink.SiteRuntime.Repositories; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Repositories; /// /// Site-side read-only implementation of diff --git a/src/ScadaLink.SiteRuntime/Repositories/SyntheticId.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SyntheticId.cs similarity index 95% rename from src/ScadaLink.SiteRuntime/Repositories/SyntheticId.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SyntheticId.cs index 10b4a416..93fbcfc3 100644 --- a/src/ScadaLink.SiteRuntime/Repositories/SyntheticId.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Repositories/SyntheticId.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteRuntime.Repositories; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Repositories; /// /// SiteRuntime-007: deterministic synthetic-ID generation for site-local artifacts. diff --git a/src/ScadaLink.SiteRuntime/Scripts/AuditingDbCommand.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbCommand.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Scripts/AuditingDbCommand.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbCommand.cs index e24827a2..595af4c8 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/AuditingDbCommand.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbCommand.cs @@ -2,11 +2,11 @@ using System.Data; using System.Data.Common; using System.Diagnostics; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// Audit Log #23 — M4 Bundle A: decorator that emits diff --git a/src/ScadaLink.SiteRuntime/Scripts/AuditingDbConnection.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbConnection.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Scripts/AuditingDbConnection.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbConnection.cs index be9fe290..77505870 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/AuditingDbConnection.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbConnection.cs @@ -1,9 +1,9 @@ using System.Data; using System.Data.Common; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// Audit Log #23 — M4 Bundle A: thin decorator over the diff --git a/src/ScadaLink.SiteRuntime/Scripts/AuditingDbDataReader.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbDataReader.cs similarity index 99% rename from src/ScadaLink.SiteRuntime/Scripts/AuditingDbDataReader.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbDataReader.cs index edcec398..0da5c2f4 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/AuditingDbDataReader.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/AuditingDbDataReader.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Data.Common; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// Audit Log #23 — M4 Bundle A: decorator that diff --git a/src/ScadaLink.SiteRuntime/Scripts/ScopeAccessors.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScopeAccessors.cs similarity index 99% rename from src/ScadaLink.SiteRuntime/Scripts/ScopeAccessors.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScopeAccessors.cs index 5a434c18..5b3bc031 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/ScopeAccessors.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScopeAccessors.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// Scope-aware view onto the instance's attributes, anchored at a path prefix. diff --git a/src/ScadaLink.SiteRuntime/Scripts/ScriptCompilationService.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptCompilationService.cs similarity index 99% rename from src/ScadaLink.SiteRuntime/Scripts/ScriptCompilationService.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptCompilationService.cs index 433c847f..f1b65d3a 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/ScriptCompilationService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptCompilationService.cs @@ -4,9 +4,9 @@ using Microsoft.CodeAnalysis.CSharp.Scripting; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// WP-19: Script Trust Model — compiles C# scripts using Roslyn with restricted API access. diff --git a/src/ScadaLink.SiteRuntime/Scripts/ScriptExecutionScheduler.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptExecutionScheduler.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Scripts/ScriptExecutionScheduler.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptExecutionScheduler.cs index 82a9eea5..22001219 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/ScriptExecutionScheduler.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptExecutionScheduler.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// SiteRuntime-009: a dedicated, bounded for running script diff --git a/src/ScadaLink.SiteRuntime/Scripts/ScriptRuntimeContext.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs similarity index 99% rename from src/ScadaLink.SiteRuntime/Scripts/ScriptRuntimeContext.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs index 517181c0..d2d6cd3d 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/ScriptRuntimeContext.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs @@ -3,18 +3,18 @@ using System.Text.Json; using System.Text.RegularExpressions; using Akka.Actor; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Instance; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// WP-18: Script Runtime API — injected into Script/Alarm Execution Actors. @@ -531,7 +531,7 @@ public class ScriptRuntimeContext /// Optional forwarder for cached call telemetry. /// Optional identifier of the parent execution (for routed calls). /// Optional cluster node identifier (node-a/node-b) for audit stamping. - // Internal constructor for tests living in ScadaLink.SiteRuntime.Tests + // Internal constructor for tests living in ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests // (via InternalsVisibleTo). Production sites resolve the helper through // ScriptRuntimeContext.ExternalSystem. // diff --git a/src/ScadaLink.SiteRuntime/Scripts/SharedScriptLibrary.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/SharedScriptLibrary.cs similarity index 97% rename from src/ScadaLink.SiteRuntime/Scripts/SharedScriptLibrary.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/SharedScriptLibrary.cs index 94b11a25..f65c4817 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/SharedScriptLibrary.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/SharedScriptLibrary.cs @@ -1,8 +1,8 @@ using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// WP-17: Shared Script Library — stores compiled shared script delegates in memory. diff --git a/src/ScadaLink.SiteRuntime/Scripts/TriggerExpressionGlobals.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/TriggerExpressionGlobals.cs similarity index 98% rename from src/ScadaLink.SiteRuntime/Scripts/TriggerExpressionGlobals.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/TriggerExpressionGlobals.cs index f63abc0b..7928251d 100644 --- a/src/ScadaLink.SiteRuntime/Scripts/TriggerExpressionGlobals.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/TriggerExpressionGlobals.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace ScadaLink.SiteRuntime.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; /// /// Read-only globals a trigger expression is compiled against. Exposes only diff --git a/src/ScadaLink.SiteRuntime/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ServiceCollectionExtensions.cs similarity index 89% rename from src/ScadaLink.SiteRuntime/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ServiceCollectionExtensions.cs index 0336bc9a..ec76383f 100644 --- a/src/ScadaLink.SiteRuntime/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ServiceCollectionExtensions.cs @@ -1,14 +1,14 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.Communication.Grpc; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Repositories; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.SiteRuntime.Streaming; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Repositories; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Streaming; -namespace ScadaLink.SiteRuntime; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime; public static class ServiceCollectionExtensions { diff --git a/src/ScadaLink.SiteRuntime/SiteRuntimeOptions.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/SiteRuntimeOptions.cs similarity index 93% rename from src/ScadaLink.SiteRuntime/SiteRuntimeOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/SiteRuntimeOptions.cs index ae1a886c..fa86c445 100644 --- a/src/ScadaLink.SiteRuntime/SiteRuntimeOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/SiteRuntimeOptions.cs @@ -1,8 +1,8 @@ -namespace ScadaLink.SiteRuntime; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime; /// /// Configuration options for the Site Runtime component. -/// Bound from ScadaLink:SiteRuntime configuration section. +/// Bound from ScadaBridge:SiteRuntime configuration section. /// public class SiteRuntimeOptions { diff --git a/src/ScadaLink.SiteRuntime/Streaming/SiteStreamManager.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Streaming/SiteStreamManager.cs similarity index 97% rename from src/ScadaLink.SiteRuntime/Streaming/SiteStreamManager.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Streaming/SiteStreamManager.cs index c7c3875d..527ab960 100644 --- a/src/ScadaLink.SiteRuntime/Streaming/SiteStreamManager.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Streaming/SiteStreamManager.cs @@ -3,10 +3,10 @@ using Akka.Actor; using Akka.Streams; using Akka.Streams.Dsl; using Microsoft.Extensions.Logging; -using ScadaLink.Communication.Grpc; -using ScadaLink.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; -namespace ScadaLink.SiteRuntime.Streaming; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Streaming; /// /// WP-23: Site-Wide Akka Stream — manages a broadcast stream for attribute value diff --git a/src/ScadaLink.SiteRuntime/Tracking/OperationTrackingOptions.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingOptions.cs similarity index 93% rename from src/ScadaLink.SiteRuntime/Tracking/OperationTrackingOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingOptions.cs index b2fcf7d3..64446648 100644 --- a/src/ScadaLink.SiteRuntime/Tracking/OperationTrackingOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteRuntime.Tracking; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tracking; /// /// Options for — site-local cached-call diff --git a/src/ScadaLink.SiteRuntime/Tracking/OperationTrackingStore.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingStore.cs similarity index 99% rename from src/ScadaLink.SiteRuntime/Tracking/OperationTrackingStore.cs rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingStore.cs index 7698da79..6b4be05c 100644 --- a/src/ScadaLink.SiteRuntime/Tracking/OperationTrackingStore.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Tracking/OperationTrackingStore.cs @@ -2,10 +2,10 @@ using System.Globalization; using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Interfaces; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.SiteRuntime.Tracking; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tracking; /// /// Site-local SQLite source-of-truth for cached-operation tracking — the row diff --git a/src/ScadaLink.SiteRuntime/ScadaLink.SiteRuntime.csproj b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ZB.MOM.WW.ScadaBridge.SiteRuntime.csproj similarity index 61% rename from src/ScadaLink.SiteRuntime/ScadaLink.SiteRuntime.csproj rename to src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ZB.MOM.WW.ScadaBridge.SiteRuntime.csproj index da712a0a..ea57dae4 100644 --- a/src/ScadaLink.SiteRuntime/ScadaLink.SiteRuntime.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/ZB.MOM.WW.ScadaBridge.SiteRuntime.csproj @@ -21,23 +21,23 @@ - + - + - - - - - + + + + + diff --git a/src/ScadaLink.StoreAndForward/IStoreAndForwardSiteContext.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/IStoreAndForwardSiteContext.cs similarity index 95% rename from src/ScadaLink.StoreAndForward/IStoreAndForwardSiteContext.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/IStoreAndForwardSiteContext.cs index e15290fc..2786e4ac 100644 --- a/src/ScadaLink.StoreAndForward/IStoreAndForwardSiteContext.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/IStoreAndForwardSiteContext.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// Optional ambient site context the Store-and-Forward service consults at diff --git a/src/ScadaLink.StoreAndForward/NotificationForwarder.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/NotificationForwarder.cs similarity index 97% rename from src/ScadaLink.StoreAndForward/NotificationForwarder.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/NotificationForwarder.cs index 61d968a6..a3b14669 100644 --- a/src/ScadaLink.StoreAndForward/NotificationForwarder.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/NotificationForwarder.cs @@ -2,13 +2,13 @@ using System.Text.Json; using Akka.Actor; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// Notification Outbox: the site Store-and-Forward delivery handler for the -/// +/// /// category. /// /// In the outbox design the site no longer sends notification email itself. diff --git a/src/ScadaLink.StoreAndForward/ParkedMessageHandlerActor.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ParkedMessageHandlerActor.cs similarity index 98% rename from src/ScadaLink.StoreAndForward/ParkedMessageHandlerActor.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ParkedMessageHandlerActor.cs index c0e0651b..dbcb167f 100644 --- a/src/ScadaLink.StoreAndForward/ParkedMessageHandlerActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ParkedMessageHandlerActor.cs @@ -1,9 +1,9 @@ using System.Text.Json; using Akka.Actor; using Akka.Event; -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// Akka actor bridge for parked-message operations. diff --git a/src/ScadaLink.StoreAndForward/ReplicationService.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ReplicationService.cs similarity index 98% rename from src/ScadaLink.StoreAndForward/ReplicationService.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ReplicationService.cs index 0e42b25c..c183b6b9 100644 --- a/src/ScadaLink.StoreAndForward/ReplicationService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ReplicationService.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// WP-11: Async replication of buffer operations to standby node. diff --git a/src/ScadaLink.StoreAndForward/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ServiceCollectionExtensions.cs similarity index 97% rename from src/ScadaLink.StoreAndForward/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ServiceCollectionExtensions.cs index f923f4fa..77da6516 100644 --- a/src/ScadaLink.StoreAndForward/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ServiceCollectionExtensions.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; public static class ServiceCollectionExtensions { diff --git a/src/ScadaLink.StoreAndForward/StoreAndForwardMessage.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardMessage.cs similarity index 97% rename from src/ScadaLink.StoreAndForward/StoreAndForwardMessage.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardMessage.cs index ba521af7..269621d6 100644 --- a/src/ScadaLink.StoreAndForward/StoreAndForwardMessage.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardMessage.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// WP-9: Represents a single store-and-forward message as stored in SQLite. diff --git a/src/ScadaLink.StoreAndForward/StoreAndForwardOptions.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardOptions.cs similarity index 97% rename from src/ScadaLink.StoreAndForward/StoreAndForwardOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardOptions.cs index d025f353..31b8feb7 100644 --- a/src/ScadaLink.StoreAndForward/StoreAndForwardOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// WP-9/10: Configuration options for the Store-and-Forward Engine. diff --git a/src/ScadaLink.StoreAndForward/StoreAndForwardService.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs similarity index 99% rename from src/ScadaLink.StoreAndForward/StoreAndForwardService.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs index 07162323..b00ddba2 100644 --- a/src/ScadaLink.StoreAndForward/StoreAndForwardService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardService.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// WP-9/10: Core store-and-forward service. diff --git a/src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs similarity index 99% rename from src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs index 6324c0cd..b19cb77c 100644 --- a/src/ScadaLink.StoreAndForward/StoreAndForwardStorage.cs +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/StoreAndForwardStorage.cs @@ -1,8 +1,8 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward; /// /// WP-9: SQLite persistence layer for store-and-forward messages. diff --git a/src/ScadaLink.StoreAndForward/ScadaLink.StoreAndForward.csproj b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ZB.MOM.WW.ScadaBridge.StoreAndForward.csproj similarity index 78% rename from src/ScadaLink.StoreAndForward/ScadaLink.StoreAndForward.csproj rename to src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ZB.MOM.WW.ScadaBridge.StoreAndForward.csproj index 82b3c15e..c997e571 100644 --- a/src/ScadaLink.StoreAndForward/ScadaLink.StoreAndForward.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.StoreAndForward/ZB.MOM.WW.ScadaBridge.StoreAndForward.csproj @@ -16,11 +16,11 @@ - + - + diff --git a/src/ScadaLink.TemplateEngine/CollisionDetector.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CollisionDetector.cs similarity index 98% rename from src/ScadaLink.TemplateEngine/CollisionDetector.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CollisionDetector.cs index 6cf910ef..bf496ef5 100644 --- a/src/ScadaLink.TemplateEngine/CollisionDetector.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CollisionDetector.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; /// /// Detects naming collisions across composed module members using canonical (path-qualified) names. diff --git a/src/ScadaLink.TemplateEngine/CycleDetector.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CycleDetector.cs similarity index 98% rename from src/ScadaLink.TemplateEngine/CycleDetector.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CycleDetector.cs index 0310b659..ef38aa72 100644 --- a/src/ScadaLink.TemplateEngine/CycleDetector.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/CycleDetector.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; /// /// Detects cycles in template inheritance and composition graphs. diff --git a/src/ScadaLink.TemplateEngine/Flattening/DiffService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/DiffService.cs similarity index 97% rename from src/ScadaLink.TemplateEngine/Flattening/DiffService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/DiffService.cs index 08238964..71acf3f3 100644 --- a/src/ScadaLink.TemplateEngine/Flattening/DiffService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/DiffService.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; -namespace ScadaLink.TemplateEngine.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; /// /// Compares two FlattenedConfigurations (deployed vs current) and produces a ConfigurationDiff @@ -161,7 +161,7 @@ public class DiffService /// connection name. Mirrors the existing /// shape used for attributes / alarms / scripts but is exposed as a separate /// method because in - /// ScadaLink.Commons does not yet carry a ConnectionChanges + /// ZB.MOM.WW.ScadaBridge.Commons does not yet carry a ConnectionChanges /// slot — the public diff record will be extended in a paired Commons change /// (this file is the only one in this fix's scope). A null /// Connections dictionary on either side is treated as the empty map. diff --git a/src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs similarity index 99% rename from src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs index a4bb7acc..aff9c2d2 100644 --- a/src/ScadaLink.TemplateEngine/Flattening/FlatteningService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/FlatteningService.cs @@ -1,12 +1,12 @@ using System.Text.Json; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; -namespace ScadaLink.TemplateEngine.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; /// /// Implements the template flattening algorithm. diff --git a/src/ScadaLink.TemplateEngine/Flattening/RevisionHashService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/RevisionHashService.cs similarity index 98% rename from src/ScadaLink.TemplateEngine/Flattening/RevisionHashService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/RevisionHashService.cs index a11f635e..011fc2d5 100644 --- a/src/ScadaLink.TemplateEngine/Flattening/RevisionHashService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Flattening/RevisionHashService.cs @@ -2,9 +2,9 @@ using System.Security.Cryptography; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using ScadaLink.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; -namespace ScadaLink.TemplateEngine.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; /// /// Produces a deterministic SHA-256 hash of a FlattenedConfiguration. diff --git a/src/ScadaLink.TemplateEngine/LockEnforcer.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/LockEnforcer.cs similarity index 98% rename from src/ScadaLink.TemplateEngine/LockEnforcer.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/LockEnforcer.cs index 07a14805..29990183 100644 --- a/src/ScadaLink.TemplateEngine/LockEnforcer.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/LockEnforcer.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; /// /// Enforces locking rules for template member overrides. diff --git a/src/ScadaLink.TemplateEngine/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ServiceCollectionExtensions.cs similarity index 89% rename from src/ScadaLink.TemplateEngine/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ServiceCollectionExtensions.cs index fa17cbd9..1e0319f8 100644 --- a/src/ScadaLink.TemplateEngine/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ServiceCollectionExtensions.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.DependencyInjection; -using ScadaLink.TemplateEngine.Flattening; -using ScadaLink.TemplateEngine.Services; -using ScadaLink.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; public static class ServiceCollectionExtensions { diff --git a/src/ScadaLink.TemplateEngine/Services/AreaService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/AreaService.cs similarity index 97% rename from src/ScadaLink.TemplateEngine/Services/AreaService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/AreaService.cs index 78889590..ceb391ac 100644 --- a/src/ScadaLink.TemplateEngine/Services/AreaService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/AreaService.cs @@ -1,9 +1,9 @@ -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.TemplateEngine.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; /// /// Hierarchical area management per site. diff --git a/src/ScadaLink.TemplateEngine/Services/InstanceService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/InstanceService.cs similarity index 98% rename from src/ScadaLink.TemplateEngine/Services/InstanceService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/InstanceService.cs index 61130af1..0dd483a5 100644 --- a/src/ScadaLink.TemplateEngine/Services/InstanceService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/InstanceService.cs @@ -1,12 +1,12 @@ -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Management; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.TemplateEngine; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.TemplateEngine; -namespace ScadaLink.TemplateEngine.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; /// /// Instance CRUD operations. diff --git a/src/ScadaLink.TemplateEngine/Services/SiteService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/SiteService.cs similarity index 97% rename from src/ScadaLink.TemplateEngine/Services/SiteService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/SiteService.cs index ac832057..ca4a6f3b 100644 --- a/src/ScadaLink.TemplateEngine/Services/SiteService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/SiteService.cs @@ -1,9 +1,9 @@ -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.TemplateEngine.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; /// /// Site and data connection management. diff --git a/src/ScadaLink.TemplateEngine/Services/TemplateDeletionService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateDeletionService.cs similarity index 96% rename from src/ScadaLink.TemplateEngine/Services/TemplateDeletionService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateDeletionService.cs index d2e45224..3e2535a7 100644 --- a/src/ScadaLink.TemplateEngine/Services/TemplateDeletionService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateDeletionService.cs @@ -1,8 +1,8 @@ -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.TemplateEngine.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; /// /// Enforces template deletion constraints (WP-25). diff --git a/src/ScadaLink.TemplateEngine/Services/TemplateFolderService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateFolderService.cs similarity index 97% rename from src/ScadaLink.TemplateEngine/Services/TemplateFolderService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateFolderService.cs index 97663a42..04fca859 100644 --- a/src/ScadaLink.TemplateEngine/Services/TemplateFolderService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Services/TemplateFolderService.cs @@ -1,9 +1,9 @@ -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.TemplateEngine.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; public class TemplateFolderService { diff --git a/src/ScadaLink.TemplateEngine/SharedScriptService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/SharedScriptService.cs similarity index 97% rename from src/ScadaLink.TemplateEngine/SharedScriptService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/SharedScriptService.cs index 9025c393..1cfb0ba8 100644 --- a/src/ScadaLink.TemplateEngine/SharedScriptService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/SharedScriptService.cs @@ -1,9 +1,9 @@ -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; /// /// WP-5: Shared Script CRUD. diff --git a/src/ScadaLink.TemplateEngine/TemplateNaming.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateNaming.cs similarity index 95% rename from src/ScadaLink.TemplateEngine/TemplateNaming.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateNaming.cs index 4066a2c5..2dbd2b78 100644 --- a/src/ScadaLink.TemplateEngine/TemplateNaming.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateNaming.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; /// /// Resolves the hierarchical ("qualified") name of a composition-derived diff --git a/src/ScadaLink.TemplateEngine/TemplateResolver.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateResolver.cs similarity index 98% rename from src/ScadaLink.TemplateEngine/TemplateResolver.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateResolver.cs index 07c56bef..19caaad9 100644 --- a/src/ScadaLink.TemplateEngine/TemplateResolver.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateResolver.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; /// /// Walks inheritance and composition chains to resolve effective template members. diff --git a/src/ScadaLink.TemplateEngine/TemplateService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs similarity index 99% rename from src/ScadaLink.TemplateEngine/TemplateService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs index bd4f2a2c..e9e138ee 100644 --- a/src/ScadaLink.TemplateEngine/TemplateService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/TemplateService.cs @@ -1,9 +1,9 @@ -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.TemplateEngine; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine; /// /// Core service for Template Engine operations. diff --git a/src/ScadaLink.TemplateEngine/Validation/CSharpDelimiterScanner.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/CSharpDelimiterScanner.cs similarity index 99% rename from src/ScadaLink.TemplateEngine/Validation/CSharpDelimiterScanner.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/CSharpDelimiterScanner.cs index 33e5f433..d607fafb 100644 --- a/src/ScadaLink.TemplateEngine/Validation/CSharpDelimiterScanner.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/CSharpDelimiterScanner.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.TemplateEngine.Validation; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; /// /// String/comment-aware scanner for the balanced-delimiter ("does it look like diff --git a/src/ScadaLink.TemplateEngine/Validation/ScriptCompiler.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ScriptCompiler.cs similarity index 98% rename from src/ScadaLink.TemplateEngine/Validation/ScriptCompiler.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ScriptCompiler.cs index 155f47a8..656f3683 100644 --- a/src/ScadaLink.TemplateEngine/Validation/ScriptCompiler.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ScriptCompiler.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.TemplateEngine.Validation; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; /// /// Validates script code by attempting to compile it using Roslyn. diff --git a/src/ScadaLink.TemplateEngine/Validation/SemanticValidator.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/SemanticValidator.cs similarity index 99% rename from src/ScadaLink.TemplateEngine/Validation/SemanticValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/SemanticValidator.cs index aa303532..cdb6db45 100644 --- a/src/ScadaLink.TemplateEngine/Validation/SemanticValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/SemanticValidator.cs @@ -1,7 +1,7 @@ using System.Text.Json; -using ScadaLink.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; -namespace ScadaLink.TemplateEngine.Validation; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; /// /// Semantic validation rules for a FlattenedConfiguration: diff --git a/src/ScadaLink.TemplateEngine/Validation/ValidationService.cs b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ValidationService.cs similarity index 99% rename from src/ScadaLink.TemplateEngine/Validation/ValidationService.cs rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ValidationService.cs index 542e282b..558e42c7 100644 --- a/src/ScadaLink.TemplateEngine/Validation/ValidationService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/Validation/ValidationService.cs @@ -1,7 +1,7 @@ using System.Text.Json; -using ScadaLink.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; -namespace ScadaLink.TemplateEngine.Validation; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; /// /// Pre-deployment validation pipeline. Validates a FlattenedConfiguration for correctness diff --git a/src/ScadaLink.TemplateEngine/ScadaLink.TemplateEngine.csproj b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ZB.MOM.WW.ScadaBridge.TemplateEngine.csproj similarity index 73% rename from src/ScadaLink.TemplateEngine/ScadaLink.TemplateEngine.csproj rename to src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ZB.MOM.WW.ScadaBridge.TemplateEngine.csproj index 8373c914..c8a75253 100644 --- a/src/ScadaLink.TemplateEngine/ScadaLink.TemplateEngine.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.TemplateEngine/ZB.MOM.WW.ScadaBridge.TemplateEngine.csproj @@ -8,7 +8,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/src/ScadaLink.Transport/Encryption/BundleManifestAad.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Encryption/BundleManifestAad.cs similarity index 92% rename from src/ScadaLink.Transport/Encryption/BundleManifestAad.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Encryption/BundleManifestAad.cs index 2b84a215..bd7b89a2 100644 --- a/src/ScadaLink.Transport/Encryption/BundleManifestAad.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Encryption/BundleManifestAad.cs @@ -1,9 +1,9 @@ using System.Security.Cryptography; using System.Text.Json; using System.Text.Json.Serialization; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Transport.Encryption; +namespace ZB.MOM.WW.ScadaBridge.Transport.Encryption; /// /// T-005: computes the AES-GCM Associated Authenticated Data (AAD) for a bundle's @@ -11,7 +11,7 @@ namespace ScadaLink.Transport.Encryption; /// derivative fields (ContentHash, Encryption) to known sentinel /// values — those depend on the ciphertext and the IV, so they cannot themselves /// be authenticated, but every OTHER manifest field (SourceEnvironment, -/// ExportedBy, ScadaLinkVersion, Summary, Contents, +/// ExportedBy, ScadaBridgeVersion, Summary, Contents, /// CreatedAtUtc, …) participates in the GCM tag. /// /// Threading this byte array through AesGcm.Encrypt / AesGcm.Decrypt diff --git a/src/ScadaLink.Transport/Encryption/BundleSecretEncryptor.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Encryption/BundleSecretEncryptor.cs similarity index 97% rename from src/ScadaLink.Transport/Encryption/BundleSecretEncryptor.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Encryption/BundleSecretEncryptor.cs index 5a728422..ec5fcfd5 100644 --- a/src/ScadaLink.Transport/Encryption/BundleSecretEncryptor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Encryption/BundleSecretEncryptor.cs @@ -1,7 +1,7 @@ using System.Security.Cryptography; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Transport.Encryption; +namespace ZB.MOM.WW.ScadaBridge.Transport.Encryption; /// /// AES-256-GCM authenticated encryption with a PBKDF2-SHA256 derived key. diff --git a/src/ScadaLink.Transport/Export/BundleExporter.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Export/BundleExporter.cs similarity index 94% rename from src/ScadaLink.Transport/Export/BundleExporter.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Export/BundleExporter.cs index b392fa36..119f947d 100644 --- a/src/ScadaLink.Transport/Export/BundleExporter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Export/BundleExporter.cs @@ -1,13 +1,13 @@ using System.Security.Cryptography; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.Transport.Encryption; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.Export; +namespace ZB.MOM.WW.ScadaBridge.Transport.Export; /// /// Ties together the resolver, serializer, encryptor, manifest builder, and audit @@ -24,7 +24,7 @@ public sealed class BundleExporter : IBundleExporter private readonly BundleSecretEncryptor _encryptor; private readonly BundleSerializer _bundleSerializer; private readonly IAuditService _auditService; - private readonly ScadaLinkDbContext _dbContext; + private readonly ScadaBridgeDbContext _dbContext; private readonly IOptions _options; /// Initializes the exporter with all pipeline collaborators. @@ -43,7 +43,7 @@ public sealed class BundleExporter : IBundleExporter BundleSecretEncryptor encryptor, BundleSerializer bundleSerializer, IAuditService auditService, - ScadaLinkDbContext dbContext, + ScadaBridgeDbContext dbContext, IOptions options) { _resolver = resolver ?? throw new ArgumentNullException(nameof(resolver)); diff --git a/src/ScadaLink.Transport/Export/DependencyResolver.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Export/DependencyResolver.cs similarity index 97% rename from src/ScadaLink.Transport/Export/DependencyResolver.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Export/DependencyResolver.cs index 770f5064..b6aaf6d4 100644 --- a/src/ScadaLink.Transport/Export/DependencyResolver.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Export/DependencyResolver.cs @@ -1,12 +1,12 @@ -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Transport.Export; +namespace ZB.MOM.WW.ScadaBridge.Transport.Export; /// /// Expands an into the full set of entities that diff --git a/src/ScadaLink.Transport/Export/ResolvedExport.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Export/ResolvedExport.cs similarity index 71% rename from src/ScadaLink.Transport/Export/ResolvedExport.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Export/ResolvedExport.cs index f0834f21..4ad5649c 100644 --- a/src/ScadaLink.Transport/Export/ResolvedExport.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Export/ResolvedExport.cs @@ -1,11 +1,11 @@ -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Transport.Export; +namespace ZB.MOM.WW.ScadaBridge.Transport.Export; /// /// Output of — the full closure of diff --git a/src/ScadaLink.Transport/Import/ArtifactDiff.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/ArtifactDiff.cs similarity index 98% rename from src/ScadaLink.Transport/Import/ArtifactDiff.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/ArtifactDiff.cs index 93be6315..d6da90c5 100644 --- a/src/ScadaLink.Transport/Import/ArtifactDiff.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/ArtifactDiff.cs @@ -1,14 +1,14 @@ using System.Text.Json; using System.Text.Json.Serialization; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// Compares an incoming bundle DTO against the existing entity in the target diff --git a/src/ScadaLink.Transport/Import/BundleImporter.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs similarity index 98% rename from src/ScadaLink.Transport/Import/BundleImporter.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs index ac1066b0..18347dd0 100644 --- a/src/ScadaLink.Transport/Import/BundleImporter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleImporter.cs @@ -3,23 +3,23 @@ using System.Security.Cryptography; using System.Text.Json; using System.Text.Json.Serialization; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.TemplateEngine.Validation; -using ScadaLink.Transport.Encryption; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// Three-phase bundle importer: validates the @@ -31,7 +31,7 @@ namespace ScadaLink.Transport.Import; /// follow-up tasks can fill them in without churning the constructor. /// /// Audit-row responsibility: repository mutation methods in -/// ScadaLink.ConfigurationDatabase.Repositories are thin EF wrappers +/// ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories are thin EF wrappers /// and do NOT emit audit rows. therefore writes /// each per-entity audit row explicitly via ; /// the scoped is @@ -59,7 +59,7 @@ public sealed class BundleImporter : IBundleImporter private readonly EntitySerializer _entitySerializer; private readonly IAuditService _auditService; private readonly IAuditCorrelationContext _correlationContext; - private readonly ScadaLinkDbContext _dbContext; + private readonly ScadaBridgeDbContext _dbContext; private readonly ITemplateEngineRepository _templateRepo; private readonly IExternalSystemRepository _externalRepo; private readonly INotificationRepository _notificationRepo; @@ -103,7 +103,7 @@ public sealed class BundleImporter : IBundleImporter IInboundApiRepository inboundApiRepo, IAuditService auditService, IAuditCorrelationContext correlationContext, - ScadaLinkDbContext dbContext, + ScadaBridgeDbContext dbContext, SemanticValidator semanticValidator) { _bundleSerializer = bundleSerializer ?? throw new ArgumentNullException(nameof(bundleSerializer)); @@ -543,7 +543,7 @@ public sealed class BundleImporter : IBundleImporter /// Names that look like PascalCase references but are never user-defined /// SharedScripts or ExternalSystems. Filters the false-positive noise the /// identifier scan produces against real script bodies: .NET stdlib types - /// and helpers, ScadaLink runtime API roots, and common SQL keywords that + /// and helpers, ScadaBridge runtime API roots, and common SQL keywords that /// appear inside string literals. Match is case-sensitive (Ordinal). /// private static readonly HashSet KnownNonReferenceNames = new(StringComparer.Ordinal) @@ -556,7 +556,7 @@ public sealed class BundleImporter : IBundleImporter "ToDateTime", "ToDecimal", "ToDouble", "ToInt16", "ToInt32", "ToInt64", "ToList", "ToSingle", "ToString", "UtcNow", - // ScadaLink script runtime API roots and well-known members + // ScadaBridge script runtime API roots and well-known members "Attribute", "Attributes", "Call", "CallScript", "CallShared", "Connection", "CreateCommand", "Database", "ExecuteAsync", "ExecuteNonQueryAsync", "ExecuteReaderAsync", "ExecuteScalarAsync", diff --git a/src/ScadaLink.Transport/Import/BundleLockedException.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleLockedException.cs similarity index 96% rename from src/ScadaLink.Transport/Import/BundleLockedException.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleLockedException.cs index 4e40137c..987563a4 100644 --- a/src/ScadaLink.Transport/Import/BundleLockedException.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleLockedException.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// T-003: thrown by when an encrypted bundle has diff --git a/src/ScadaLink.Transport/Import/BundleSessionEvictionService.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleSessionEvictionService.cs similarity index 95% rename from src/ScadaLink.Transport/Import/BundleSessionEvictionService.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleSessionEvictionService.cs index 5715c7a3..2e19cd58 100644 --- a/src/ScadaLink.Transport/Import/BundleSessionEvictionService.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleSessionEvictionService.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// T-007: periodic background sweep that drives diff --git a/src/ScadaLink.Transport/Import/BundleSessionStore.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleSessionStore.cs similarity index 97% rename from src/ScadaLink.Transport/Import/BundleSessionStore.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleSessionStore.cs index a14fc585..a669c767 100644 --- a/src/ScadaLink.Transport/Import/BundleSessionStore.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleSessionStore.cs @@ -1,9 +1,9 @@ using System.Collections.Concurrent; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// In-memory implementation of backed by a diff --git a/src/ScadaLink.Transport/Import/BundleUnlockRateLimitedException.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleUnlockRateLimitedException.cs similarity index 96% rename from src/ScadaLink.Transport/Import/BundleUnlockRateLimitedException.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleUnlockRateLimitedException.cs index 3b5178ca..802b293f 100644 --- a/src/ScadaLink.Transport/Import/BundleUnlockRateLimitedException.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleUnlockRateLimitedException.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// Transport-004: thrown by when the caller diff --git a/src/ScadaLink.Transport/Import/BundleUnlockRateLimiter.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleUnlockRateLimiter.cs similarity index 99% rename from src/ScadaLink.Transport/Import/BundleUnlockRateLimiter.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleUnlockRateLimiter.cs index 8212b399..ac00cb7d 100644 --- a/src/ScadaLink.Transport/Import/BundleUnlockRateLimiter.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/BundleUnlockRateLimiter.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// Transport-004: in-memory sliding-window rate limiter for bundle-unlock passphrase diff --git a/src/ScadaLink.Transport/Import/SemanticValidationException.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/SemanticValidationException.cs similarity index 97% rename from src/ScadaLink.Transport/Import/SemanticValidationException.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Import/SemanticValidationException.cs index e2fd1cbd..569a903f 100644 --- a/src/ScadaLink.Transport/Import/SemanticValidationException.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Import/SemanticValidationException.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Transport.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Import; /// /// Thrown when the post-apply semantic validation pass detects that the merged diff --git a/src/ScadaLink.Transport/Serialization/BundleSerializer.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/BundleSerializer.cs similarity index 98% rename from src/ScadaLink.Transport/Serialization/BundleSerializer.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/BundleSerializer.cs index cee0b78d..3dd9f7cb 100644 --- a/src/ScadaLink.Transport/Serialization/BundleSerializer.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/BundleSerializer.cs @@ -1,10 +1,10 @@ using System.IO.Compression; using System.Text.Json; using System.Text.Json.Serialization; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; -namespace ScadaLink.Transport.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Serialization; /// /// Packs + into a diff --git a/src/ScadaLink.Transport/Serialization/EntityDtos.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntityDtos.cs similarity index 92% rename from src/ScadaLink.Transport/Serialization/EntityDtos.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntityDtos.cs index 53112b67..bd252cad 100644 --- a/src/ScadaLink.Transport/Serialization/EntityDtos.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntityDtos.cs @@ -1,11 +1,11 @@ -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Transport.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Serialization; /// /// In-memory aggregate of all bundle-eligible Commons entities. Matches the diff --git a/src/ScadaLink.Transport/Serialization/EntitySerializer.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntitySerializer.cs similarity index 98% rename from src/ScadaLink.Transport/Serialization/EntitySerializer.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntitySerializer.cs index c959002b..f562bebc 100644 --- a/src/ScadaLink.Transport/Serialization/EntitySerializer.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/EntitySerializer.cs @@ -1,10 +1,10 @@ -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.Transport.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Serialization; /// /// Converts between the persistence-shaped and diff --git a/src/ScadaLink.Transport/Serialization/ManifestBuilder.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/ManifestBuilder.cs similarity index 90% rename from src/ScadaLink.Transport/Serialization/ManifestBuilder.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/ManifestBuilder.cs index 85318c02..b8c08838 100644 --- a/src/ScadaLink.Transport/Serialization/ManifestBuilder.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/ManifestBuilder.cs @@ -1,7 +1,7 @@ using System.Security.Cryptography; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Transport.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Serialization; /// /// Builds a for a freshly serialized bundle. @@ -20,7 +20,7 @@ public sealed class ManifestBuilder /// /// Environment label identifying where the bundle was exported from. /// Username of the operator who performed the export. - /// ScadaLink version string stamped in the manifest. + /// ScadaBridge version string stamped in the manifest. /// Encryption metadata when the content is encrypted; null for plain bundles. /// High-level summary of artifact counts. /// Per-entry content table describing each artifact in the bundle. @@ -50,7 +50,7 @@ public sealed class ManifestBuilder CreatedAtUtc: DateTimeOffset.UtcNow, SourceEnvironment: sourceEnvironment, ExportedBy: exportedBy, - ScadaLinkVersion: scadaLinkVersion, + ScadaBridgeVersion: scadaLinkVersion, ContentHash: contentHash, Encryption: encryption, Summary: summary, diff --git a/src/ScadaLink.Transport/Serialization/ManifestValidator.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/ManifestValidator.cs similarity index 94% rename from src/ScadaLink.Transport/Serialization/ManifestValidator.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/ManifestValidator.cs index 1fd4265f..f02bcd0e 100644 --- a/src/ScadaLink.Transport/Serialization/ManifestValidator.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/Serialization/ManifestValidator.cs @@ -1,7 +1,7 @@ using System.Security.Cryptography; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Transport.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Serialization; /// /// Outcome of validating a against the supplied diff --git a/src/ScadaLink.Transport/ServiceCollectionExtensions.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/ServiceCollectionExtensions.cs similarity index 85% rename from src/ScadaLink.Transport/ServiceCollectionExtensions.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/ServiceCollectionExtensions.cs index f473229c..6a1b4c03 100644 --- a/src/ScadaLink.Transport/ServiceCollectionExtensions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/ServiceCollectionExtensions.cs @@ -1,18 +1,18 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.TemplateEngine.Validation; -using ScadaLink.Transport.Encryption; -using ScadaLink.Transport.Export; -using ScadaLink.Transport.Import; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Transport.Export; +using ZB.MOM.WW.ScadaBridge.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport; +namespace ZB.MOM.WW.ScadaBridge.Transport; public static class ServiceCollectionExtensions { - public const string OptionsSection = "ScadaLink:Transport"; + public const string OptionsSection = "ScadaBridge:Transport"; /// /// Registers the Transport component services: encryptor, manifest builder/validator, serializers, resolver, exporter, importer, and session store. diff --git a/src/ScadaLink.Transport/TransportOptions.cs b/src/ZB.MOM.WW.ScadaBridge.Transport/TransportOptions.cs similarity index 96% rename from src/ScadaLink.Transport/TransportOptions.cs rename to src/ZB.MOM.WW.ScadaBridge.Transport/TransportOptions.cs index be11c896..265580b5 100644 --- a/src/ScadaLink.Transport/TransportOptions.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/TransportOptions.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Transport; +namespace ZB.MOM.WW.ScadaBridge.Transport; public sealed class TransportOptions { @@ -44,5 +44,5 @@ public sealed class TransportOptions /// Bound from Transport:SourceEnvironment in appsettings*.json; /// the default placeholder is fine for single-cluster deployments. /// - public string SourceEnvironment { get; set; } = "scadalink"; + public string SourceEnvironment { get; set; } = "scadabridge"; } diff --git a/src/ScadaLink.Transport/ScadaLink.Transport.csproj b/src/ZB.MOM.WW.ScadaBridge.Transport/ZB.MOM.WW.ScadaBridge.Transport.csproj similarity index 53% rename from src/ScadaLink.Transport/ScadaLink.Transport.csproj rename to src/ZB.MOM.WW.ScadaBridge.Transport/ZB.MOM.WW.ScadaBridge.Transport.csproj index a2e1e03a..5ce58814 100644 --- a/src/ScadaLink.Transport/ScadaLink.Transport.csproj +++ b/src/ZB.MOM.WW.ScadaBridge.Transport/ZB.MOM.WW.ScadaBridge.Transport.csproj @@ -14,14 +14,14 @@ - - - + + + - - + + diff --git a/tests/ScadaLink.AuditLog.Tests/AddAuditLogTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/AddAuditLogTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/AddAuditLogTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/AddAuditLogTests.cs index ed1924c0..2e08f66d 100644 --- a/tests/ScadaLink.AuditLog.Tests/AddAuditLogTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/AddAuditLogTests.cs @@ -4,15 +4,15 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.AuditLog.Tests; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests; /// /// Bundle E (M2 Task E1) DI surface tests for AddAuditLog. M1 shipped diff --git a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogIngestActorCombinedTelemetryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogIngestActorCombinedTelemetryTests.cs similarity index 93% rename from tests/ScadaLink.AuditLog.Tests/Central/AuditLogIngestActorCombinedTelemetryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogIngestActorCombinedTelemetryTests.cs index 7e3d1ea7..5f38de70 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogIngestActorCombinedTelemetryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogIngestActorCombinedTelemetryTests.cs @@ -3,18 +3,18 @@ using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle D D2 tests for 's M3 combined- @@ -34,12 +34,12 @@ public class AuditLogIngestActorCombinedTelemetryTests : TestKit, IClassFixture< _fixture = fixture; } - private ScadaLinkDbContext CreateReadContext() + private ScadaBridgeDbContext CreateReadContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static string NewSiteId() => @@ -89,24 +89,24 @@ public class AuditLogIngestActorCombinedTelemetryTests : TestKit, IClassFixture< /// DataProtection wiring (we never write secret columns in these tests). /// private IServiceProvider BuildServiceProvider( - Func? siteCallRepoFactory = null) + Func? siteCallRepoFactory = null) { var services = new ServiceCollection(); - services.AddDbContext(opts => + services.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning))); services.AddScoped(sp => - new AuditLogRepository(sp.GetRequiredService())); + new AuditLogRepository(sp.GetRequiredService())); if (siteCallRepoFactory is null) { services.AddScoped(sp => - new SiteCallAuditRepository(sp.GetRequiredService())); + new SiteCallAuditRepository(sp.GetRequiredService())); } else { services.AddScoped(sp => - siteCallRepoFactory(sp.GetRequiredService())); + siteCallRepoFactory(sp.GetRequiredService())); } return services.BuildServiceProvider(); } diff --git a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogIngestActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogIngestActorTests.cs similarity index 91% rename from tests/ScadaLink.AuditLog.Tests/Central/AuditLogIngestActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogIngestActorTests.cs index 094e4b49..b546fb8e 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogIngestActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogIngestActorTests.cs @@ -2,17 +2,17 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle D D2 tests for . Uses the same @@ -30,12 +30,12 @@ public class AuditLogIngestActorTests : TestKit, IClassFixture() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static string NewSiteId() => @@ -221,7 +221,7 @@ public class AuditLogIngestActorTests : TestKit, IClassFixture _inner.GetPartitionBoundariesOlderThanAsync(threshold, ct); - public Task GetKpiSnapshotAsync( + public Task GetKpiSnapshotAsync( TimeSpan window, DateTime? nowUtc = null, CancellationToken ct = default) => _inner.GetKpiSnapshotAsync(window, nowUtc, ct); diff --git a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogPartitionMaintenanceServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogPartitionMaintenanceServiceTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Central/AuditLogPartitionMaintenanceServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogPartitionMaintenanceServiceTests.cs index 4e652077..b9d879d1 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogPartitionMaintenanceServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogPartitionMaintenanceServiceTests.cs @@ -2,18 +2,18 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; using Xunit; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle D (#23 M6-T5) tests for . /// All tests use an in-memory stub — /// the real EF/MSSQL implementation is exercised by the /// AuditLogPartitionMaintenanceTests integration suite in -/// ScadaLink.ConfigurationDatabase.Tests. This file is purely +/// ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests. This file is purely /// about the hosted service's policy decisions (start/stop, exception /// containment). /// diff --git a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogPurgeActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogPurgeActorTests.cs similarity index 94% rename from tests/ScadaLink.AuditLog.Tests/Central/AuditLogPurgeActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogPurgeActorTests.cs index aaaa6b6d..2b9a0b35 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/AuditLogPurgeActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/AuditLogPurgeActorTests.cs @@ -4,17 +4,17 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle C (#23 M6-T4) tests for . The fast, @@ -79,9 +79,9 @@ public class AuditLogPurgeActorTests : TestKit, IClassFixture>(Boundaries.ToArray()); } - public Task GetKpiSnapshotAsync( + public Task GetKpiSnapshotAsync( TimeSpan window, DateTime? nowUtc = null, CancellationToken ct = default) => - Task.FromResult(new ScadaLink.Commons.Types.AuditLogKpiSnapshot(0L, 0L, 0L, nowUtc ?? DateTime.UtcNow)); + Task.FromResult(new ZB.MOM.WW.ScadaBridge.Commons.Types.AuditLogKpiSnapshot(0L, 0L, 0L, nowUtc ?? DateTime.UtcNow)); public Task> GetExecutionTreeAsync( Guid executionId, CancellationToken ct = default) => @@ -303,7 +303,7 @@ public class AuditLogPurgeActorTests : TestKit, IClassFixture( + services.AddDbContext( opts => opts.UseSqlServer(_fixture.ConnectionString), ServiceLifetime.Scoped); services.AddScoped(); @@ -349,8 +349,8 @@ public class AuditLogPurgeActorTests : TestKit, IClassFixture r.EventId == aprEvt.EventId); } - private ScadaLinkDbContext CreateMsSqlContext() => - new(new DbContextOptionsBuilder() + private ScadaBridgeDbContext CreateMsSqlContext() => + new(new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString).Options); // --------------------------------------------------------------------- diff --git a/tests/ScadaLink.AuditLog.Tests/Central/CentralAuditRedactionFailureCounterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditRedactionFailureCounterTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Central/CentralAuditRedactionFailureCounterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditRedactionFailureCounterTests.cs index 795841b8..1932241f 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/CentralAuditRedactionFailureCounterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditRedactionFailureCounterTests.cs @@ -4,11 +4,11 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.AuditLog; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.AuditLog; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle E (M6-T9) coverage for the central-side payload-filter redactor diff --git a/tests/ScadaLink.AuditLog.Tests/Central/CentralAuditWriteFailuresTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditWriteFailuresTests.cs similarity index 91% rename from tests/ScadaLink.AuditLog.Tests/Central/CentralAuditWriteFailuresTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditWriteFailuresTests.cs index bad4feb0..5085217f 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/CentralAuditWriteFailuresTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditWriteFailuresTests.cs @@ -2,14 +2,14 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle E (M6-T8) regression coverage for the central-side audit-write @@ -48,9 +48,9 @@ public class CentralAuditWriteFailuresTests : TestKit public Task> GetPartitionBoundariesOlderThanAsync( DateTime threshold, CancellationToken ct = default) => Task.FromResult>(Array.Empty()); - public Task GetKpiSnapshotAsync( + public Task GetKpiSnapshotAsync( TimeSpan window, DateTime? nowUtc = null, CancellationToken ct = default) => - Task.FromResult(new ScadaLink.Commons.Types.AuditLogKpiSnapshot(0L, 0L, 0L, nowUtc ?? DateTime.UtcNow)); + Task.FromResult(new ZB.MOM.WW.ScadaBridge.Commons.Types.AuditLogKpiSnapshot(0L, 0L, 0L, nowUtc ?? DateTime.UtcNow)); public Task> GetExecutionTreeAsync( Guid executionId, CancellationToken ct = default) => @@ -136,7 +136,7 @@ public class CentralAuditWriteFailuresTests : TestKit ((ICentralAuditWriteFailureCounter)snapshot).Increment(); ((ICentralAuditWriteFailureCounter)snapshot).Increment(); - ((ScadaLink.AuditLog.Payload.IAuditRedactionFailureCounter)snapshot).Increment(); + ((ZB.MOM.WW.ScadaBridge.AuditLog.Payload.IAuditRedactionFailureCounter)snapshot).Increment(); // Wire the tracker so an EventStream publish reaches the snapshot. // The tracker pushes into the snapshot's ApplyStalled when given diff --git a/tests/ScadaLink.AuditLog.Tests/Central/CentralAuditWriterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditWriterTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Central/CentralAuditWriterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditWriterTests.cs index 3901f06b..84dc6d51 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/CentralAuditWriterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/CentralAuditWriterTests.cs @@ -2,14 +2,14 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// M4 Bundle B1 — unit tests for , the diff --git a/tests/ScadaLink.AuditLog.Tests/Central/SiteAuditReconciliationActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/SiteAuditReconciliationActorTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Central/SiteAuditReconciliationActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/SiteAuditReconciliationActorTests.cs index 447feabc..31655a24 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/SiteAuditReconciliationActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/SiteAuditReconciliationActorTests.cs @@ -4,17 +4,17 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle B (M6-T3) tests for . Most @@ -94,9 +94,9 @@ public class SiteAuditReconciliationActorTests : TestKit, IClassFixture Task.FromResult>(Array.Empty()); - public Task GetKpiSnapshotAsync( + public Task GetKpiSnapshotAsync( TimeSpan window, DateTime? nowUtc = null, CancellationToken ct = default) => - Task.FromResult(new ScadaLink.Commons.Types.AuditLogKpiSnapshot(0L, 0L, 0L, nowUtc ?? DateTime.UtcNow)); + Task.FromResult(new ZB.MOM.WW.ScadaBridge.Commons.Types.AuditLogKpiSnapshot(0L, 0L, 0L, nowUtc ?? DateTime.UtcNow)); public Task> GetExecutionTreeAsync( Guid executionId, CancellationToken ct = default) => @@ -272,8 +272,8 @@ public class SiteAuditReconciliationActorTests : TestKit, IClassFixture - new(new DbContextOptionsBuilder() + private ScadaBridgeDbContext CreateContext() => + new(new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString).Options); [SkippableFact] diff --git a/tests/ScadaLink.AuditLog.Tests/Central/SiteAuditTelemetryStalledTrackerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/SiteAuditTelemetryStalledTrackerTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Central/SiteAuditTelemetryStalledTrackerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/SiteAuditTelemetryStalledTrackerTests.cs index 7c375a11..8171e5d5 100644 --- a/tests/ScadaLink.AuditLog.Tests/Central/SiteAuditTelemetryStalledTrackerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Central/SiteAuditTelemetryStalledTrackerTests.cs @@ -1,8 +1,8 @@ using Akka.Actor; using Akka.TestKit.Xunit2; -using ScadaLink.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; -namespace ScadaLink.AuditLog.Tests.Central; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Central; /// /// Bundle E (M6-T7) tests for . @@ -10,7 +10,7 @@ namespace ScadaLink.AuditLog.Tests.Central; /// publications and maintains a /// per-site latch the central health surface can read. Since reconciliation is /// central-driven, the "stalled" state semantically belongs to central — not -/// to the per-site +/// to the per-site /// payload (which the site itself emits). The tracker therefore lives as a /// central singleton, not on the site health collector. /// diff --git a/tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsBindingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsBindingTests.cs similarity index 97% rename from tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsBindingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsBindingTests.cs index 8cc07a70..7bc29f15 100644 --- a/tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsBindingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsBindingTests.cs @@ -3,12 +3,12 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Configuration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Configuration; /// /// Bundle D (M5-T8) tests for hot-reloadable diff --git a/tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsTests.cs similarity index 98% rename from tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsTests.cs index 4e68e413..19c27774 100644 --- a/tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsTests.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; -namespace ScadaLink.AuditLog.Tests.Configuration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Configuration; /// /// Task 9 (Bundle E): binding + validator diff --git a/tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsValidatorTests.cs similarity index 94% rename from tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsValidatorTests.cs index 62537462..3defd29e 100644 --- a/tests/ScadaLink.AuditLog.Tests/Configuration/AuditLogOptionsValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Configuration/AuditLogOptionsValidatorTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; -namespace ScadaLink.AuditLog.Tests.Configuration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Configuration; /// /// Task 1 of docs/plans/2026-05-23-inbound-api-full-response-audit.md: diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/AuditWriteFailureSafetyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/AuditWriteFailureSafetyTests.cs similarity index 94% rename from tests/ScadaLink.AuditLog.Tests/Integration/AuditWriteFailureSafetyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/AuditWriteFailureSafetyTests.cs index 7f53300d..9e2846e9 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/AuditWriteFailureSafetyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/AuditWriteFailureSafetyTests.cs @@ -11,27 +11,27 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.InboundAPI.Middleware; -using ScadaLink.NotificationOutbox; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Net; using System.Security.Claims; using System.Text; using System.Text.Encodings.Web; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Audit Log #23 — M4 Bundle E (Task E4) cross-boundary safety suite verifying @@ -336,28 +336,28 @@ public class AuditWriteFailureSafetyTests : TestKit, IClassFixture() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning)) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private IServiceProvider BuildNotificationDispatcherProvider( INotificationDeliveryAdapter adapter) { var services = new ServiceCollection(); - services.AddDbContext(opts => + services.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning))); services.AddScoped(sp => - new NotificationOutboxRepository(sp.GetRequiredService())); + new NotificationOutboxRepository(sp.GetRequiredService())); services.AddScoped(sp => - new NotificationRepository(sp.GetRequiredService())); + new NotificationRepository(sp.GetRequiredService())); services.AddScoped(_ => adapter); return services.BuildServiceProvider(); } diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/CachedCallCombinedTelemetryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CachedCallCombinedTelemetryTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Integration/CachedCallCombinedTelemetryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CachedCallCombinedTelemetryTests.cs index 58e1ce0f..28d531a2 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/CachedCallCombinedTelemetryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CachedCallCombinedTelemetryTests.cs @@ -1,14 +1,14 @@ using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; -using ScadaLink.AuditLog.Tests.Integration.Infrastructure; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Bundle G G2 end-to-end suite for cached ExternalSystem.CachedCall @@ -26,7 +26,7 @@ namespace ScadaLink.AuditLog.Tests.Integration; /// The bridge is driven directly via /// — these tests do NOT spin up the actual S&F retry loop; that would /// require a full SiteRuntime host and is out of scope for M3 (the S&F -/// observer hooks are exercised in ScadaLink.StoreAndForward.Tests at +/// observer hooks are exercised in ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests at /// unit level). The submit row is emitted via /// because the /// production submit emission happens at the script-call site, not inside the diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/CachedWriteCombinedTelemetryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CachedWriteCombinedTelemetryTests.cs similarity index 93% rename from tests/ScadaLink.AuditLog.Tests/Integration/CachedWriteCombinedTelemetryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CachedWriteCombinedTelemetryTests.cs index 9288ca81..50dc3dc2 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/CachedWriteCombinedTelemetryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CachedWriteCombinedTelemetryTests.cs @@ -1,14 +1,14 @@ using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; -using ScadaLink.AuditLog.Tests.Integration.Infrastructure; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Bundle G G3 mirror of for @@ -24,7 +24,7 @@ namespace ScadaLink.AuditLog.Tests.Integration; /// As with G2, the bridge is driven directly via the harness — we do not /// stand up a real Database.CachedWrite caller. The site-side /// unit-level emission for the DB path is exercised in -/// ScadaLink.SiteRuntime.Tests; this suite verifies the end-to-end +/// ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests; this suite verifies the end-to-end /// combined-telemetry path produces the right central rows. /// public class CachedWriteCombinedTelemetryTests : TestKit, IClassFixture diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/CombinedTelemetryIdempotencyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CombinedTelemetryIdempotencyTests.cs similarity index 94% rename from tests/ScadaLink.AuditLog.Tests/Integration/CombinedTelemetryIdempotencyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CombinedTelemetryIdempotencyTests.cs index 63d85747..e85f335a 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/CombinedTelemetryIdempotencyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/CombinedTelemetryIdempotencyTests.cs @@ -1,15 +1,15 @@ using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; -using ScadaLink.AuditLog.Tests.Integration.Infrastructure; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; using Timestamp = Google.Protobuf.WellKnownTypes.Timestamp; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Bundle G G4 idempotency suite. Telemetry packets MUST round-trip safely diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/DatabaseSyncEmissionEndToEndTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/DatabaseSyncEmissionEndToEndTests.cs similarity index 92% rename from tests/ScadaLink.AuditLog.Tests/Integration/DatabaseSyncEmissionEndToEndTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/DatabaseSyncEmissionEndToEndTests.cs index 4269da3d..998e4e20 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/DatabaseSyncEmissionEndToEndTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/DatabaseSyncEmissionEndToEndTests.cs @@ -5,22 +5,22 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.AuditLog.Tests.Integration.Infrastructure; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Audit Log #23 — M4 Bundle E (Task E1) end-to-end suite verifying every @@ -69,12 +69,12 @@ public class DatabaseSyncEmissionEndToEndTests : TestKit, IClassFixture "test-e1-db-" + Guid.NewGuid().ToString("N").Substring(0, 8); - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } /// diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/ExecutionIdCorrelationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/ExecutionIdCorrelationTests.cs similarity index 91% rename from tests/ScadaLink.AuditLog.Tests/Integration/ExecutionIdCorrelationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/ExecutionIdCorrelationTests.cs index e9903856..68b0482d 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/ExecutionIdCorrelationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/ExecutionIdCorrelationTests.cs @@ -5,21 +5,21 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.AuditLog.Tests.Integration.Infrastructure; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Audit Log #23 — ExecutionId end-to-end correlation suite verifying the @@ -29,7 +29,7 @@ namespace ScadaLink.AuditLog.Tests.Integration; /// /// /// This is the integration-level counterpart to the unit-level -/// ExecutionCorrelationContextTests in ScadaLink.SiteRuntime.Tests: +/// ExecutionCorrelationContextTests in ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests: /// where that test asserts the shared id on the in-memory captured rows, this /// suite drives the rows all the way through the production pipeline — the real /// site hot-path, the real @@ -69,12 +69,12 @@ public class ExecutionIdCorrelationTests : TestKit, IClassFixture "test-execid-" + Guid.NewGuid().ToString("N").Substring(0, 8); - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } /// diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/InboundApiAuditTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/InboundApiAuditTests.cs similarity index 93% rename from tests/ScadaLink.AuditLog.Tests/Integration/InboundApiAuditTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/InboundApiAuditTests.cs index a881e561..8601f26e 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/InboundApiAuditTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/InboundApiAuditTests.cs @@ -7,21 +7,21 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; using System.Security.Claims; using System.Text; using System.Text.Encodings.Web; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Audit Log #23 — M4 Bundle E (Task E3) end-to-end audit trail for the @@ -66,14 +66,14 @@ public class InboundApiAuditTests : IClassFixture private static string NewMethodName(string prefix) => prefix + "-" + Guid.NewGuid().ToString("N").Substring(0, 8); - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning)) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } /// @@ -96,12 +96,12 @@ public class InboundApiAuditTests : IClassFixture // singleton — same pattern the production Host uses — // opening a fresh scope per call to resolve the scoped // repository. - services.AddDbContext(opts => + services.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning))); services.AddScoped(sp => - new AuditLogRepository(sp.GetRequiredService())); + new AuditLogRepository(sp.GetRequiredService())); services.AddSingleton(sp => new CentralAuditWriter(sp, NullLogger.Instance)); diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryDispatcher.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryDispatcher.cs similarity index 93% rename from tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryDispatcher.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryDispatcher.cs index a18a2fcc..37e1a3e1 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryDispatcher.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryDispatcher.cs @@ -1,12 +1,12 @@ -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; using Google.Protobuf.WellKnownTypes; using Timestamp = Google.Protobuf.WellKnownTypes.Timestamp; -namespace ScadaLink.AuditLog.Tests.Integration.Infrastructure; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; /// /// Test-side combined-telemetry dispatcher: wraps a production diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryHarness.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryHarness.cs similarity index 84% rename from tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryHarness.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryHarness.cs index c5517586..3c83dd97 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryHarness.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/CombinedTelemetryHarness.cs @@ -3,20 +3,20 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Interfaces; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.SiteRuntime.Tracking; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Tracking; -namespace ScadaLink.AuditLog.Tests.Integration.Infrastructure; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; /// /// Shared end-to-end harness for the M3 cached-call combined telemetry tests @@ -63,7 +63,7 @@ public sealed class CombinedTelemetryHarness : IAsyncDisposable public CombinedTelemetryHarness( MsSqlMigrationFixture fixture, Akka.TestKit.Xunit2.TestKit testKit, - Func? siteCallRepoOverride = null) + Func? siteCallRepoOverride = null) { _fixture = fixture ?? throw new ArgumentNullException(nameof(fixture)); ArgumentNullException.ThrowIfNull(testKit); @@ -128,33 +128,33 @@ public sealed class CombinedTelemetryHarness : IAsyncDisposable public Task EmitAttemptAsync(CachedCallAttemptContext context, CancellationToken ct = default) => Bridge.OnAttemptCompletedAsync(context, ct); - public ScadaLinkDbContext CreateReadContext() + public ScadaBridgeDbContext CreateReadContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private IServiceProvider BuildCentralServiceProvider( - Func? siteCallRepoOverride) + Func? siteCallRepoOverride) { var services = new ServiceCollection(); - services.AddDbContext(opts => + services.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning))); services.AddScoped(sp => - new AuditLogRepository(sp.GetRequiredService())); + new AuditLogRepository(sp.GetRequiredService())); if (siteCallRepoOverride is null) { services.AddScoped(sp => - new SiteCallAuditRepository(sp.GetRequiredService())); + new SiteCallAuditRepository(sp.GetRequiredService())); } else { services.AddScoped(sp => - siteCallRepoOverride(sp.GetRequiredService())); + siteCallRepoOverride(sp.GetRequiredService())); } return services.BuildServiceProvider(); } diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/DirectActorSiteStreamAuditClient.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/DirectActorSiteStreamAuditClient.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/DirectActorSiteStreamAuditClient.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/DirectActorSiteStreamAuditClient.cs index 9fa14827..e2c9e2e8 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/Infrastructure/DirectActorSiteStreamAuditClient.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/Infrastructure/DirectActorSiteStreamAuditClient.cs @@ -1,10 +1,10 @@ using Akka.Actor; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.AuditLog.Tests.Integration.Infrastructure; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; /// /// Shared component-level test double that diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/NotifyDispatcherAuditTrailTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/NotifyDispatcherAuditTrailTests.cs similarity index 92% rename from tests/ScadaLink.AuditLog.Tests/Integration/NotifyDispatcherAuditTrailTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/NotifyDispatcherAuditTrailTests.cs index f1c10962..4177efc9 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/NotifyDispatcherAuditTrailTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/NotifyDispatcherAuditTrailTests.cs @@ -3,21 +3,21 @@ using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.NotificationOutbox; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Audit Log #23 — M4 Bundle E (Task E2): end-to-end audit trail produced by @@ -59,14 +59,14 @@ public class NotifyDispatcherAuditTrailTests : TestKit, IClassFixture "test-e2-notify-" + Guid.NewGuid().ToString("N").Substring(0, 8); - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning)) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } /// @@ -80,16 +80,16 @@ public class NotifyDispatcherAuditTrailTests : TestKit, IClassFixture(opts => + services.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning))); services.AddScoped(sp => - new NotificationOutboxRepository(sp.GetRequiredService())); + new NotificationOutboxRepository(sp.GetRequiredService())); services.AddScoped(sp => - new NotificationRepository(sp.GetRequiredService())); + new NotificationRepository(sp.GetRequiredService())); services.AddScoped(sp => - new AuditLogRepository(sp.GetRequiredService())); + new AuditLogRepository(sp.GetRequiredService())); services.AddScoped(_ => adapter); return services.BuildServiceProvider(); } diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/OutageReconciliationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/OutageReconciliationTests.cs similarity index 94% rename from tests/ScadaLink.AuditLog.Tests/Integration/OutageReconciliationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/OutageReconciliationTests.cs index 69000bf9..5037e382 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/OutageReconciliationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/OutageReconciliationTests.cs @@ -4,19 +4,19 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Bundle F (#23 M6-T10) end-to-end test for the central-outage + reconciliation @@ -125,8 +125,8 @@ public class OutageReconciliationTests : TestKit, IClassFixture - new(new DbContextOptionsBuilder() + private ScadaBridgeDbContext CreateContext() => + new(new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString).Options); private static AuditEvent NewEvent(string siteId, DateTime occurredAt) => new() @@ -156,10 +156,10 @@ public class OutageReconciliationTests : TestKit, IClassFixture(opts => + services.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString)); services.AddScoped(sp => - new AuditLogRepository(sp.GetRequiredService())); + new AuditLogRepository(sp.GetRequiredService())); var sp = services.BuildServiceProvider(); var ingest = Sys.ActorOf(Props.Create(() => new AuditLogIngestActor( diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/ParentExecutionIdCorrelationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/ParentExecutionIdCorrelationTests.cs similarity index 94% rename from tests/ScadaLink.AuditLog.Tests/Integration/ParentExecutionIdCorrelationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/ParentExecutionIdCorrelationTests.cs index 6bbdf3ed..8a805f1c 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/ParentExecutionIdCorrelationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/ParentExecutionIdCorrelationTests.cs @@ -12,30 +12,30 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.AuditLog.Tests.Integration.Infrastructure; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.InboundApi; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; -using ScadaLink.InboundAPI; -using ScadaLink.InboundAPI.Middleware; -using ScadaLink.NotificationOutbox; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.InboundAPI; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Audit Log #23 — ParentExecutionId cross-execution correlation headline @@ -114,14 +114,14 @@ public class ParentExecutionIdCorrelationTests : TestKit, IClassFixture "test-parentexec-" + Guid.NewGuid().ToString("N").Substring(0, 8); - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning)) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } [SkippableFact] @@ -133,18 +133,18 @@ public class ParentExecutionIdCorrelationTests : TestKit, IClassFixture(opts => + centralServices.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning))); centralServices.AddScoped(sp => - new AuditLogRepository(sp.GetRequiredService())); + new AuditLogRepository(sp.GetRequiredService())); centralServices.AddScoped(sp => - new SiteCallAuditRepository(sp.GetRequiredService())); + new SiteCallAuditRepository(sp.GetRequiredService())); centralServices.AddScoped(sp => - new NotificationOutboxRepository(sp.GetRequiredService())); + new NotificationOutboxRepository(sp.GetRequiredService())); centralServices.AddScoped(sp => - new NotificationRepository(sp.GetRequiredService())); + new NotificationRepository(sp.GetRequiredService())); // The NotifyDeliver dispatch path runs through this same long-lived // provider — a stub adapter that always reports a successful delivery. centralServices.AddScoped(_ => new AlwaysDeliversAdapter()); @@ -224,7 +224,7 @@ public class ParentExecutionIdCorrelationTests : TestKit, IClassFixture?>(), Arg.Any(), Arg.Any(), - Arg.Any(), + Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) .Returns(new ExternalCallResult(true, "{\"ok\":true}", null, WasBuffered: false)); @@ -242,7 +242,7 @@ public class ParentExecutionIdCorrelationTests : TestKit, IClassFixture(); @@ -525,7 +525,7 @@ public class ParentExecutionIdCorrelationTests : TestKit, IClassFixture NotificationType.Email; public Task DeliverAsync( - ScadaLink.Commons.Entities.Notifications.Notification notification, + ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications.Notification notification, CancellationToken cancellationToken = default) => Task.FromResult(DeliveryOutcome.Success("ops@example.com")); } diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/PartitionMaintenanceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/PartitionMaintenanceTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Integration/PartitionMaintenanceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/PartitionMaintenanceTests.cs index bd1a81ca..279e4502 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/PartitionMaintenanceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/PartitionMaintenanceTests.cs @@ -2,13 +2,13 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.Commons.Interfaces; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Maintenance; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Maintenance; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Bundle F (#23 M6-T12) end-to-end tests for the @@ -24,7 +24,7 @@ namespace ScadaLink.AuditLog.Tests.Integration; /// test persist across the next. Each test reads the max boundary at the /// start and computes its lookahead relative to it, mirroring the pattern /// used by the per-component AuditLogPartitionMaintenanceTests in -/// ScadaLink.ConfigurationDatabase.Tests. +/// ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests. /// public class PartitionMaintenanceTests : IClassFixture { @@ -35,8 +35,8 @@ public class PartitionMaintenanceTests : IClassFixture _fixture = fixture; } - private ScadaLinkDbContext CreateContext() => - new(new DbContextOptionsBuilder() + private ScadaBridgeDbContext CreateContext() => + new(new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString).Options); /// @@ -47,7 +47,7 @@ public class PartitionMaintenanceTests : IClassFixture private ServiceProvider BuildProvider() { var services = new ServiceCollection(); - services.AddDbContext( + services.AddDbContext( opts => opts.UseSqlServer(_fixture.ConnectionString), ServiceLifetime.Scoped); services.AddScoped(); diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/PartitionPurgeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/PartitionPurgeTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Integration/PartitionPurgeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/PartitionPurgeTests.cs index 69db1b1c..eed7f876 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/PartitionPurgeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/PartitionPurgeTests.cs @@ -5,16 +5,16 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Bundle F (#23 M6-T11) end-to-end test for the daily partition-switch @@ -50,8 +50,8 @@ public class PartitionPurgeTests : TestKit, IClassFixture _fixture = fixture; } - private ScadaLinkDbContext CreateContext() => - new(new DbContextOptionsBuilder() + private ScadaBridgeDbContext CreateContext() => + new(new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString).Options); /// @@ -165,7 +165,7 @@ WHERE name = 'UX_AuditLog_EventId' // Wire the actor with a real EF context against the fixture DB. var services = new ServiceCollection(); - services.AddDbContext( + services.AddDbContext( opts => opts.UseSqlServer(_fixture.ConnectionString), ServiceLifetime.Scoped); services.AddScoped(); @@ -238,7 +238,7 @@ WHERE name = 'UX_AuditLog_EventId' } var services = new ServiceCollection(); - services.AddDbContext( + services.AddDbContext( opts => opts.UseSqlServer(_fixture.ConnectionString), ServiceLifetime.Scoped); services.AddScoped(); @@ -291,7 +291,7 @@ WHERE name = 'UX_AuditLog_EventId' } var services = new ServiceCollection(); - services.AddDbContext( + services.AddDbContext( opts => opts.UseSqlServer(_fixture.ConnectionString), ServiceLifetime.Scoped); services.AddScoped(); diff --git a/tests/ScadaLink.AuditLog.Tests/Integration/SyncCallEmissionEndToEndTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/SyncCallEmissionEndToEndTests.cs similarity index 91% rename from tests/ScadaLink.AuditLog.Tests/Integration/SyncCallEmissionEndToEndTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/SyncCallEmissionEndToEndTests.cs index d89e0341..2d113f02 100644 --- a/tests/ScadaLink.AuditLog.Tests/Integration/SyncCallEmissionEndToEndTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Integration/SyncCallEmissionEndToEndTests.cs @@ -3,21 +3,21 @@ using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.AuditLog.Tests.Integration.Infrastructure; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration.Infrastructure; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Integration; /// /// Bundle H — end-to-end test wiring the full Audit Log #23 M2 sync-call pipeline: @@ -59,12 +59,12 @@ public class SyncCallEmissionEndToEndTests : TestKit, IClassFixture "test-bundle-h-" + Guid.NewGuid().ToString("N").Substring(0, 8); - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static AuditEvent NewEvent(string siteId, Guid? id = null) => new() diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/BodyRegexRedactionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/BodyRegexRedactionTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Payload/BodyRegexRedactionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/BodyRegexRedactionTests.cs index 85393d16..4c6b013a 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/BodyRegexRedactionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/BodyRegexRedactionTests.cs @@ -1,12 +1,12 @@ using System.Text; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Bundle B (M5-T4) tests for body regex redaction in diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/FilterIntegrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/FilterIntegrationTests.cs similarity index 91% rename from tests/ScadaLink.AuditLog.Tests/Payload/FilterIntegrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/FilterIntegrationTests.cs index d0c29f09..853a1665 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/FilterIntegrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/FilterIntegrationTests.cs @@ -7,22 +7,22 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.AuditLog.Central; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.AuditLog.Central; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Bundle C (M5-T6) integration tests verifying that the @@ -162,12 +162,12 @@ public class FilterIntegrationTests _fixture = fixture; } - private ScadaLinkDbContext CreateReadContext() + private ScadaBridgeDbContext CreateReadContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static string NewSiteId() => @@ -182,14 +182,14 @@ public class FilterIntegrationTests private IServiceProvider BuildServiceProvider() { var services = new ServiceCollection(); - services.AddDbContext(opts => + services.AddDbContext(opts => opts.UseSqlServer(_fixture.ConnectionString) .ConfigureWarnings(w => w.Ignore( Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning))); services.AddScoped(sp => - new AuditLogRepository(sp.GetRequiredService())); + new AuditLogRepository(sp.GetRequiredService())); services.AddScoped(sp => - new SiteCallAuditRepository(sp.GetRequiredService())); + new SiteCallAuditRepository(sp.GetRequiredService())); services.AddSingleton(NewDefaultFilter()); return services.BuildServiceProvider(); } diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/HeaderRedactionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/HeaderRedactionTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Payload/HeaderRedactionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/HeaderRedactionTests.cs index 01784f63..6bf83335 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/HeaderRedactionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/HeaderRedactionTests.cs @@ -2,12 +2,12 @@ using System.Text; using System.Text.Json; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Bundle B (M5-T3) tests for HTTP header diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/InboundChannelCapTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/InboundChannelCapTests.cs similarity index 95% rename from tests/ScadaLink.AuditLog.Tests/Payload/InboundChannelCapTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/InboundChannelCapTests.cs index 42f5cf8c..f10308c9 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/InboundChannelCapTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/InboundChannelCapTests.cs @@ -1,12 +1,12 @@ using System.Text; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Pins the docs/plans/2026-05-23-inbound-api-full-response-audit-design.md diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/PayloadFilterContractTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/PayloadFilterContractTests.cs similarity index 88% rename from tests/ScadaLink.AuditLog.Tests/Payload/PayloadFilterContractTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/PayloadFilterContractTests.cs index 6848b298..22368d99 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/PayloadFilterContractTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/PayloadFilterContractTests.cs @@ -1,9 +1,9 @@ using System.Linq; using System.Reflection; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Bundle A (M5-T1) contract test for . The @@ -21,7 +21,7 @@ public class PayloadFilterContractTests var type = typeof(IAuditPayloadFilter); Assert.True(type.IsInterface, "IAuditPayloadFilter must be an interface"); - Assert.Equal("ScadaLink.AuditLog.Payload", type.Namespace); + Assert.Equal("ZB.MOM.WW.ScadaBridge.AuditLog.Payload", type.Namespace); } [Fact] diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/RedactionSafetyNetTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/RedactionSafetyNetTests.cs similarity index 97% rename from tests/ScadaLink.AuditLog.Tests/Payload/RedactionSafetyNetTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/RedactionSafetyNetTests.cs index 9ebddb04..515efdf7 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/RedactionSafetyNetTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/RedactionSafetyNetTests.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Bundle D (M5-T10) safety-net edge cases for @@ -219,7 +219,7 @@ public class RedactionSafetyNetTests /// /// IOptionsMonitor test double that supports a live — /// mirrors the helper used in - /// ; + /// ; /// kept private here so the safety-net test file remains self-contained. /// private sealed class MutableMonitor : IOptionsMonitor diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/SqlParamRedactionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/SqlParamRedactionTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Payload/SqlParamRedactionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/SqlParamRedactionTests.cs index 0676ab82..17d12bbb 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/SqlParamRedactionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/SqlParamRedactionTests.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Bundle B (M5-T5) tests for SQL parameter redaction in diff --git a/tests/ScadaLink.AuditLog.Tests/Payload/TruncationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/TruncationTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Payload/TruncationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/TruncationTests.cs index d747336a..dc75c917 100644 --- a/tests/ScadaLink.AuditLog.Tests/Payload/TruncationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/TruncationTests.cs @@ -2,12 +2,12 @@ using System.Linq; using System.Text; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Payload; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Payload; /// /// Bundle A (M5-T2) tests for truncation. diff --git a/tests/ScadaLink.AuditLog.Tests/Site/FallbackAuditWriterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/FallbackAuditWriterTests.cs similarity index 94% rename from tests/ScadaLink.AuditLog.Tests/Site/FallbackAuditWriterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/FallbackAuditWriterTests.cs index bb39c241..48119085 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/FallbackAuditWriterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/FallbackAuditWriterTests.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.AuditLog.Site; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Site; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site; /// /// Bundle B (M2-T4) tests for — composes the diff --git a/tests/ScadaLink.AuditLog.Tests/Site/HealthMetricsAuditRedactionFailureCounterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/HealthMetricsAuditRedactionFailureCounterTests.cs similarity index 86% rename from tests/ScadaLink.AuditLog.Tests/Site/HealthMetricsAuditRedactionFailureCounterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/HealthMetricsAuditRedactionFailureCounterTests.cs index ffc09f3a..64785689 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/HealthMetricsAuditRedactionFailureCounterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/HealthMetricsAuditRedactionFailureCounterTests.cs @@ -1,13 +1,13 @@ using NSubstitute; -using ScadaLink.AuditLog.Site; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.AuditLog.Tests.Site; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site; /// /// Bundle C (M5-T7) — the /// adapter is the production binding for -/// on +/// on /// site nodes; it forwards every /// redactor over-redaction event into the shared /// so the site health report surfaces the diff --git a/tests/ScadaLink.AuditLog.Tests/Site/HealthMetricsAuditWriteFailureCounterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/HealthMetricsAuditWriteFailureCounterTests.cs similarity index 91% rename from tests/ScadaLink.AuditLog.Tests/Site/HealthMetricsAuditWriteFailureCounterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/HealthMetricsAuditWriteFailureCounterTests.cs index cb8d9d2a..57738105 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/HealthMetricsAuditWriteFailureCounterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/HealthMetricsAuditWriteFailureCounterTests.cs @@ -1,8 +1,8 @@ using NSubstitute; -using ScadaLink.AuditLog.Site; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.AuditLog.Tests.Site; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site; /// /// Bundle G (M2-T11) — the diff --git a/tests/ScadaLink.AuditLog.Tests/Site/RingBufferFallbackTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/RingBufferFallbackTests.cs similarity index 92% rename from tests/ScadaLink.AuditLog.Tests/Site/RingBufferFallbackTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/RingBufferFallbackTests.cs index 8f928024..dbb175ab 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/RingBufferFallbackTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/RingBufferFallbackTests.cs @@ -1,8 +1,8 @@ -using ScadaLink.AuditLog.Site; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Site; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site; /// /// Bundle B (M2-T3) tests for — the diff --git a/tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterBacklogStatsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterBacklogStatsTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterBacklogStatsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterBacklogStatsTests.cs index 1de7734c..d9b81cda 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterBacklogStatsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterBacklogStatsTests.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Site; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site; /// /// Bundle E (M6-T6) tests for . diff --git a/tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterSchemaTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterSchemaTests.cs similarity index 98% rename from tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterSchemaTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterSchemaTests.cs index b8a4872d..f6bb6e08 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterSchemaTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterSchemaTests.cs @@ -1,12 +1,12 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Site; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site; /// /// Bundle B (M2-T1) schema-bootstrap tests for . diff --git a/tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterWriteTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterWriteTests.cs similarity index 98% rename from tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterWriteTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterWriteTests.cs index 38324f89..c7a671fc 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/SqliteAuditWriterWriteTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/SqliteAuditWriterWriteTests.cs @@ -1,13 +1,13 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Tests.TestSupport; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Site; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site; /// /// Bundle B (M2-T2) hot-path tests for . Exercise diff --git a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/CachedCallLifecycleBridgeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/CachedCallLifecycleBridgeTests.cs similarity index 98% rename from tests/ScadaLink.AuditLog.Tests/Site/Telemetry/CachedCallLifecycleBridgeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/CachedCallLifecycleBridgeTests.cs index bfde0ebe..e73e82c5 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/CachedCallLifecycleBridgeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/CachedCallLifecycleBridgeTests.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Site.Telemetry; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site.Telemetry; /// /// Bundle E Tasks E4/E5 bridge tests. The bridge ingests diff --git a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/CachedCallTelemetryForwarderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/CachedCallTelemetryForwarderTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Site/Telemetry/CachedCallTelemetryForwarderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/CachedCallTelemetryForwarderTests.cs index e5de6d5e..ebb51aa0 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/CachedCallTelemetryForwarderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/CachedCallTelemetryForwarderTests.cs @@ -1,15 +1,15 @@ using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.AuditLog.Tests.Site.Telemetry; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site.Telemetry; /// /// Bundle E E2 tests for . The diff --git a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/ClusterClientSiteAuditClientTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/ClusterClientSiteAuditClientTests.cs similarity index 96% rename from tests/ScadaLink.AuditLog.Tests/Site/Telemetry/ClusterClientSiteAuditClientTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/ClusterClientSiteAuditClientTests.cs index b1005d3e..3c503e08 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/ClusterClientSiteAuditClientTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/ClusterClientSiteAuditClientTests.cs @@ -1,13 +1,13 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Google.Protobuf.WellKnownTypes; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.AuditLog.Tests.Site.Telemetry; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site.Telemetry; /// /// Tests for — the production diff --git a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/NoOpSiteStreamAuditClientTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/NoOpSiteStreamAuditClientTests.cs similarity index 91% rename from tests/ScadaLink.AuditLog.Tests/Site/Telemetry/NoOpSiteStreamAuditClientTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/NoOpSiteStreamAuditClientTests.cs index b673bbbb..4b73f8a2 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/NoOpSiteStreamAuditClientTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/NoOpSiteStreamAuditClientTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.AuditLog.Tests.Site.Telemetry; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site.Telemetry; /// /// Bundle E E1 tests for . The NoOp diff --git a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs similarity index 97% rename from tests/ScadaLink.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs index a7e48564..6900d201 100644 --- a/tests/ScadaLink.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Site/Telemetry/SiteAuditTelemetryActorTests.cs @@ -5,15 +5,15 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.AuditLog.Tests.Site.Telemetry; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.Site.Telemetry; /// /// Bundle D D1 tests for . The actor drains diff --git a/tests/ScadaLink.AuditLog.Tests/TestSupport/FakeNodeIdentityProvider.cs b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/TestSupport/FakeNodeIdentityProvider.cs similarity index 62% rename from tests/ScadaLink.AuditLog.Tests/TestSupport/FakeNodeIdentityProvider.cs rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/TestSupport/FakeNodeIdentityProvider.cs index 969802bd..116ca949 100644 --- a/tests/ScadaLink.AuditLog.Tests/TestSupport/FakeNodeIdentityProvider.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/TestSupport/FakeNodeIdentityProvider.cs @@ -1,13 +1,13 @@ -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.AuditLog.Tests.TestSupport; +namespace ZB.MOM.WW.ScadaBridge.AuditLog.Tests.TestSupport; /// /// Test fake for . Returns the configured /// verbatim — including null — so tests can /// exercise both the "stamped" and "unconfigured" branches of the SourceNode -/// stamping logic in -/// and . +/// stamping logic in +/// and . /// internal sealed class FakeNodeIdentityProvider : INodeIdentityProvider { diff --git a/tests/ScadaLink.AuditLog.Tests/ScadaLink.AuditLog.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests.csproj similarity index 79% rename from tests/ScadaLink.AuditLog.Tests/ScadaLink.AuditLog.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests.csproj index b85f00a7..817bc0d1 100644 --- a/tests/ScadaLink.AuditLog.Tests/ScadaLink.AuditLog.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests.csproj @@ -13,7 +13,7 @@ @@ -44,35 +44,35 @@ - + - + - + - + - + diff --git a/tests/ScadaLink.CLI.Tests/CliConfigTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CliConfigTests.cs similarity index 92% rename from tests/ScadaLink.CLI.Tests/CliConfigTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CliConfigTests.cs index 55d96810..4c952abf 100644 --- a/tests/ScadaLink.CLI.Tests/CliConfigTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CliConfigTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CLI; +using ZB.MOM.WW.ScadaBridge.CLI; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; [Collection("Environment")] public class CliConfigTests @@ -65,7 +65,7 @@ public class CliConfigTests } /// - /// CLI-021 regression: a malformed ~/.scadalink/config.json must NOT abort the + /// CLI-021 regression: a malformed ~/.scadabridge/config.json must NOT abort the /// CLI before any command runs — Load() must warn (to stderr) and return a /// usable default config so command-line overrides (--url, --username, etc.) /// and env vars can still take effect. @@ -73,10 +73,10 @@ public class CliConfigTests [Fact] public void Load_MalformedConfigFile_DoesNotThrow_WarnsAndReturnsDefault() { - var tempHome = Path.Combine(Path.GetTempPath(), "scadalink-cli-test-" + Guid.NewGuid().ToString("N")); - Directory.CreateDirectory(Path.Combine(tempHome, ".scadalink")); + var tempHome = Path.Combine(Path.GetTempPath(), "scadabridge-cli-test-" + Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(Path.Combine(tempHome, ".scadabridge")); File.WriteAllText( - Path.Combine(tempHome, ".scadalink", "config.json"), + Path.Combine(tempHome, ".scadabridge", "config.json"), "{ this is not valid json :: "); var origHome = Environment.GetEnvironmentVariable("HOME"); diff --git a/tests/ScadaLink.CLI.Tests/CommandHelpersTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CommandHelpersTests.cs similarity index 97% rename from tests/ScadaLink.CLI.Tests/CommandHelpersTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CommandHelpersTests.cs index 7df83812..2d08f0c9 100644 --- a/tests/ScadaLink.CLI.Tests/CommandHelpersTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CommandHelpersTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.CLI; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; [Collection("Console")] public class CommandHelpersTests diff --git a/tests/ScadaLink.CLI.Tests/CommandTreeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CommandTreeTests.cs similarity index 96% rename from tests/ScadaLink.CLI.Tests/CommandTreeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CommandTreeTests.cs index 36ca65c8..c3a63b71 100644 --- a/tests/ScadaLink.CLI.Tests/CommandTreeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CommandTreeTests.cs @@ -1,8 +1,8 @@ using System.CommandLine; -using ScadaLink.CLI.Commands; -using ScadaLink.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-013 — the command-tree wiring was untested. These tests @@ -19,7 +19,7 @@ public class CommandTreeTests private static readonly Option Format = CliOptions.CreateFormatOption(); // NOTE: this list MUST stay in sync with the rootCommand.Add(...) calls in - // src/ScadaLink.CLI/Program.cs. When a new command group is added (or one is + // src/ZB.MOM.WW.ScadaBridge.CLI/Program.cs. When a new command group is added (or one is // removed/renamed), update this array and bump the count assertion in // AllCommandGroups_Build_WithoutThrowing accordingly. private static IEnumerable AllCommandGroups() => new[] diff --git a/tests/ScadaLink.CLI.Tests/Commands/AuditCommandTestHarness.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditCommandTestHarness.cs similarity index 95% rename from tests/ScadaLink.CLI.Tests/Commands/AuditCommandTestHarness.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditCommandTestHarness.cs index 4050ea72..1cae60bd 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/AuditCommandTestHarness.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditCommandTestHarness.cs @@ -1,7 +1,7 @@ using System.CommandLine; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// /// Shared helpers for invoking the audit command tree in tests and capturing diff --git a/tests/ScadaLink.CLI.Tests/Commands/AuditCommandsScaffoldTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditCommandsScaffoldTests.cs similarity index 91% rename from tests/ScadaLink.CLI.Tests/Commands/AuditCommandsScaffoldTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditCommandsScaffoldTests.cs index e75c552b..95e5e033 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/AuditCommandsScaffoldTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditCommandsScaffoldTests.cs @@ -1,10 +1,10 @@ using System.CommandLine; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// -/// Scaffold tests for the scadalink audit command group (Audit Log #23 M8-T1). +/// Scaffold tests for the scadabridge audit command group (Audit Log #23 M8-T1). /// Verifies the parent command exists with its three subcommands and that every leaf /// has an action wired. /// diff --git a/tests/ScadaLink.CLI.Tests/Commands/AuditConfigDeprecationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditConfigDeprecationTests.cs similarity index 97% rename from tests/ScadaLink.CLI.Tests/Commands/AuditConfigDeprecationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditConfigDeprecationTests.cs index 3cc4d200..0c349e18 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/AuditConfigDeprecationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditConfigDeprecationTests.cs @@ -1,7 +1,7 @@ using System.CommandLine; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// /// Tests for the audit-logaudit-config rename (Audit Log #23 M8-T7): diff --git a/tests/ScadaLink.CLI.Tests/Commands/AuditExportCommandTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditExportCommandTests.cs similarity index 98% rename from tests/ScadaLink.CLI.Tests/Commands/AuditExportCommandTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditExportCommandTests.cs index 491013ba..e6851d6d 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/AuditExportCommandTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditExportCommandTests.cs @@ -1,13 +1,13 @@ using System.Net; using System.Text; using System.Web; -using ScadaLink.CLI; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// -/// Tests for the scadalink audit export subcommand (Audit Log #23 M8-T3): +/// Tests for the scadabridge audit export subcommand (Audit Log #23 M8-T3): /// required-flag enforcement, query-string construction, streaming the response body /// to the output file, and the parquet-not-implemented (501) path. /// diff --git a/tests/ScadaLink.CLI.Tests/Commands/AuditQueryCommandTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditQueryCommandTests.cs similarity index 98% rename from tests/ScadaLink.CLI.Tests/Commands/AuditQueryCommandTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditQueryCommandTests.cs index 553c30fb..f27dfa74 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/AuditQueryCommandTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditQueryCommandTests.cs @@ -2,13 +2,13 @@ using System.Collections.Specialized; using System.Net; using System.Text; using System.Web; -using ScadaLink.CLI; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// -/// Tests for the scadalink audit query subcommand (Audit Log #23 M8-T2): +/// Tests for the scadabridge audit query subcommand (Audit Log #23 M8-T2): /// time-spec resolution, query-string construction, formatter selection, error /// handling, and keyset-cursor paging via --all. /// diff --git a/tests/ScadaLink.CLI.Tests/Commands/AuditTableFormatterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditTableFormatterTests.cs similarity index 95% rename from tests/ScadaLink.CLI.Tests/Commands/AuditTableFormatterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditTableFormatterTests.cs index c22da8b9..9578b2b2 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/AuditTableFormatterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditTableFormatterTests.cs @@ -1,10 +1,10 @@ using System.Text.Json; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// -/// Tests for the table output formatter of the scadalink audit query +/// Tests for the table output formatter of the scadabridge audit query /// subcommand (Audit Log #23 M8-T6): header rendering, long-field truncation, the /// empty-result-set case, and null-actor handling. /// diff --git a/tests/ScadaLink.CLI.Tests/Commands/AuditVerifyChainCommandTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditVerifyChainCommandTests.cs similarity index 90% rename from tests/ScadaLink.CLI.Tests/Commands/AuditVerifyChainCommandTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditVerifyChainCommandTests.cs index c399b929..b8e0797e 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/AuditVerifyChainCommandTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/AuditVerifyChainCommandTests.cs @@ -1,9 +1,9 @@ -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// -/// Tests for the scadalink audit verify-chain subcommand (Audit Log #23 M8-T4). +/// Tests for the scadabridge audit verify-chain subcommand (Audit Log #23 M8-T4). /// v1 is a no-op stub: a valid --month prints the documented "not enabled" /// message and exits 0; a malformed month or a missing --month exits non-zero. /// diff --git a/tests/ScadaLink.CLI.Tests/Commands/BundleCommandsStreamingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/BundleCommandsStreamingTests.cs similarity index 97% rename from tests/ScadaLink.CLI.Tests/Commands/BundleCommandsStreamingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/BundleCommandsStreamingTests.cs index 29a4f0be..7f10efc6 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/BundleCommandsStreamingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/BundleCommandsStreamingTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// /// CLI-019 regression tests for . diff --git a/tests/ScadaLink.CLI.Tests/Commands/SmtpUpdateCommandTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/SmtpUpdateCommandTests.cs similarity index 94% rename from tests/ScadaLink.CLI.Tests/Commands/SmtpUpdateCommandTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/SmtpUpdateCommandTests.cs index d644a532..f55e4e5e 100644 --- a/tests/ScadaLink.CLI.Tests/Commands/SmtpUpdateCommandTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/Commands/SmtpUpdateCommandTests.cs @@ -1,11 +1,11 @@ using System.CommandLine; -using ScadaLink.CLI.Commands; -using ScadaLink.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; -namespace ScadaLink.CLI.Tests.Commands; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests.Commands; /// -/// Tests for the scadalink notification smtp update subcommand. The command +/// Tests for the scadabridge notification smtp update subcommand. The command /// gained two optional flags — --tls-mode and --credentials — that plumb /// through to . These tests pin that the flags /// parse, are genuinely optional (non-breaking), and that --tls-mode rejects diff --git a/tests/ScadaLink.CLI.Tests/CredentialResolutionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CredentialResolutionTests.cs similarity index 96% rename from tests/ScadaLink.CLI.Tests/CredentialResolutionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CredentialResolutionTests.cs index 2249b970..9a4b9cee 100644 --- a/tests/ScadaLink.CLI.Tests/CredentialResolutionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/CredentialResolutionTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CLI; +using ZB.MOM.WW.ScadaBridge.CLI; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-006 — credentials could only be supplied via the diff --git a/tests/ScadaLink.CLI.Tests/DebugStreamTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/DebugStreamTests.cs similarity index 97% rename from tests/ScadaLink.CLI.Tests/DebugStreamTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/DebugStreamTests.cs index ebd36ee4..f9d0e207 100644 --- a/tests/ScadaLink.CLI.Tests/DebugStreamTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/DebugStreamTests.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for the testable pieces of DebugCommands.StreamDebugAsync: diff --git a/tests/ScadaLink.CLI.Tests/ExitCodeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ExitCodeTests.cs similarity index 94% rename from tests/ScadaLink.CLI.Tests/ExitCodeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ExitCodeTests.cs index b3aadefd..a7a6ce1f 100644 --- a/tests/ScadaLink.CLI.Tests/ExitCodeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ExitCodeTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.CLI; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-009 — the design doc defines exit code 2 as "authorization diff --git a/tests/ScadaLink.CLI.Tests/FormatOptionValidationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/FormatOptionValidationTests.cs similarity index 93% rename from tests/ScadaLink.CLI.Tests/FormatOptionValidationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/FormatOptionValidationTests.cs index 43301019..6bcf0ba5 100644 --- a/tests/ScadaLink.CLI.Tests/FormatOptionValidationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/FormatOptionValidationTests.cs @@ -1,7 +1,7 @@ using System.CommandLine; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-008 — the --format option previously accepted any diff --git a/tests/ScadaLink.CLI.Tests/FormatResolutionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/FormatResolutionTests.cs similarity index 93% rename from tests/ScadaLink.CLI.Tests/FormatResolutionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/FormatResolutionTests.cs index fb34de4a..4063c919 100644 --- a/tests/ScadaLink.CLI.Tests/FormatResolutionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/FormatResolutionTests.cs @@ -1,8 +1,8 @@ using System.CommandLine; -using ScadaLink.CLI; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; public class FormatResolutionTests { diff --git a/tests/ScadaLink.CLI.Tests/InstanceArgumentParsingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/InstanceArgumentParsingTests.cs similarity index 95% rename from tests/ScadaLink.CLI.Tests/InstanceArgumentParsingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/InstanceArgumentParsingTests.cs index 34397c75..ffe59ed3 100644 --- a/tests/ScadaLink.CLI.Tests/InstanceArgumentParsingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/InstanceArgumentParsingTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.CLI.Commands; -using ScadaLink.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-005 — malformed --bindings / --overrides JSON diff --git a/tests/ScadaLink.CLI.Tests/ManagementHttpClientTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ManagementHttpClientTests.cs similarity index 98% rename from tests/ScadaLink.CLI.Tests/ManagementHttpClientTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ManagementHttpClientTests.cs index a03ea01d..60013abb 100644 --- a/tests/ScadaLink.CLI.Tests/ManagementHttpClientTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ManagementHttpClientTests.cs @@ -1,8 +1,8 @@ using System.Net; using System.Text; -using ScadaLink.CLI; +using ZB.MOM.WW.ScadaBridge.CLI; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-013 — diff --git a/tests/ScadaLink.CLI.Tests/OutputFormatterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/OutputFormatterTests.cs similarity index 97% rename from tests/ScadaLink.CLI.Tests/OutputFormatterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/OutputFormatterTests.cs index 3c5a89a8..c3a09b8e 100644 --- a/tests/ScadaLink.CLI.Tests/OutputFormatterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/OutputFormatterTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CLI; +using ZB.MOM.WW.ScadaBridge.CLI; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; [Collection("Console")] public class OutputFormatterTests diff --git a/tests/ScadaLink.CLI.Tests/ResponseRenderingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ResponseRenderingTests.cs similarity index 94% rename from tests/ScadaLink.CLI.Tests/ResponseRenderingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ResponseRenderingTests.cs index ed0401ba..d6638a75 100644 --- a/tests/ScadaLink.CLI.Tests/ResponseRenderingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ResponseRenderingTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.CLI; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-002 (empty success body) and CLI-003 (non-JSON success diff --git a/tests/ScadaLink.CLI.Tests/TableHeaderUnionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/TableHeaderUnionTests.cs similarity index 96% rename from tests/ScadaLink.CLI.Tests/TableHeaderUnionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/TableHeaderUnionTests.cs index 85408f3d..fad445c1 100644 --- a/tests/ScadaLink.CLI.Tests/TableHeaderUnionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/TableHeaderUnionTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.CLI; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-016 — WriteAsTable previously derived the table diff --git a/tests/ScadaLink.CLI.Tests/TestCollections.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/TestCollections.cs similarity index 93% rename from tests/ScadaLink.CLI.Tests/TestCollections.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/TestCollections.cs index e47a8740..0de8542d 100644 --- a/tests/ScadaLink.CLI.Tests/TestCollections.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/TestCollections.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// xUnit runs test classes in parallel by default. Several CLI test classes redirect diff --git a/tests/ScadaLink.CLI.Tests/UpdateCommandContractTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/UpdateCommandContractTests.cs similarity index 98% rename from tests/ScadaLink.CLI.Tests/UpdateCommandContractTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/UpdateCommandContractTests.cs index 6cf0b5c2..9ec144b5 100644 --- a/tests/ScadaLink.CLI.Tests/UpdateCommandContractTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/UpdateCommandContractTests.cs @@ -1,7 +1,7 @@ using System.CommandLine; -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-014. The Update*Command records in Commons carry diff --git a/tests/ScadaLink.CLI.Tests/UrlValidationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/UrlValidationTests.cs similarity index 82% rename from tests/ScadaLink.CLI.Tests/UrlValidationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/UrlValidationTests.cs index 0f9ec883..7538d1bb 100644 --- a/tests/ScadaLink.CLI.Tests/UrlValidationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/UrlValidationTests.cs @@ -1,10 +1,10 @@ -using ScadaLink.CLI.Commands; +using ZB.MOM.WW.ScadaBridge.CLI.Commands; -namespace ScadaLink.CLI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CLI.Tests; /// /// Regression tests for CLI-004 — a malformed --url previously reached -/// new Uri(...) in the constructor +/// new Uri(...) in the constructor /// and threw an unhandled . /// public class UrlValidationTests diff --git a/tests/ScadaLink.CLI.Tests/ScadaLink.CLI.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ZB.MOM.WW.ScadaBridge.CLI.Tests.csproj similarity index 75% rename from tests/ScadaLink.CLI.Tests/ScadaLink.CLI.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ZB.MOM.WW.ScadaBridge.CLI.Tests.csproj index 1a3c75eb..351b02fb 100644 --- a/tests/ScadaLink.CLI.Tests/ScadaLink.CLI.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.CLI.Tests/ZB.MOM.WW.ScadaBridge.CLI.Tests.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditDataSeeder.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditDataSeeder.cs similarity index 93% rename from tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditDataSeeder.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditDataSeeder.cs index 0edcd952..2997cdbe 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditDataSeeder.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditDataSeeder.cs @@ -1,13 +1,13 @@ using Microsoft.Data.SqlClient; -namespace ScadaLink.CentralUI.PlaywrightTests.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Audit; /// /// Direct-SQL seeding helper for the Audit Log Playwright E2E tests (#23 M7-T16). /// /// /// The Playwright suite runs against the live Docker cluster (the same one that -/// answers http://localhost:9000), which talks to the ScadaLinkConfig +/// answers http://localhost:9000), which talks to the ScadaBridgeConfig /// database on localhost:1433. infra/mssql/seed-config.sql is off /// limits per the task's strict rules, so each test inserts its own /// AuditLog rows at setup time and best-effort deletes them at teardown. @@ -17,12 +17,12 @@ namespace ScadaLink.CentralUI.PlaywrightTests.Audit; /// Rows are tagged with a unique Target prefix derived from the test /// name + a GUID so the teardown DELETE never touches rows the cluster /// itself produced. The OccurredAtUtc is pinned to "now" so the default -/// +/// /// time-range filter still sees the row after Apply. /// /// /// -/// Connection string mirrors the Docker cluster's scadalink_app account +/// Connection string mirrors the Docker cluster's scadabridge_app account /// from docker/central-node-a/appsettings.Central.json, with the host /// pointed at the host-exposed port (localhost:1433). The /// SCADALINK_PLAYWRIGHT_DB env var lets CI override the connection @@ -32,7 +32,7 @@ namespace ScadaLink.CentralUI.PlaywrightTests.Audit; internal static class AuditDataSeeder { private const string DefaultConnectionString = - "Server=localhost,1433;Database=ScadaLinkConfig;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true;Encrypt=false;Connect Timeout=5"; + "Server=localhost,1433;Database=ScadaBridgeConfig;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true;Encrypt=false;Connect Timeout=5"; private const string EnvVar = "SCADALINK_PLAYWRIGHT_DB"; diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs similarity index 99% rename from tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs index cd884d6a..3a690158 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs @@ -1,7 +1,7 @@ using Microsoft.Playwright; using Xunit; -namespace ScadaLink.CentralUI.PlaywrightTests.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Audit; /// /// End-to-end coverage for the Audit Log results-grid column UX (#23 diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs similarity index 99% rename from tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs index 2f511bde..65e55a4f 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/Audit/AuditLogPageTests.cs @@ -1,6 +1,6 @@ using Microsoft.Playwright; -namespace ScadaLink.CentralUI.PlaywrightTests.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Audit; /// /// End-to-end coverage for the central Audit Log surface (#23 M7-T16 / Bundle H). @@ -8,7 +8,7 @@ namespace ScadaLink.CentralUI.PlaywrightTests.Audit; /// /// Each test seeds its own AuditLog rows directly into the running cluster's /// configuration database via , exercises the UI -/// through Playwright against http://scadalink-traefik, then best-effort +/// through Playwright against http://scadabridge-traefik, then best-effort /// deletes the rows by their Target prefix. The seed/cleanup pattern keeps /// each test self-contained without touching infra/mssql/seed-config.sql. /// diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/LoginTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/LoginTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.PlaywrightTests/LoginTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/LoginTests.cs index cd584dd2..c012e673 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/LoginTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/LoginTests.cs @@ -1,7 +1,7 @@ using System.Text.Json; using Microsoft.Playwright; -namespace ScadaLink.CentralUI.PlaywrightTests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests; [Collection("Playwright")] public class LoginTests diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/NavCollapseTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/NavCollapseTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.PlaywrightTests/NavCollapseTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/NavCollapseTests.cs index 27c7367a..9480f517 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/NavCollapseTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/NavCollapseTests.cs @@ -1,6 +1,6 @@ using Microsoft.Playwright; -namespace ScadaLink.CentralUI.PlaywrightTests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests; /// /// E2E tests for the collapsible sidebar nav sections: sections are collapsed diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/NavigationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/NavigationTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.PlaywrightTests/NavigationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/NavigationTests.cs index b4338d85..69ab2b23 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/NavigationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/NavigationTests.cs @@ -1,6 +1,6 @@ using Microsoft.Playwright; -namespace ScadaLink.CentralUI.PlaywrightTests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests; [Collection("Playwright")] public class NavigationTests diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/PlaywrightFixture.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/PlaywrightFixture.cs similarity index 97% rename from tests/ScadaLink.CentralUI.PlaywrightTests/PlaywrightFixture.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/PlaywrightFixture.cs index 73d7d344..97969fb7 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/PlaywrightFixture.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/PlaywrightFixture.cs @@ -1,6 +1,6 @@ using Microsoft.Playwright; -namespace ScadaLink.CentralUI.PlaywrightTests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests; /// /// Shared fixture that manages the Playwright browser connection. @@ -18,7 +18,7 @@ public class PlaywrightFixture : IAsyncLifetime /// Central UI base URL as seen from inside the Docker network. /// The browser runs in the Playwright container, so it uses the Docker hostname. /// - public const string BaseUrl = "http://scadalink-traefik"; + public const string BaseUrl = "http://scadabridge-traefik"; /// Test LDAP credentials (multi-role user with Admin + Design + Deployment). public const string TestUsername = "multi-role"; diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/RoleNavigationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/RoleNavigationTests.cs similarity index 99% rename from tests/ScadaLink.CentralUI.PlaywrightTests/RoleNavigationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/RoleNavigationTests.cs index f14e772d..3a50c347 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/RoleNavigationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/RoleNavigationTests.cs @@ -1,6 +1,6 @@ using Microsoft.Playwright; -namespace ScadaLink.CentralUI.PlaywrightTests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests; /// /// Verifies that navigation sections and links are shown/hidden based on the user's role. diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/SiteCalls/SiteCallDataSeeder.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCalls/SiteCallDataSeeder.cs similarity index 95% rename from tests/ScadaLink.CentralUI.PlaywrightTests/SiteCalls/SiteCallDataSeeder.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCalls/SiteCallDataSeeder.cs index b05d3f08..e430cd13 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/SiteCalls/SiteCallDataSeeder.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCalls/SiteCallDataSeeder.cs @@ -1,6 +1,6 @@ using Microsoft.Data.SqlClient; -namespace ScadaLink.CentralUI.PlaywrightTests.SiteCalls; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.SiteCalls; /// /// Direct-SQL seeding helper for the Site Calls page Playwright E2E tests @@ -26,7 +26,7 @@ namespace ScadaLink.CentralUI.PlaywrightTests.SiteCalls; internal static class SiteCallDataSeeder { private const string DefaultConnectionString = - "Server=localhost,1433;Database=ScadaLinkConfig;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true;Encrypt=false;Connect Timeout=5"; + "Server=localhost,1433;Database=ScadaBridgeConfig;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true;Encrypt=false;Connect Timeout=5"; private const string EnvVar = "SCADALINK_PLAYWRIGHT_DB"; diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/SiteCalls/SiteCallsPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCalls/SiteCallsPageTests.cs similarity index 99% rename from tests/ScadaLink.CentralUI.PlaywrightTests/SiteCalls/SiteCallsPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCalls/SiteCallsPageTests.cs index 303aa902..36bf7a66 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/SiteCalls/SiteCallsPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCalls/SiteCallsPageTests.cs @@ -1,7 +1,7 @@ using Microsoft.Playwright; using Xunit; -namespace ScadaLink.CentralUI.PlaywrightTests.SiteCalls; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.SiteCalls; /// /// End-to-end coverage for the central Site Calls page (Site Call Audit #22, @@ -36,7 +36,7 @@ namespace ScadaLink.CentralUI.PlaywrightTests.SiteCalls; /// /// The DB-seeding tests are + Skip.IfNot: /// when the cluster / MSSQL is unreachable they report as Skipped (not Failed), -/// matching the established ScadaLink.ConfigurationDatabase.Tests idiom. +/// matching the established ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests idiom. /// /// [Collection("Playwright")] diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/SiteCrudTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCrudTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.PlaywrightTests/SiteCrudTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCrudTests.cs index d6539b73..a89fb392 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/SiteCrudTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/SiteCrudTests.cs @@ -1,6 +1,6 @@ using Microsoft.Playwright; -namespace ScadaLink.CentralUI.PlaywrightTests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests; [Collection("Playwright")] public class SiteCrudTests diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/ScadaLink.CentralUI.PlaywrightTests.csproj b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.csproj similarity index 93% rename from tests/ScadaLink.CentralUI.PlaywrightTests/ScadaLink.CentralUI.PlaywrightTests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.csproj index e89e4568..34eac1bd 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/ScadaLink.CentralUI.PlaywrightTests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.csproj @@ -19,7 +19,7 @@ SkippableFact lets the Site Calls E2E tests report as Skipped (not Failed) when the dev cluster / MSSQL is not running. xunit 2.9.x does not ship Assert.Skip / SkipUnless — those are v3-only — so we use the canonical - community wrapper, matching ScadaLink.ConfigurationDatabase.Tests. + community wrapper, matching ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests. --> diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/xunit.runner.json b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/xunit.runner.json similarity index 100% rename from tests/ScadaLink.CentralUI.PlaywrightTests/xunit.runner.json rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests/xunit.runner.json diff --git a/tests/ScadaLink.CentralUI.Tests/Admin/ApiKeyFormAuditDrillinTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/ApiKeyFormAuditDrillinTests.cs similarity index 86% rename from tests/ScadaLink.CentralUI.Tests/Admin/ApiKeyFormAuditDrillinTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/ApiKeyFormAuditDrillinTests.cs index 5eb5a047..f074e75f 100644 --- a/tests/ScadaLink.CentralUI.Tests/Admin/ApiKeyFormAuditDrillinTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/ApiKeyFormAuditDrillinTests.cs @@ -5,12 +5,12 @@ using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using Microsoft.JSInterop; using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Security; -using ApiKeyForm = ScadaLink.CentralUI.Components.Pages.Admin.ApiKeyForm; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Security; +using ApiKeyForm = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Admin.ApiKeyForm; -namespace ScadaLink.CentralUI.Tests.Admin; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Admin; /// /// Bundle D drill-in test (#23 M7-T12) for the API Keys edit page. The chip @@ -35,7 +35,7 @@ public class ApiKeyFormAuditDrillinTests : BunitContext var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); } [Fact] diff --git a/tests/ScadaLink.CentralUI.Tests/Admin/SiteFormAuditDrillinTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/SiteFormAuditDrillinTests.cs similarity index 85% rename from tests/ScadaLink.CentralUI.Tests/Admin/SiteFormAuditDrillinTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/SiteFormAuditDrillinTests.cs index 265c30e1..c7a4a37c 100644 --- a/tests/ScadaLink.CentralUI.Tests/Admin/SiteFormAuditDrillinTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/SiteFormAuditDrillinTests.cs @@ -6,13 +6,13 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Communication; -using ScadaLink.Security; -using SiteForm = ScadaLink.CentralUI.Components.Pages.Admin.SiteForm; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Security; +using SiteForm = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Admin.SiteForm; -namespace ScadaLink.CentralUI.Tests.Admin; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Admin; /// /// Bundle D drill-in test (#23 M7-T12) for the Site edit page. The chip @@ -41,7 +41,7 @@ public class SiteFormAuditDrillinTests : BunitContext var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); } [Fact] diff --git a/tests/ScadaLink.CentralUI.Tests/Admin/SitesPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/SitesPageTests.cs similarity index 88% rename from tests/ScadaLink.CentralUI.Tests/Admin/SitesPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/SitesPageTests.cs index 99d0f335..3862dc42 100644 --- a/tests/ScadaLink.CentralUI.Tests/Admin/SitesPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Admin/SitesPageTests.cs @@ -5,15 +5,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Communication; -using ScadaLink.DeploymentManager; -using SitesPage = ScadaLink.CentralUI.Components.Pages.Admin.Sites; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.DeploymentManager; +using SitesPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Admin.Sites; -namespace ScadaLink.CentralUI.Tests.Admin; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Admin; /// /// Regression tests for CentralUI-012. The Sites page loaded all sites and then diff --git a/tests/ScadaLink.CentralUI.Tests/Audit/AuditExportEndpointsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Audit/AuditExportEndpointsTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Audit/AuditExportEndpointsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Audit/AuditExportEndpointsTests.cs index 4f29c031..804f85a3 100644 --- a/tests/ScadaLink.CentralUI.Tests/Audit/AuditExportEndpointsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Audit/AuditExportEndpointsTests.cs @@ -13,15 +13,15 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Audit; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.CentralUI.Audit; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.CentralUI.Tests.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Audit; /// /// Endpoint-level tests for the Audit Log CSV export (#23 M7-T14 / Bundle F). @@ -82,7 +82,7 @@ public class AuditExportEndpointsTests // updated AuditExport gate (#23 M7-T15 Bundle G) is what // the tests exercise. The fake principal carries the // "Admin" role, which AuditExportRoles permits. - services.AddScadaLinkAuthorization(); + services.AddScadaBridgeAuthorization(); services.AddSingleton(repo); services.AddScoped(); }); diff --git a/tests/ScadaLink.CentralUI.Tests/Auth/AuthEndpointsCsrfTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/AuthEndpointsCsrfTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Auth/AuthEndpointsCsrfTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/AuthEndpointsCsrfTests.cs index ac49d3a0..397f9b4a 100644 --- a/tests/ScadaLink.CentralUI.Tests/Auth/AuthEndpointsCsrfTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/AuthEndpointsCsrfTests.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; -namespace ScadaLink.CentralUI.Tests.Auth; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Auth; /// /// Regression tests for CentralUI-017. POST /auth/logout called diff --git a/tests/ScadaLink.CentralUI.Tests/Auth/AuthPingEndpointTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/AuthPingEndpointTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Auth/AuthPingEndpointTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/AuthPingEndpointTests.cs index 67cebda6..be26a284 100644 --- a/tests/ScadaLink.CentralUI.Tests/Auth/AuthPingEndpointTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/AuthPingEndpointTests.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; -namespace ScadaLink.CentralUI.Tests.Auth; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Auth; /// /// Regression tests for CentralUI-020. The Blazor circuit's diff --git a/tests/ScadaLink.CentralUI.Tests/Auth/ClaimsPrincipalExtensionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/ClaimsPrincipalExtensionsTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Auth/ClaimsPrincipalExtensionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/ClaimsPrincipalExtensionsTests.cs index 647fe536..913f5c98 100644 --- a/tests/ScadaLink.CentralUI.Tests/Auth/ClaimsPrincipalExtensionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/ClaimsPrincipalExtensionsTests.cs @@ -1,9 +1,9 @@ using System.Security.Claims; using Microsoft.AspNetCore.Components.Authorization; -using ScadaLink.CentralUI.Auth; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.CentralUI.Tests.Auth; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Auth; /// /// Regression tests for CentralUI-024. Ten components each copy-pasted a diff --git a/tests/ScadaLink.CentralUI.Tests/Auth/CookieAuthenticationStateProviderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/CookieAuthenticationStateProviderTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Auth/CookieAuthenticationStateProviderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/CookieAuthenticationStateProviderTests.cs index d992814f..75ad4528 100644 --- a/tests/ScadaLink.CentralUI.Tests/Auth/CookieAuthenticationStateProviderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/CookieAuthenticationStateProviderTests.cs @@ -1,8 +1,8 @@ using System.Security.Claims; using Microsoft.AspNetCore.Http; -using ScadaLink.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; -namespace ScadaLink.CentralUI.Tests.Auth; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Auth; /// /// Regression tests for CentralUI-004. The provider used to read diff --git a/tests/ScadaLink.CentralUI.Tests/Auth/SessionExpiryComponentTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SessionExpiryComponentTests.cs similarity index 93% rename from tests/ScadaLink.CentralUI.Tests/Auth/SessionExpiryComponentTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SessionExpiryComponentTests.cs index 250470a8..5f6b425b 100644 --- a/tests/ScadaLink.CentralUI.Tests/Auth/SessionExpiryComponentTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SessionExpiryComponentTests.cs @@ -2,9 +2,9 @@ using Bunit; using Bunit.TestDoubles; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Auth; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Auth; /// /// Regression tests for CentralUI-020 and CentralUI-025. SessionExpiry @@ -18,7 +18,7 @@ namespace ScadaLink.CentralUI.Tests.Auth; /// public class SessionExpiryComponentTests : BunitContext { - private const string ModulePath = "./_content/ScadaLink.CentralUI/js/session-expiry.js"; + private const string ModulePath = "./_content/ZB.MOM.WW.ScadaBridge.CentralUI/js/session-expiry.js"; [Fact] public async Task CheckSession_ExpiredSession_RedirectsToLogin() diff --git a/tests/ScadaLink.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs index d8f17897..573d1e33 100644 --- a/tests/ScadaLink.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SessionExpiryPolicyTests.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Authentication; -using ScadaLink.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; -namespace ScadaLink.CentralUI.Tests.Auth; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Auth; /// /// Regression tests for CentralUI-005. AuthEndpoints previously stamped a diff --git a/tests/ScadaLink.CentralUI.Tests/Auth/SiteScopeServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SiteScopeServiceTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Auth/SiteScopeServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SiteScopeServiceTests.cs index 35579f3d..f0dd8a61 100644 --- a/tests/ScadaLink.CentralUI.Tests/Auth/SiteScopeServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Auth/SiteScopeServiceTests.cs @@ -1,10 +1,10 @@ using System.Security.Claims; using Microsoft.AspNetCore.Components.Authorization; -using ScadaLink.CentralUI.Auth; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.CentralUI.Tests.Auth; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Auth; /// /// Regression tests for CentralUI-002. Site-scoped Deployment permissions are diff --git a/tests/ScadaLink.CentralUI.Tests/ComponentRenderingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ComponentRenderingTests.cs similarity index 91% rename from tests/ScadaLink.CentralUI.Tests/ComponentRenderingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ComponentRenderingTests.cs index d35a9d02..ab37abea 100644 --- a/tests/ScadaLink.CentralUI.Tests/ComponentRenderingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ComponentRenderingTests.cs @@ -3,9 +3,9 @@ using Bunit; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Components.Pages; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; /// /// bUnit rendering tests for CentralUI Blazor components. @@ -56,7 +56,7 @@ public class ComponentRenderingTests : BunitContext [Fact] public void TemplateEditor_RequiresDesignPolicy() { - var authorizeAttrs = typeof(ScadaLink.CentralUI.Components.Pages.Design.Templates) + var authorizeAttrs = typeof(ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.Templates) .GetCustomAttributes(typeof(AuthorizeAttribute), true); Assert.NotEmpty(authorizeAttrs); diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditDrilldownDrawerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditDrilldownDrawerTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditDrilldownDrawerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditDrilldownDrawerTests.cs index b741d90c..bd78b13c 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditDrilldownDrawerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditDrilldownDrawerTests.cs @@ -2,11 +2,11 @@ using Bunit; using Bunit.TestDoubles; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Components.Audit; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.CentralUI.Tests.Components.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Audit; /// /// bUnit tests for (#23 M7 Bundle C / M7-T4..T8). diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditEventDetailTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditEventDetailTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditEventDetailTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditEventDetailTests.cs index 9316c3ea..6f1b4c1b 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditEventDetailTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditEventDetailTests.cs @@ -2,11 +2,11 @@ using Bunit; using Bunit.TestDoubles; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Components.Audit; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.CentralUI.Tests.Components.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Audit; /// /// bUnit tests for — the reusable single-row diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditFilterBarTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditFilterBarTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditFilterBarTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditFilterBarTests.cs index 26617c54..391d0e04 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditFilterBarTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditFilterBarTests.cs @@ -2,16 +2,16 @@ using Bunit; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Components.Audit; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.CentralUI.Tests.Components.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Audit; /// /// bUnit tests for (#23 M7-T2 / Bundle B). @@ -19,7 +19,7 @@ namespace ScadaLink.CentralUI.Tests.Components.Audit; /// The bar carries the 10 spec filter elements plus the Errors-only toggle. /// Channel is a single-select <select data-test="filter-channel-select">; /// Kind / Status / Site are -/// +/// /// controls whose options are checkboxes tagged /// data-test="filter-<dim>-ms-opt-<value>". Tests pin: /// (1) the full filter set renders; (2) Apply raises OnFilterChanged with diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditResultsGridTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditResultsGridTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditResultsGridTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditResultsGridTests.cs index e6dd1835..3f2fa539 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Audit/AuditResultsGridTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/AuditResultsGridTests.cs @@ -2,13 +2,13 @@ using Bunit; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Components.Audit; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.CentralUI.Tests.Components.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Audit; /// /// bUnit tests for (#23 M7-T3 / Bundle B). The grid diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Audit/ExecutionDetailModalTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/ExecutionDetailModalTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Components/Audit/ExecutionDetailModalTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/ExecutionDetailModalTests.cs index 3bf96fa7..f0d42700 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Audit/ExecutionDetailModalTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/ExecutionDetailModalTests.cs @@ -2,13 +2,13 @@ using Bunit; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Components.Audit; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.CentralUI.Tests.Components.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Audit; /// /// bUnit tests for (Execution-Tree Node Detail diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Audit/ExecutionTreeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/ExecutionTreeTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.Tests/Components/Audit/ExecutionTreeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/ExecutionTreeTests.cs index cbd11672..1f747926 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Audit/ExecutionTreeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Audit/ExecutionTreeTests.cs @@ -1,8 +1,8 @@ using Bunit; -using ScadaLink.CentralUI.Components.Audit; -using ScadaLink.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; -namespace ScadaLink.CentralUI.Tests.Components.Audit; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Audit; /// /// bUnit tests for (Audit Log ParentExecutionId diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Health/AuditKpiTilesTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Health/AuditKpiTilesTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Components/Health/AuditKpiTilesTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Health/AuditKpiTilesTests.cs index 2c47dc82..26c39af1 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Health/AuditKpiTilesTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Health/AuditKpiTilesTests.cs @@ -2,10 +2,10 @@ using Bunit; using Bunit.TestDoubles; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Components.Health; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.CentralUI.Tests.Components.Health; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Health; /// /// bUnit tests for (#23 M7 Bundle E / M7-T13). The diff --git a/tests/ScadaLink.CentralUI.Tests/Components/Health/SiteCallKpiTilesTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Health/SiteCallKpiTilesTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Components/Health/SiteCallKpiTilesTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Health/SiteCallKpiTilesTests.cs index 8dfdd04c..6bc19f93 100644 --- a/tests/ScadaLink.CentralUI.Tests/Components/Health/SiteCallKpiTilesTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Components/Health/SiteCallKpiTilesTests.cs @@ -2,10 +2,10 @@ using Bunit; using Bunit.TestDoubles; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Components.Health; -using ScadaLink.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; -namespace ScadaLink.CentralUI.Tests.Components.Health; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Components.Health; /// /// bUnit tests for (Site Call Audit #22, Task 7). diff --git a/tests/ScadaLink.CentralUI.Tests/DataConnectionFormTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/DataConnectionFormTests.cs similarity index 93% rename from tests/ScadaLink.CentralUI.Tests/DataConnectionFormTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/DataConnectionFormTests.cs index 01959a0f..b9d378b2 100644 --- a/tests/ScadaLink.CentralUI.Tests/DataConnectionFormTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/DataConnectionFormTests.cs @@ -5,11 +5,11 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using DataConnectionForm = ScadaLink.CentralUI.Components.Pages.Design.DataConnectionForm; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using DataConnectionForm = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.DataConnectionForm; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; public class DataConnectionFormTests : BunitContext { diff --git a/tests/ScadaLink.CentralUI.Tests/DataConnectionsPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/DataConnectionsPageTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/DataConnectionsPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/DataConnectionsPageTests.cs index 3d1f2fea..04955e01 100644 --- a/tests/ScadaLink.CentralUI.Tests/DataConnectionsPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/DataConnectionsPageTests.cs @@ -3,12 +3,12 @@ using Bunit; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using DataConnectionsPage = ScadaLink.CentralUI.Components.Pages.Design.DataConnections; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using DataConnectionsPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.DataConnections; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; /// /// bUnit rendering tests for the Connections page (Site → DataConnection tree). diff --git a/tests/ScadaLink.CentralUI.Tests/Deployment/DebugViewDisposalTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugViewDisposalTests.cs similarity index 91% rename from tests/ScadaLink.CentralUI.Tests/Deployment/DebugViewDisposalTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugViewDisposalTests.cs index 41031842..94e764f5 100644 --- a/tests/ScadaLink.CentralUI.Tests/Deployment/DebugViewDisposalTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugViewDisposalTests.cs @@ -6,14 +6,14 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Auth; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Communication; -using ScadaLink.Communication.Grpc; -using DebugViewPage = ScadaLink.CentralUI.Components.Pages.Deployment.DebugView; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; +using DebugViewPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deployment.DebugView; -namespace ScadaLink.CentralUI.Tests.Deployment; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Deployment; /// /// Regression tests for CentralUI-009. The DebugView stream callbacks diff --git a/tests/ScadaLink.CentralUI.Tests/Deployment/DebugViewStreamRaceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugViewStreamRaceTests.cs similarity index 93% rename from tests/ScadaLink.CentralUI.Tests/Deployment/DebugViewStreamRaceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugViewStreamRaceTests.cs index a09af20e..5d4b102c 100644 --- a/tests/ScadaLink.CentralUI.Tests/Deployment/DebugViewStreamRaceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugViewStreamRaceTests.cs @@ -7,15 +7,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Auth; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Communication; -using ScadaLink.Communication.Grpc; -using DebugViewPage = ScadaLink.CentralUI.Components.Pages.Deployment.DebugView; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; +using DebugViewPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deployment.DebugView; -namespace ScadaLink.CentralUI.Tests.Deployment; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Deployment; /// /// Regression tests for CentralUI-021. The DebugView stream callback runs diff --git a/tests/ScadaLink.CentralUI.Tests/Deployment/DeploymentsPushUpdateTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DeploymentsPushUpdateTests.cs similarity index 92% rename from tests/ScadaLink.CentralUI.Tests/Deployment/DeploymentsPushUpdateTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DeploymentsPushUpdateTests.cs index 2409ce92..76a665d2 100644 --- a/tests/ScadaLink.CentralUI.Tests/Deployment/DeploymentsPushUpdateTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DeploymentsPushUpdateTests.cs @@ -5,15 +5,15 @@ using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.CentralUI.Auth; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.DeploymentManager; -using DeploymentsPage = ScadaLink.CentralUI.Components.Pages.Deployment.Deployments; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.DeploymentManager; +using DeploymentsPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deployment.Deployments; -namespace ScadaLink.CentralUI.Tests.Deployment; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Deployment; /// /// Regression tests for CentralUI-006. Component-CentralUI "Real-Time Updates" diff --git a/tests/ScadaLink.CentralUI.Tests/Deployment/InstanceConfigureAuditDrillinTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/InstanceConfigureAuditDrillinTests.cs similarity index 83% rename from tests/ScadaLink.CentralUI.Tests/Deployment/InstanceConfigureAuditDrillinTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/InstanceConfigureAuditDrillinTests.cs index 25a26571..02be7c87 100644 --- a/tests/ScadaLink.CentralUI.Tests/Deployment/InstanceConfigureAuditDrillinTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/InstanceConfigureAuditDrillinTests.cs @@ -4,18 +4,18 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Auth; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.DeploymentManager; -using ScadaLink.Security; -using ScadaLink.TemplateEngine.Services; -using InstanceConfigurePage = ScadaLink.CentralUI.Components.Pages.Deployment.InstanceConfigure; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.DeploymentManager; +using ZB.MOM.WW.ScadaBridge.Security; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; +using InstanceConfigurePage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deployment.InstanceConfigure; -namespace ScadaLink.CentralUI.Tests.Deployment; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Deployment; /// /// Bundle D drill-in test (#23 M7-T12) for the Instance Configure page. The @@ -54,7 +54,7 @@ public class InstanceConfigureAuditDrillinTests : BunitContext Services.AddSingleton(authProvider); Services.AddSingleton(new SiteScopeService(authProvider)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); } [Fact] @@ -65,7 +65,7 @@ public class InstanceConfigureAuditDrillinTests : BunitContext Id = 42, TemplateId = 1, SiteId = 1, - State = ScadaLink.Commons.Types.Enums.InstanceState.NotDeployed, + State = ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.InstanceState.NotDeployed, }; _templateRepo.GetInstanceByIdAsync(42, Arg.Any()).Returns(instance); diff --git a/tests/ScadaLink.CentralUI.Tests/Design/ExternalSystemFormAuditDrillinTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Design/ExternalSystemFormAuditDrillinTests.cs similarity index 85% rename from tests/ScadaLink.CentralUI.Tests/Design/ExternalSystemFormAuditDrillinTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Design/ExternalSystemFormAuditDrillinTests.cs index cf685efb..2fe498cb 100644 --- a/tests/ScadaLink.CentralUI.Tests/Design/ExternalSystemFormAuditDrillinTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Design/ExternalSystemFormAuditDrillinTests.cs @@ -4,12 +4,12 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Security; -using ExternalSystemForm = ScadaLink.CentralUI.Components.Pages.Design.ExternalSystemForm; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Security; +using ExternalSystemForm = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.ExternalSystemForm; -namespace ScadaLink.CentralUI.Tests.Design; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Design; /// /// Bundle D drill-in test (#23 M7-T12) for the External Systems edit page. @@ -33,7 +33,7 @@ public class ExternalSystemFormAuditDrillinTests : BunitContext var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); } [Fact] diff --git a/tests/ScadaLink.CentralUI.Tests/Design/TestRunWarningTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Design/TestRunWarningTests.cs similarity index 90% rename from tests/ScadaLink.CentralUI.Tests/Design/TestRunWarningTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Design/TestRunWarningTests.cs index c5fe5b12..c8b9de09 100644 --- a/tests/ScadaLink.CentralUI.Tests/Design/TestRunWarningTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Design/TestRunWarningTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.CentralUI.Tests.Design; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Design; /// /// Regression tests for CentralUI-014. Test Run wires External, @@ -17,11 +17,11 @@ public class TestRunWarningTests { get { - // tests/ScadaLink.CentralUI.Tests/bin/Debug/net10.0 → repo root. + // tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/bin/Debug/net10.0 → repo root. var dir = AppContext.BaseDirectory; for (var i = 0; i < 6 && dir is not null; i++) dir = Directory.GetParent(dir)?.FullName; - return Path.Combine(dir!, "src", "ScadaLink.CentralUI", + return Path.Combine(dir!, "src", "ZB.MOM.WW.ScadaBridge.CentralUI", "Components", "Pages", "Design"); } } diff --git a/tests/ScadaLink.CentralUI.Tests/Forms/OpcUaEndpointEditorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Forms/OpcUaEndpointEditorTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Forms/OpcUaEndpointEditorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Forms/OpcUaEndpointEditorTests.cs index 5c436769..3c0dd6bd 100644 --- a/tests/ScadaLink.CentralUI.Tests/Forms/OpcUaEndpointEditorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Forms/OpcUaEndpointEditorTests.cs @@ -1,10 +1,10 @@ using Bunit; -using ScadaLink.Commons.Types.DataConnections; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.Commons.Validators; -using OpcUaEndpointEditor = ScadaLink.CentralUI.Components.Forms.OpcUaEndpointEditor; +using ZB.MOM.WW.ScadaBridge.Commons.Types.DataConnections; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Validators; +using OpcUaEndpointEditor = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Forms.OpcUaEndpointEditor; -namespace ScadaLink.CentralUI.Tests.Forms; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Forms; public class OpcUaEndpointEditorTests : BunitContext { diff --git a/tests/ScadaLink.CentralUI.Tests/Layout/NavMenuTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Layout/NavMenuTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Layout/NavMenuTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Layout/NavMenuTests.cs index ed9538e6..b3c81df0 100644 --- a/tests/ScadaLink.CentralUI.Tests/Layout/NavMenuTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Layout/NavMenuTests.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Rendering; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Security; -using NavMenu = ScadaLink.CentralUI.Components.Layout.NavMenu; +using ZB.MOM.WW.ScadaBridge.Security; +using NavMenu = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.NavMenu; -namespace ScadaLink.CentralUI.Tests.Layout; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Layout; /// /// bUnit rendering tests for the sidebar . They verify the @@ -46,7 +46,7 @@ public class NavMenuTests : BunitContext var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); // BunitContext pre-registers a placeholder IAuthorizationService that // throws when AuthorizeView evaluates a policy. Force the real service // so the per-item policy gating is genuinely exercised. diff --git a/tests/ScadaLink.CentralUI.Tests/Monitoring/BrowserTimeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Monitoring/BrowserTimeTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Monitoring/BrowserTimeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Monitoring/BrowserTimeTests.cs index 96fd0f16..44b22e9c 100644 --- a/tests/ScadaLink.CentralUI.Tests/Monitoring/BrowserTimeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Monitoring/BrowserTimeTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.Components; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components; -namespace ScadaLink.CentralUI.Tests.Monitoring; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Monitoring; /// /// Regression tests for CentralUI-008. <input type="datetime-local"> diff --git a/tests/ScadaLink.CentralUI.Tests/Monitoring/MonitoringAuthorizationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Monitoring/MonitoringAuthorizationTests.cs similarity index 90% rename from tests/ScadaLink.CentralUI.Tests/Monitoring/MonitoringAuthorizationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Monitoring/MonitoringAuthorizationTests.cs index e5d8162e..8f4356fe 100644 --- a/tests/ScadaLink.CentralUI.Tests/Monitoring/MonitoringAuthorizationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Monitoring/MonitoringAuthorizationTests.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Authorization; -using ScadaLink.CentralUI.Components.Pages.Monitoring; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Monitoring; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.CentralUI.Tests.Monitoring; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Monitoring; /// /// Regression tests for CentralUI-007. The design doc classifies the Site Event diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPageExportUrlTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPageExportUrlTests.cs similarity index 93% rename from tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPageExportUrlTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPageExportUrlTests.cs index 400f8eee..0a633ce3 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPageExportUrlTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPageExportUrlTests.cs @@ -1,15 +1,15 @@ using Microsoft.AspNetCore.WebUtilities; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using AuditLogPage = ScadaLink.CentralUI.Components.Pages.Audit.AuditLogPage; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using AuditLogPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Audit.AuditLogPage; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// Unit tests for (#23 M7-T14 / /// Bundle F). Builds the ?... querystring the Export-CSV link points /// at; the same conversion is round-tripped on the server side by -/// . +/// . /// These tests pin the no-filter base path + the round-trip back through /// so the link contract stays stable. /// diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPagePermissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPagePermissionTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPagePermissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPagePermissionTests.cs index e5108151..da85eaaf 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPagePermissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPagePermissionTests.cs @@ -16,16 +16,16 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Audit; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Security; -using AuditLogPage = ScadaLink.CentralUI.Components.Pages.Audit.AuditLogPage; +using ZB.MOM.WW.ScadaBridge.CentralUI.Audit; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Security; +using AuditLogPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Audit.AuditLogPage; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// Permission-gating tests for the Audit Log surface (#23 M7-T15 / Bundle G). @@ -76,7 +76,7 @@ public class AuditLogPagePermissionTests : BunitContext var user = BuildPrincipal(roles); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); Services.AddSingleton(); WireUpPageDependencies(); @@ -110,7 +110,7 @@ public class AuditLogPagePermissionTests : BunitContext // OperationalAudit policy. var services = new ServiceCollection(); services.AddLogging(); - services.AddScadaLinkAuthorization(); + services.AddScadaBridgeAuthorization(); using var provider = services.BuildServiceProvider(); var authService = provider.GetRequiredService(); @@ -140,7 +140,7 @@ public class AuditLogPagePermissionTests : BunitContext // ConfigurationAuditLog mirrors the gate — both Audit-group pages // share the OperationalAudit permission so the nav-group policy // remains coherent with the per-page gates. - var configType = typeof(ScadaLink.CentralUI.Components.Pages.Audit.ConfigurationAuditLog); + var configType = typeof(ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Audit.ConfigurationAuditLog); var attributes = configType .GetCustomAttributes(typeof(AuthorizeAttribute), inherit: true) .Cast() @@ -275,8 +275,8 @@ public class AuditLogPagePermissionTests : BunitContext .AddScheme( FakeAuthHandler.SchemeName, opts => opts.Roles = roles); // Real policies — the whole point of these tests is to - // exercise the production AddScadaLinkAuthorization wiring. - services.AddScadaLinkAuthorization(); + // exercise the production AddScadaBridgeAuthorization wiring. + services.AddScadaBridgeAuthorization(); services.AddSingleton(repo); services.AddScoped(); }); diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPageScaffoldTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPageScaffoldTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPageScaffoldTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPageScaffoldTests.cs index a9506086..69d71432 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/AuditLogPageScaffoldTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/AuditLogPageScaffoldTests.cs @@ -6,15 +6,15 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Security; -using AuditLogPage = ScadaLink.CentralUI.Components.Pages.Audit.AuditLogPage; -using NavMenu = ScadaLink.CentralUI.Components.Layout.NavMenu; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Security; +using AuditLogPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Audit.AuditLogPage; +using NavMenu = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Layout.NavMenu; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// Scaffold tests for the new Audit Log page (#23 M7-T1) and the Audit @@ -56,12 +56,12 @@ public class AuditLogPageScaffoldTests : BunitContext var user = BuildPrincipal(roles); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); Services.AddSingleton(); // The page now hosts AuditFilterBar + AuditResultsGrid which depend on // ISiteRepository and IAuditLogQueryService respectively (Bundle B). // Provide stand-ins so the scaffold smoke tests still render the page. - Services.AddSingleton(Substitute.For()); + Services.AddSingleton(Substitute.For()); Services.AddSingleton(_queryService); if (!string.IsNullOrEmpty(query)) @@ -90,7 +90,7 @@ public class AuditLogPageScaffoldTests : BunitContext var user = BuildPrincipal(roles); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); Services.AddSingleton(); var host = Render(parameters => parameters diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/Design/TransportExportPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/Design/TransportExportPageTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Pages/Design/TransportExportPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/Design/TransportExportPageTests.cs index 0cf4c3f2..3c9aa54a 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/Design/TransportExportPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/Design/TransportExportPageTests.cs @@ -5,20 +5,20 @@ using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Security; -using ScadaLink.Transport; -using ScadaLink.Transport.Export; -using TransportExportPage = ScadaLink.CentralUI.Components.Pages.Design.TransportExport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Security; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Export; +using TransportExportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.TransportExport; -namespace ScadaLink.CentralUI.Tests.Pages.Design; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages.Design; /// /// bUnit + logic tests for the TransportExport wizard (Component #24, Task T21). @@ -39,7 +39,7 @@ namespace ScadaLink.CentralUI.Tests.Pages.Design; /// /// JS interop is set to loose mode so the TreeView's sessionStorage round-trip /// and the transport-bundle download interop don't need stubs per test. The -/// scadalinkTransport.downloadBundle call returns void — loose mode is +/// scadabridgeTransport.downloadBundle call returns void — loose mode is /// the lighter wiring than re-stubbing it in every export-path test. /// /// @@ -299,7 +299,7 @@ public class TransportExportPageTests : BunitContext { var services = new ServiceCollection(); services.AddLogging(); - services.AddScadaLinkAuthorization(); + services.AddScadaBridgeAuthorization(); using var provider = services.BuildServiceProvider(); var authService = provider.GetRequiredService(); diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs index 69d2a3bc..f27177e2 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/Design/TransportImportPageTests.cs @@ -9,15 +9,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.Security; -using ScadaLink.Transport; -using TransportImportPage = ScadaLink.CentralUI.Components.Pages.Design.TransportImport; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Security; +using ZB.MOM.WW.ScadaBridge.Transport; +using TransportImportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.TransportImport; -namespace ScadaLink.CentralUI.Tests.Pages.Design; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages.Design; /// /// bUnit + logic tests for the TransportImport wizard (Component #24, Task T22). @@ -27,10 +27,10 @@ namespace ScadaLink.CentralUI.Tests.Pages.Design; /// Selecting a file via InputFile is hard to drive cleanly from bUnit /// (JS interop + DotNetStreamReference), so the state-machine tests reach into /// the page instance via cut.Instance and the InternalsVisibleTo -/// declaration on ScadaLink.CentralUI.csproj. The BundleImporter +/// declaration on ZB.MOM.WW.ScadaBridge.CentralUI.csproj. The BundleImporter /// mock controls every load/preview/apply contract so each step's behaviour can /// be exercised in isolation. The full happy-path round-trip is covered by the -/// integration tests in ScadaLink.Transport.IntegrationTests. +/// integration tests in ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests. /// /// public class TransportImportPageTests : BunitContext @@ -51,13 +51,13 @@ public class TransportImportPageTests : BunitContext MaxUnlockAttemptsPerSession = 3, })); - // Provide a SQLite in-memory ScadaLinkDbContext so the page's + // Provide a SQLite in-memory ScadaBridgeDbContext so the page's // DbContext.SaveChangesAsync() calls in the audit path succeed. - var dbOptions = new DbContextOptionsBuilder() + var dbOptions = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .ConfigureWarnings(w => w.Ignore(RelationalEventId.AmbientTransactionWarning)) .Options; - var dbContext = new ScadaLinkDbContext(dbOptions); + var dbContext = new ScadaBridgeDbContext(dbOptions); dbContext.Database.OpenConnection(); dbContext.Database.EnsureCreated(); Services.AddSingleton(dbContext); @@ -84,7 +84,7 @@ public class TransportImportPageTests : BunitContext CreatedAtUtc: DateTimeOffset.UtcNow, SourceEnvironment: sourceEnv, ExportedBy: "bob", - ScadaLinkVersion: "1.0.0", + ScadaBridgeVersion: "1.0.0", ContentHash: "sha256:0000", Encryption: new EncryptionMetadata( Algorithm: "AES-256-GCM", @@ -294,7 +294,7 @@ public class TransportImportPageTests : BunitContext { var services = new ServiceCollection(); services.AddLogging(); - services.AddScadaLinkAuthorization(); + services.AddScadaBridgeAuthorization(); using var provider = services.BuildServiceProvider(); var authService = provider.GetRequiredService(); @@ -379,7 +379,7 @@ public class TransportImportPageTests : BunitContext /// private static void SeedAtPassphraseStep(TransportImportPage instance, byte[] bytes) { - var dir = Path.Combine(Path.GetTempPath(), "scadalink-transport-staging"); + var dir = Path.Combine(Path.GetTempPath(), "scadabridge-transport-staging"); Directory.CreateDirectory(dir); var path = Path.Combine(dir, $"test-{Guid.NewGuid():N}.scadabundle"); File.WriteAllBytes(path, bytes); diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/ExecutionTreePageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/ExecutionTreePageTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Pages/ExecutionTreePageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/ExecutionTreePageTests.cs index 16b29c3c..ea201943 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/ExecutionTreePageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/ExecutionTreePageTests.cs @@ -6,14 +6,14 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Security; -using ExecutionTreePage = ScadaLink.CentralUI.Components.Pages.Audit.ExecutionTreePage; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Security; +using ExecutionTreePage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Audit.ExecutionTreePage; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit tests for (Audit Log ParentExecutionId @@ -38,7 +38,7 @@ public class ExecutionTreePageTests : BunitContext var user = BuildPrincipal(roles); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - AuthorizationPolicies.AddScadaLinkAuthorization(Services); + AuthorizationPolicies.AddScadaBridgeAuthorization(Services); Services.AddSingleton(); Services.AddSingleton(_queryService); diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/HealthPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/HealthPageTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Pages/HealthPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/HealthPageTests.cs index b575f8c0..8e90b7b0 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/HealthPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/HealthPageTests.cs @@ -6,17 +6,17 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types; -using ScadaLink.Communication; -using ScadaLink.HealthMonitoring; -using HealthPage = ScadaLink.CentralUI.Components.Pages.Monitoring.Health; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using HealthPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Monitoring.Health; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit rendering tests for the Health Monitoring dashboard (Task 24). diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationKpisPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationKpisPageTests.cs similarity index 92% rename from tests/ScadaLink.CentralUI.Tests/Pages/NotificationKpisPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationKpisPageTests.cs index d390d7dd..ba4a2932 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationKpisPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationKpisPageTests.cs @@ -7,15 +7,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Notifications; -using ScadaLink.Communication; -using ScadaLink.Security; -using NotificationKpisPage = ScadaLink.CentralUI.Components.Pages.Notifications.NotificationKpis; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Security; +using NotificationKpisPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.NotificationKpis; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit rendering tests for the Notification KPIs page. diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationListsPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationListsPageTests.cs similarity index 91% rename from tests/ScadaLink.CentralUI.Tests/Pages/NotificationListsPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationListsPageTests.cs index 89ac9955..ebae075b 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationListsPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationListsPageTests.cs @@ -3,12 +3,12 @@ using Bunit; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using NotificationListsPage = ScadaLink.CentralUI.Components.Pages.Notifications.NotificationLists; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using NotificationListsPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.NotificationLists; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit rendering tests for the standalone Notification Lists page (Task 7). diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationReportDetailModalTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationReportDetailModalTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Pages/NotificationReportDetailModalTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationReportDetailModalTests.cs index f97bf051..9fe7d52b 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationReportDetailModalTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationReportDetailModalTests.cs @@ -5,15 +5,15 @@ using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; using NSubstitute; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Communication; -using NotificationReportPage = ScadaLink.CentralUI.Components.Pages.Notifications.NotificationReport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Communication; +using NotificationReportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.NotificationReport; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit tests for the Notification Report row-detail modal — double-clicking a @@ -93,7 +93,7 @@ public class NotificationReportDetailModalTests : BunitContext var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - Services.AddScoped(); + Services.AddScoped(); } [Fact] diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationReportPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationReportPageTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Pages/NotificationReportPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationReportPageTests.cs index 14635bb8..81cfffbf 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/NotificationReportPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/NotificationReportPageTests.cs @@ -6,16 +6,16 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; using NSubstitute; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Communication; -using ScadaLink.Security; -using NotificationReportPage = ScadaLink.CentralUI.Components.Pages.Notifications.NotificationReport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Security; +using NotificationReportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.NotificationReport; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit rendering tests for the Notification Report page. @@ -82,7 +82,7 @@ public class NotificationReportPageTests : BunitContext // CentralUI-028: the page now injects SiteScopeService — the test user // has no SiteId claims, so this resolves to system-wide and the // pre-existing test expectations hold. - Services.AddScoped(); + Services.AddScoped(); } [Fact] diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/QueryStringDrillInTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/QueryStringDrillInTests.cs similarity index 89% rename from tests/ScadaLink.CentralUI.Tests/Pages/QueryStringDrillInTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/QueryStringDrillInTests.cs index 007ee8f3..e760e661 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/QueryStringDrillInTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/QueryStringDrillInTests.cs @@ -11,20 +11,20 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Communication; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.Transport; -using SiteCallsReportPage = ScadaLink.CentralUI.Components.Pages.SiteCalls.SiteCallsReport; -using TransportImportPage = ScadaLink.CentralUI.Components.Pages.Design.TransportImport; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Transport; +using SiteCallsReportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.SiteCalls.SiteCallsReport; +using TransportImportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.TransportImport; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// CentralUI-033: tests for the drill-in / query-string code paths on the two @@ -177,7 +177,7 @@ public sealed class QueryStringDrillInTests var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - Services.AddScoped(); + Services.AddScoped(); } protected override void Dispose(bool disposing) @@ -228,19 +228,19 @@ public sealed class QueryStringDrillInTests MaxUnlockAttemptsPerSession = 3, })); - var dbOptions = new DbContextOptionsBuilder() + var dbOptions = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .ConfigureWarnings(w => w.Ignore(RelationalEventId.AmbientTransactionWarning)) .Options; - var dbContext = new ScadaLinkDbContext(dbOptions); + var dbContext = new ScadaBridgeDbContext(dbOptions); dbContext.Database.OpenConnection(); dbContext.Database.EnsureCreated(); Services.AddSingleton(dbContext); var claims = new List { - new(ScadaLink.Security.JwtTokenService.UsernameClaimType, "alice"), - new(ScadaLink.Security.JwtTokenService.RoleClaimType, "Admin"), + new(ZB.MOM.WW.ScadaBridge.Security.JwtTokenService.UsernameClaimType, "alice"), + new(ZB.MOM.WW.ScadaBridge.Security.JwtTokenService.RoleClaimType, "Admin"), }; var principal = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(principal)); diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs index 7b7ffef9..7b0c393d 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/SiteCallsReportPageTests.cs @@ -9,15 +9,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Communication; -using ScadaLink.Security; -using SiteCallsReportPage = ScadaLink.CentralUI.Components.Pages.SiteCalls.SiteCallsReport; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Security; +using SiteCallsReportPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.SiteCalls.SiteCallsReport; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit rendering tests for the Site Calls report page (Site Call Audit #22). @@ -94,7 +94,7 @@ public class SiteCallsReportPageTests : BunitContext var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth")); Services.AddSingleton(new TestAuthStateProvider(user)); Services.AddAuthorizationCore(); - Services.AddScoped(); + Services.AddScoped(); } [Fact] diff --git a/tests/ScadaLink.CentralUI.Tests/Pages/SmtpConfigurationPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/SmtpConfigurationPageTests.cs similarity index 92% rename from tests/ScadaLink.CentralUI.Tests/Pages/SmtpConfigurationPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/SmtpConfigurationPageTests.cs index 74a37974..99ba8842 100644 --- a/tests/ScadaLink.CentralUI.Tests/Pages/SmtpConfigurationPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Pages/SmtpConfigurationPageTests.cs @@ -3,11 +3,11 @@ using Bunit; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using SmtpConfigurationPage = ScadaLink.CentralUI.Components.Pages.Notifications.SmtpConfiguration; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using SmtpConfigurationPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Notifications.SmtpConfiguration; -namespace ScadaLink.CentralUI.Tests.Pages; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Pages; /// /// bUnit rendering tests for the SMTP Configuration page — specifically the TlsMode diff --git a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/JsonSchemaShapeParserTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/JsonSchemaShapeParserTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/JsonSchemaShapeParserTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/JsonSchemaShapeParserTests.cs index 3d0a612e..6904652e 100644 --- a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/JsonSchemaShapeParserTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/JsonSchemaShapeParserTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.ScriptAnalysis; +using ZB.MOM.WW.ScadaBridge.CentralUI.ScriptAnalysis; -namespace ScadaLink.CentralUI.Tests.ScriptAnalysis; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.ScriptAnalysis; public class JsonSchemaShapeParserTests { diff --git a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/SandboxConsoleCaptureTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/SandboxConsoleCaptureTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/SandboxConsoleCaptureTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/SandboxConsoleCaptureTests.cs index 342222ce..5cb3108c 100644 --- a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/SandboxConsoleCaptureTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/SandboxConsoleCaptureTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.ScriptAnalysis; +using ZB.MOM.WW.ScadaBridge.CentralUI.ScriptAnalysis; -namespace ScadaLink.CentralUI.Tests.ScriptAnalysis; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.ScriptAnalysis; /// /// Regression tests for the SandboxConsoleCapture writer that the Test Run diff --git a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisAsyncResolveTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisAsyncResolveTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisAsyncResolveTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisAsyncResolveTests.cs index 0953ad20..5eb26f19 100644 --- a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisAsyncResolveTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisAsyncResolveTests.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Caching.Memory; using NSubstitute; -using ScadaLink.CentralUI.ScriptAnalysis; -using ScadaLink.TemplateEngine; +using ZB.MOM.WW.ScadaBridge.CentralUI.ScriptAnalysis; +using ZB.MOM.WW.ScadaBridge.TemplateEngine; -namespace ScadaLink.CentralUI.Tests.ScriptAnalysis; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.ScriptAnalysis; /// /// Regression tests for CentralUI-013. ResolveCalledShape resolved shared diff --git a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs similarity index 99% rename from tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs index 0c75bb0f..798b4a90 100644 --- a/tests/ScadaLink.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ScriptAnalysis/ScriptAnalysisServiceTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Caching.Memory; using NSubstitute; -using ScadaLink.CentralUI.ScriptAnalysis; +using ZB.MOM.WW.ScadaBridge.CentralUI.ScriptAnalysis; -namespace ScadaLink.CentralUI.Tests.ScriptAnalysis; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.ScriptAnalysis; public class ScriptAnalysisServiceTests { diff --git a/tests/ScadaLink.CentralUI.Tests/Services/AuditLogExportServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Services/AuditLogExportServiceTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Services/AuditLogExportServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Services/AuditLogExportServiceTests.cs index 3d58b5ef..6cc7b282 100644 --- a/tests/ScadaLink.CentralUI.Tests/Services/AuditLogExportServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Services/AuditLogExportServiceTests.cs @@ -1,12 +1,12 @@ using System.Text; using NSubstitute; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.CentralUI.Tests.Services; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Services; /// /// Tests for (#23 M7-T14 / Bundle F). The diff --git a/tests/ScadaLink.CentralUI.Tests/Services/AuditLogQueryServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Services/AuditLogQueryServiceTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Services/AuditLogQueryServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Services/AuditLogQueryServiceTests.cs index f4902a1e..6b760580 100644 --- a/tests/ScadaLink.CentralUI.Tests/Services/AuditLogQueryServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Services/AuditLogQueryServiceTests.cs @@ -2,18 +2,18 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.CentralUI.Services; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.CentralUI.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.CentralUI.Tests.Services; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Services; /// /// Service-level tests for (#23 M7-T3). The @@ -144,7 +144,7 @@ public class AuditLogQueryServiceTests // // The drill-in deep link (/audit/log?correlationId=…) triggers an OnInitialized // auto-load query that races AuditFilterBar.GetAllSitesAsync() on the SAME - // scoped Blazor-circuit ScadaLinkDbContext. EF Core then throws + // scoped Blazor-circuit ScadaBridgeDbContext. EF Core then throws // "A second operation was started on this context instance before a previous // operation completed." AuditLogQueryService now opens its OWN DI scope per // QueryAsync call (scope-per-query) so it never shares the page's scoped @@ -154,7 +154,7 @@ public class AuditLogQueryServiceTests [Fact] public async Task AuditLogQueryService_ConcurrentQueries_DoNotRace() { - // A real ScadaLinkDbContext (SQLite in-memory) registered as SCOPED with + // A real ScadaBridgeDbContext (SQLite in-memory) registered as SCOPED with // the real AuditLogRepository — exactly the shared-scoped-context shape // that produces the EF race when one context services two operations. using var connection = new Microsoft.Data.Sqlite.SqliteConnection("DataSource=:memory:"); @@ -162,7 +162,7 @@ public class AuditLogQueryServiceTests var services = new ServiceCollection(); services.AddLogging(); - services.AddDbContext(options => + services.AddDbContext(options => options.UseSqlite(connection) .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning))); services.AddScoped(); @@ -172,7 +172,7 @@ public class AuditLogQueryServiceTests // Create the schema once on a throwaway scope. using (var seedScope = provider.CreateScope()) { - var ctx = seedScope.ServiceProvider.GetRequiredService(); + var ctx = seedScope.ServiceProvider.GetRequiredService(); await ctx.Database.EnsureCreatedAsync(); } diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/AlarmTriggerConfigCodecTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/AlarmTriggerConfigCodecTests.cs similarity index 99% rename from tests/ScadaLink.CentralUI.Tests/Shared/AlarmTriggerConfigCodecTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/AlarmTriggerConfigCodecTests.cs index e99f2d15..763e5126 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/AlarmTriggerConfigCodecTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/AlarmTriggerConfigCodecTests.cs @@ -1,8 +1,8 @@ using System.Text.Json; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; public class AlarmTriggerConfigCodecTests { diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/DataTablePagerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DataTablePagerTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Shared/DataTablePagerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DataTablePagerTests.cs index b5763608..e6b08ab7 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/DataTablePagerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DataTablePagerTests.cs @@ -1,8 +1,8 @@ using Bunit; using Microsoft.AspNetCore.Components; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Regression tests for CentralUI-016. DataTable looped diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/DialogServiceThreadingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DialogServiceThreadingTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Shared/DialogServiceThreadingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DialogServiceThreadingTests.cs index 09c4fb26..084b222b 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/DialogServiceThreadingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DialogServiceThreadingTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Characterization tests for CentralUI-015 (re-triaged Won't Fix — see diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/DiffDialogTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DiffDialogTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Shared/DiffDialogTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DiffDialogTests.cs index 0427133f..e702fd18 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/DiffDialogTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DiffDialogTests.cs @@ -1,7 +1,7 @@ using Bunit; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Regression tests for CentralUI-011. DiffDialog.OpenAsync returns the diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/DurationInputTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DurationInputTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Shared/DurationInputTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DurationInputTests.cs index da727691..fc1d7e60 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/DurationInputTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/DurationInputTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Coverage for , the number+unit codec behind the diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/JsInteropLoggingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/JsInteropLoggingTests.cs similarity index 93% rename from tests/ScadaLink.CentralUI.Tests/Shared/JsInteropLoggingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/JsInteropLoggingTests.cs index b8f3e27e..eea0ddc6 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/JsInteropLoggingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/JsInteropLoggingTests.cs @@ -8,14 +8,14 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using Microsoft.JSInterop; using NSubstitute; -using ScadaLink.CentralUI.Auth; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Communication; -using ParkedMessagesPage = ScadaLink.CentralUI.Components.Pages.Monitoring.ParkedMessages; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Communication; +using ParkedMessagesPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Monitoring.ParkedMessages; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Regression tests for CentralUI-023. DiffDialog.TryLockBodyAsync / diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/MonacoEditorLoggingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/MonacoEditorLoggingTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Shared/MonacoEditorLoggingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/MonacoEditorLoggingTests.cs index 8b07d65a..ca99a8cf 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/MonacoEditorLoggingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/MonacoEditorLoggingTests.cs @@ -2,9 +2,9 @@ using Bunit; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.JSInterop; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Regression tests for CentralUI-018. MonacoEditor wrapped every JS diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/PagerWindowTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/PagerWindowTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Shared/PagerWindowTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/PagerWindowTests.cs index a05b0d06..303da8f0 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/PagerWindowTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/PagerWindowTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Unit tests for the helper introduced for diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/SchemaBuilderModelTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/SchemaBuilderModelTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.Tests/Shared/SchemaBuilderModelTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/SchemaBuilderModelTests.cs index 1cf9effb..db64955f 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/SchemaBuilderModelTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/SchemaBuilderModelTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; public class SchemaBuilderModelTests { diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/ScriptTriggerConfigCodecTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ScriptTriggerConfigCodecTests.cs similarity index 97% rename from tests/ScadaLink.CentralUI.Tests/Shared/ScriptTriggerConfigCodecTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ScriptTriggerConfigCodecTests.cs index 135a7353..0784caec 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/ScriptTriggerConfigCodecTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ScriptTriggerConfigCodecTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Round-trip coverage for the WhileTrue/OnTrue mode field on the diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/ScriptTriggerEditorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ScriptTriggerEditorTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Shared/ScriptTriggerEditorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ScriptTriggerEditorTests.cs index 34c66cd5..c1f2dacb 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/ScriptTriggerEditorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ScriptTriggerEditorTests.cs @@ -1,8 +1,8 @@ using Bunit; using Microsoft.AspNetCore.Components; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Component tests for the OnTrue/WhileTrue mode selector that diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/TimestampDisplayTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/TimestampDisplayTests.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/Shared/TimestampDisplayTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/TimestampDisplayTests.cs index 470afad1..7cd01c92 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/TimestampDisplayTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/TimestampDisplayTests.cs @@ -1,7 +1,7 @@ using Bunit; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Regression tests for HealthMonitoring-015. A heartbeat-only registered site has diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/ToastNotificationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ToastNotificationTests.cs similarity index 96% rename from tests/ScadaLink.CentralUI.Tests/Shared/ToastNotificationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ToastNotificationTests.cs index 31d61b2c..a8514bac 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/ToastNotificationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/ToastNotificationTests.cs @@ -1,7 +1,7 @@ using Bunit; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Regression tests for CentralUI-010. ToastNotification.AddToast diff --git a/tests/ScadaLink.CentralUI.Tests/Shared/TreeViewStorageResilienceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/TreeViewStorageResilienceTests.cs similarity index 95% rename from tests/ScadaLink.CentralUI.Tests/Shared/TreeViewStorageResilienceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/TreeViewStorageResilienceTests.cs index d9b17faa..e99bd34f 100644 --- a/tests/ScadaLink.CentralUI.Tests/Shared/TreeViewStorageResilienceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Shared/TreeViewStorageResilienceTests.cs @@ -1,8 +1,8 @@ using Bunit; using Microsoft.AspNetCore.Components; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests.Shared; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Shared; /// /// Regression tests for CentralUI-018. TreeView's storage-restore path diff --git a/tests/ScadaLink.CentralUI.Tests/TemplatesPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TemplatesPageTests.cs similarity index 92% rename from tests/ScadaLink.CentralUI.Tests/TemplatesPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TemplatesPageTests.cs index e6a7d825..49c12558 100644 --- a/tests/ScadaLink.CentralUI.Tests/TemplatesPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TemplatesPageTests.cs @@ -3,15 +3,15 @@ using Bunit; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.TemplateEngine; -using ScadaLink.TemplateEngine.Services; -using TemplatesPage = ScadaLink.CentralUI.Components.Pages.Design.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.TemplateEngine; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; +using TemplatesPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Design.Templates; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; /// /// bUnit rendering tests for the Templates page that verify the folder/template diff --git a/tests/ScadaLink.CentralUI.Tests/TopologyPageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TopologyPageTests.cs similarity index 89% rename from tests/ScadaLink.CentralUI.Tests/TopologyPageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TopologyPageTests.cs index 2397f70b..8a43c609 100644 --- a/tests/ScadaLink.CentralUI.Tests/TopologyPageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TopologyPageTests.cs @@ -6,19 +6,19 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication; -using ScadaLink.DeploymentManager; -using ScadaLink.CentralUI.Components.Shared; -using ScadaLink.TemplateEngine.Services; -using TopologyPage = ScadaLink.CentralUI.Components.Pages.Deployment.Topology; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.DeploymentManager; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; +using TopologyPage = ZB.MOM.WW.ScadaBridge.CentralUI.Components.Pages.Deployment.Topology; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; /// /// bUnit rendering tests for the Topology page (Site → Area → Instance tree). @@ -56,12 +56,12 @@ public class TopologyPageTests : BunitContext Services.AddSingleton>(NullLogger.Instance); // DeploymentService gained a DiffService dependency (DeploymentManager // contract change); register it so the page's DI graph resolves. - Services.AddScoped(); + Services.AddScoped(); // CentralUI-006: DeploymentService now also depends on the // deployment-status notifier (a process singleton in production). - Services.AddSingleton( - new ScadaLink.DeploymentManager.DeploymentStatusNotifier( - NullLogger.Instance)); + Services.AddSingleton( + new ZB.MOM.WW.ScadaBridge.DeploymentManager.DeploymentStatusNotifier( + NullLogger.Instance)); Services.AddScoped(); Services.AddScoped(); Services.AddScoped(); @@ -75,7 +75,7 @@ public class TopologyPageTests : BunitContext // Site scoping (CentralUI-002): Topology injects SiteScopeService to // filter the tree by the user's permitted sites. - Services.AddScoped(); + Services.AddScoped(); // TreeView persists expansion state via JS interop. Stub the calls so render doesn't throw. JSInterop.Setup("treeviewStorage.load", _ => true).SetResult(null); @@ -216,9 +216,9 @@ public class TopologyPageTests : BunitContext var scopedUser = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim("Username", "scoped-tester"), - new Claim(ScadaLink.Security.JwtTokenService.RoleClaimType, "Deployment"), + new Claim(ZB.MOM.WW.ScadaBridge.Security.JwtTokenService.RoleClaimType, "Deployment"), // Permitted on site 1 only. - new Claim(ScadaLink.Security.JwtTokenService.SiteIdClaimType, "1"), + new Claim(ZB.MOM.WW.ScadaBridge.Security.JwtTokenService.SiteIdClaimType, "1"), }, "TestAuth")); // Last AuthenticationStateProvider registration wins on resolution. Services.AddSingleton(new TestAuthStateProvider(scopedUser)); diff --git a/tests/ScadaLink.CentralUI.Tests/TreeViewMultiSelectTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewMultiSelectTests.cs similarity index 98% rename from tests/ScadaLink.CentralUI.Tests/TreeViewMultiSelectTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewMultiSelectTests.cs index 99911164..9de26daa 100644 --- a/tests/ScadaLink.CentralUI.Tests/TreeViewMultiSelectTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewMultiSelectTests.cs @@ -1,8 +1,8 @@ using Bunit; using Microsoft.AspNetCore.Components; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; /// /// bUnit tests for TreeView's Checkbox-selection mode (T19 of the Transport diff --git a/tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs similarity index 99% rename from tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs index 2f33b1a9..cb119483 100644 --- a/tests/ScadaLink.CentralUI.Tests/TreeViewTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/TreeViewTests.cs @@ -1,9 +1,9 @@ using Bunit; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; -using ScadaLink.CentralUI.Components.Shared; +using ZB.MOM.WW.ScadaBridge.CentralUI.Components.Shared; -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; /// /// bUnit tests for the TreeView component covering core rendering, diff --git a/tests/ScadaLink.CentralUI.Tests/UnitTest1.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/UnitTest1.cs similarity index 94% rename from tests/ScadaLink.CentralUI.Tests/UnitTest1.cs rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/UnitTest1.cs index 446f8897..17467ebf 100644 --- a/tests/ScadaLink.CentralUI.Tests/UnitTest1.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/UnitTest1.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.CentralUI.Tests; +namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests; /// /// Basic compilation and type-existence tests for Phase 4-6 UI pages. @@ -12,7 +12,7 @@ public class UnitTest1 { var assembly = typeof(ServiceCollectionExtensions).Assembly; Assert.NotNull(assembly); - Assert.Equal("ScadaLink.CentralUI", assembly.GetName().Name); + Assert.Equal("ZB.MOM.WW.ScadaBridge.CentralUI", assembly.GetName().Name); } [Fact] diff --git a/tests/ScadaLink.CentralUI.Tests/ScadaLink.CentralUI.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests.csproj similarity index 76% rename from tests/ScadaLink.CentralUI.Tests/ScadaLink.CentralUI.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests.csproj index 59b20e82..8fadb6f9 100644 --- a/tests/ScadaLink.CentralUI.Tests/ScadaLink.CentralUI.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests.csproj @@ -28,13 +28,13 @@ - + - + \ No newline at end of file diff --git a/tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsTests.cs similarity index 95% rename from tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsTests.cs index cf18ca89..37fcef6a 100644 --- a/tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.ClusterInfrastructure.Tests; +namespace ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests; /// /// Tests for ClusterOptions default values and property setters. @@ -38,7 +38,7 @@ public class ClusterOptionsTests // ClusterInfra-011: SectionName constant deleted — the previous test // `SectionName_IsTheExpectedAppSettingsSection` is removed alongside it. // The Host's SiteServiceRegistration / StartupValidator continue to - // reference the `"ScadaLink:Cluster"` literal directly; reinstating the + // reference the `"ScadaBridge:Cluster"` literal directly; reinstating the // constant should happen when those Host binding sites can be updated in // the same change. diff --git a/tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsValidatorTests.cs similarity index 96% rename from tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsValidatorTests.cs index f972a79d..58cdbabd 100644 --- a/tests/ScadaLink.ClusterInfrastructure.Tests/ClusterOptionsValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ClusterOptionsValidatorTests.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Options; -namespace ScadaLink.ClusterInfrastructure.Tests; +namespace ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests; /// /// CI-004: Tests that rejects the @@ -13,7 +13,7 @@ public class ClusterOptionsValidatorTests { private static ClusterOptions ValidOptions() => new() { - SeedNodes = new List { "akka.tcp://scadalink@node1:8081", "akka.tcp://scadalink@node2:8081" }, + SeedNodes = new List { "akka.tcp://scadabridge@node1:8081", "akka.tcp://scadabridge@node2:8081" }, SplitBrainResolverStrategy = "keep-oldest", StableAfter = TimeSpan.FromSeconds(15), HeartbeatInterval = TimeSpan.FromSeconds(2), @@ -77,7 +77,7 @@ public class ClusterOptionsValidatorTests // must be rejected by the contract owner's validator, not just by the // Host's startup validator. var options = ValidOptions(); - options.SeedNodes = new List { "akka.tcp://scadalink@node1:8081" }; + options.SeedNodes = new List { "akka.tcp://scadabridge@node1:8081" }; var result = new ClusterOptionsValidator().Validate(null, options); diff --git a/tests/ScadaLink.ClusterInfrastructure.Tests/ServiceCollectionExtensionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ServiceCollectionExtensionsTests.cs similarity index 91% rename from tests/ScadaLink.ClusterInfrastructure.Tests/ServiceCollectionExtensionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ServiceCollectionExtensionsTests.cs index c54007bf..f0beca89 100644 --- a/tests/ScadaLink.ClusterInfrastructure.Tests/ServiceCollectionExtensionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ServiceCollectionExtensionsTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -namespace ScadaLink.ClusterInfrastructure.Tests; +namespace ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests; /// /// CI-002: Tests that @@ -37,7 +37,7 @@ public class ServiceCollectionExtensionsTests // A MinNrOfMembers of 2 blocks the cluster singleton after failover. services.Configure(o => { - o.SeedNodes = new List { "akka.tcp://scadalink@node1:8081" }; + o.SeedNodes = new List { "akka.tcp://scadabridge@node1:8081" }; o.MinNrOfMembers = 2; }); @@ -51,7 +51,7 @@ public class ServiceCollectionExtensionsTests // ClusterInfra-014: `AddClusterInfrastructureActors_ThrowsRatherThanSilentlySucceeding` // was removed alongside the now-deleted `AddClusterInfrastructureActors` // extension method. The Akka.NET actor wiring legitimately lives in - // `ScadaLink.Host` (AkkaHostedService) per the + // `ZB.MOM.WW.ScadaBridge.Host` (AkkaHostedService) per the // Component-ClusterInfrastructure.md "Implementation Note — Code Placement" // section; this project no longer exposes an actor-registration extension. } diff --git a/tests/ScadaLink.ClusterInfrastructure.Tests/ScadaLink.ClusterInfrastructure.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests.csproj similarity index 84% rename from tests/ScadaLink.ClusterInfrastructure.Tests/ScadaLink.ClusterInfrastructure.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests.csproj index efc3848d..997021c2 100644 --- a/tests/ScadaLink.ClusterInfrastructure.Tests/ScadaLink.ClusterInfrastructure.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests/ZB.MOM.WW.ScadaBridge.ClusterInfrastructure.Tests.csproj @@ -22,7 +22,7 @@ - + \ No newline at end of file diff --git a/tests/ScadaLink.Commons.Tests/ArchitecturalConstraintTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ArchitecturalConstraintTests.cs similarity index 90% rename from tests/ScadaLink.Commons.Tests/ArchitecturalConstraintTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ArchitecturalConstraintTests.cs index c20a0884..47cea343 100644 --- a/tests/ScadaLink.Commons.Tests/ArchitecturalConstraintTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ArchitecturalConstraintTests.cs @@ -1,11 +1,11 @@ using System.Reflection; using System.Xml.Linq; -namespace ScadaLink.Commons.Tests; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests; public class ArchitecturalConstraintTests { - private static readonly Assembly CommonsAssembly = typeof(ScadaLink.Commons.Types.RetryPolicy).Assembly; + private static readonly Assembly CommonsAssembly = typeof(ZB.MOM.WW.ScadaBridge.Commons.Types.RetryPolicy).Assembly; private static string GetCsprojPath() { @@ -13,12 +13,12 @@ public class ArchitecturalConstraintTests var dir = new DirectoryInfo(AppContext.BaseDirectory); while (dir != null) { - var candidate = Path.Combine(dir.FullName, "src", "ScadaLink.Commons", "ScadaLink.Commons.csproj"); + var candidate = Path.Combine(dir.FullName, "src", "ZB.MOM.WW.ScadaBridge.Commons", "ZB.MOM.WW.ScadaBridge.Commons.csproj"); if (File.Exists(candidate)) return candidate; dir = dir.Parent; } - throw new InvalidOperationException("Could not find ScadaLink.Commons.csproj"); + throw new InvalidOperationException("Could not find ZB.MOM.WW.ScadaBridge.Commons.csproj"); } private static string GetCommonsSourceDirectory() @@ -191,16 +191,16 @@ public class ArchitecturalConstraintTests public void KeyEntities_ShouldHaveDateTimeOffsetTimestamps() { // Spot-check key entity timestamp properties - var deploymentRecord = CommonsAssembly.GetType("ScadaLink.Commons.Entities.Deployment.DeploymentRecord"); + var deploymentRecord = CommonsAssembly.GetType("ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment.DeploymentRecord"); Assert.NotNull(deploymentRecord); Assert.Equal(typeof(DateTimeOffset), deploymentRecord!.GetProperty("DeployedAt")!.PropertyType); Assert.Equal(typeof(DateTimeOffset?), deploymentRecord.GetProperty("CompletedAt")!.PropertyType); - var artifactRecord = CommonsAssembly.GetType("ScadaLink.Commons.Entities.Deployment.SystemArtifactDeploymentRecord"); + var artifactRecord = CommonsAssembly.GetType("ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment.SystemArtifactDeploymentRecord"); Assert.NotNull(artifactRecord); Assert.Equal(typeof(DateTimeOffset), artifactRecord!.GetProperty("DeployedAt")!.PropertyType); - var auditEntry = CommonsAssembly.GetType("ScadaLink.Commons.Entities.Audit.AuditLogEntry"); + var auditEntry = CommonsAssembly.GetType("ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit.AuditLogEntry"); Assert.NotNull(auditEntry); Assert.Equal(typeof(DateTimeOffset), auditEntry!.GetProperty("Timestamp")!.PropertyType); } diff --git a/tests/ScadaLink.Commons.Tests/Entities/ApiKeyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/ApiKeyTests.cs similarity index 90% rename from tests/ScadaLink.Commons.Tests/Entities/ApiKeyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/ApiKeyTests.cs index 78f56e90..add13d37 100644 --- a/tests/ScadaLink.Commons.Tests/Entities/ApiKeyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/ApiKeyTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; -namespace ScadaLink.Commons.Tests.Entities; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities; /// /// ConfigurationDatabase-012: the entity must never carry the diff --git a/tests/ScadaLink.Commons.Tests/Entities/Audit/AuditEventTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/Audit/AuditEventTests.cs similarity index 97% rename from tests/ScadaLink.Commons.Tests/Entities/Audit/AuditEventTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/Audit/AuditEventTests.cs index 7327200d..c7b0cf71 100644 --- a/tests/ScadaLink.Commons.Tests/Entities/Audit/AuditEventTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/Audit/AuditEventTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Entities.Audit; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities.Audit; /// /// Verifies behaves as an init-only record: diff --git a/tests/ScadaLink.Commons.Tests/Entities/Audit/SiteCallTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/Audit/SiteCallTests.cs similarity index 89% rename from tests/ScadaLink.Commons.Tests/Entities/Audit/SiteCallTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/Audit/SiteCallTests.cs index b45deff7..9da4e3ba 100644 --- a/tests/ScadaLink.Commons.Tests/Entities/Audit/SiteCallTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/Audit/SiteCallTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Entities.Audit; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities.Audit; /// /// Verifies the central operational entity carries the diff --git a/tests/ScadaLink.Commons.Tests/Entities/EntityConventionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/EntityConventionTests.cs similarity index 94% rename from tests/ScadaLink.Commons.Tests/Entities/EntityConventionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/EntityConventionTests.cs index 084c5164..6efa8fce 100644 --- a/tests/ScadaLink.Commons.Tests/Entities/EntityConventionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/EntityConventionTests.cs @@ -1,11 +1,11 @@ using System.Collections; using System.Reflection; -namespace ScadaLink.Commons.Tests.Entities; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities; public class EntityConventionTests { - private static readonly Assembly CommonsAssembly = typeof(ScadaLink.Commons.Types.RetryPolicy).Assembly; + private static readonly Assembly CommonsAssembly = typeof(ZB.MOM.WW.ScadaBridge.Commons.Types.RetryPolicy).Assembly; private static IEnumerable GetEntityTypes() => CommonsAssembly.GetTypes() diff --git a/tests/ScadaLink.Commons.Tests/Entities/NotificationEntityTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/NotificationEntityTests.cs similarity index 95% rename from tests/ScadaLink.Commons.Tests/Entities/NotificationEntityTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/NotificationEntityTests.cs index 518958f4..61ce235c 100644 --- a/tests/ScadaLink.Commons.Tests/Entities/NotificationEntityTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/NotificationEntityTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Entities; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities; /// /// Verifies the outbox entity's constructor defaults diff --git a/tests/ScadaLink.Commons.Tests/Entities/TemplateFolderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/TemplateFolderTests.cs similarity index 84% rename from tests/ScadaLink.Commons.Tests/Entities/TemplateFolderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/TemplateFolderTests.cs index e9903989..8a7f58c2 100644 --- a/tests/ScadaLink.Commons.Tests/Entities/TemplateFolderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Entities/TemplateFolderTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; using Xunit; -namespace ScadaLink.Commons.Tests.Entities; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Entities; public class TemplateFolderTests { diff --git a/tests/ScadaLink.Commons.Tests/Interfaces/Services/AuditWriterContractTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Interfaces/Services/AuditWriterContractTests.cs similarity index 87% rename from tests/ScadaLink.Commons.Tests/Interfaces/Services/AuditWriterContractTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Interfaces/Services/AuditWriterContractTests.cs index c40a5d2f..87b5a6b7 100644 --- a/tests/ScadaLink.Commons.Tests/Interfaces/Services/AuditWriterContractTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Interfaces/Services/AuditWriterContractTests.cs @@ -1,8 +1,8 @@ using System.Reflection; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.Commons.Tests.Interfaces.Services; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Interfaces.Services; /// /// Reflection-level contract guards for the Audit Log (#23) writer interfaces. diff --git a/tests/ScadaLink.Commons.Tests/Interfaces/Services/ExternalCallResultTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Interfaces/Services/ExternalCallResultTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Interfaces/Services/ExternalCallResultTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Interfaces/Services/ExternalCallResultTests.cs index 6de2517d..734db340 100644 --- a/tests/ScadaLink.Commons.Tests/Interfaces/Services/ExternalCallResultTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Interfaces/Services/ExternalCallResultTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.Commons.Tests.Interfaces.Services; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Interfaces.Services; /// /// Tests for , in particular the Commons-021 diff --git a/tests/ScadaLink.Commons.Tests/Messages/CompatibilityTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/CompatibilityTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Messages/CompatibilityTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/CompatibilityTests.cs index 0c3f5598..1fc796d5 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/CompatibilityTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/CompatibilityTests.cs @@ -1,14 +1,14 @@ using System.Text.Json; -using ScadaLink.Commons.Messages.Artifacts; -using ScadaLink.Commons.Messages.Communication; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Messages.Lifecycle; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Artifacts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Lifecycle; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Messages; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages; /// /// WP-9 (Phase 8): Message contract compatibility tests. diff --git a/tests/ScadaLink.Commons.Tests/Messages/ConnectionBindingSerializationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/ConnectionBindingSerializationTests.cs similarity index 95% rename from tests/ScadaLink.Commons.Tests/Messages/ConnectionBindingSerializationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/ConnectionBindingSerializationTests.cs index 821f921d..9a7e504c 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/ConnectionBindingSerializationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/ConnectionBindingSerializationTests.cs @@ -1,7 +1,7 @@ using System.Text.Json; -using ScadaLink.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; -namespace ScadaLink.Commons.Tests.Messages; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages; /// /// Regression tests for Commons-008 — diff --git a/tests/ScadaLink.Commons.Tests/Messages/Integration/AuditTelemetryMessagesTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/Integration/AuditTelemetryMessagesTests.cs similarity index 94% rename from tests/ScadaLink.Commons.Tests/Messages/Integration/AuditTelemetryMessagesTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/Integration/AuditTelemetryMessagesTests.cs index 1bf2f9be..0c0ee9eb 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/Integration/AuditTelemetryMessagesTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/Integration/AuditTelemetryMessagesTests.cs @@ -1,8 +1,8 @@ -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Messages.Integration; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages.Integration; /// /// Audit Log (#23) telemetry handoff: envelope + pull request/response DTOs. diff --git a/tests/ScadaLink.Commons.Tests/Messages/Integration/CachedCallTelemetryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/Integration/CachedCallTelemetryTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Messages/Integration/CachedCallTelemetryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/Integration/CachedCallTelemetryTests.cs index 5c1bca7c..f3ac7a3a 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/Integration/CachedCallTelemetryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/Integration/CachedCallTelemetryTests.cs @@ -1,9 +1,9 @@ -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Messages.Integration; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages.Integration; /// /// Audit Log #23 (M3 Bundle A — Task A4) — tests for the combined diff --git a/tests/ScadaLink.Commons.Tests/Messages/ManagementCommandRegistryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/ManagementCommandRegistryTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Messages/ManagementCommandRegistryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/ManagementCommandRegistryTests.cs index ea4ee5cf..954f4830 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/ManagementCommandRegistryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/ManagementCommandRegistryTests.cs @@ -1,7 +1,7 @@ using System.Reflection; -using ScadaLink.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; -namespace ScadaLink.Commons.Tests.Messages; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages; /// /// Tests for , including the Commons-004 diff --git a/tests/ScadaLink.Commons.Tests/Messages/MessageConventionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/MessageConventionTests.cs similarity index 73% rename from tests/ScadaLink.Commons.Tests/Messages/MessageConventionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/MessageConventionTests.cs index ce438285..a3dafac9 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/MessageConventionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/MessageConventionTests.cs @@ -1,11 +1,11 @@ using System.Reflection; using System.Text.Json; -namespace ScadaLink.Commons.Tests.Messages; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages; public class MessageConventionTests { - private static readonly Assembly CommonsAssembly = typeof(ScadaLink.Commons.Types.RetryPolicy).Assembly; + private static readonly Assembly CommonsAssembly = typeof(ZB.MOM.WW.ScadaBridge.Commons.Types.RetryPolicy).Assembly; private static IEnumerable GetMessageTypes() => CommonsAssembly.GetTypes() @@ -49,11 +49,11 @@ public class MessageConventionTests [Fact] public void JsonRoundTrip_DeployInstanceCommand_ShouldSucceed() { - var msg = new ScadaLink.Commons.Messages.Deployment.DeployInstanceCommand( + var msg = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment.DeployInstanceCommand( "dep-1", "instance-1", "abc123", "{}", "admin", DateTimeOffset.UtcNow); var json = JsonSerializer.Serialize(msg); - var deserialized = JsonSerializer.Deserialize(json); + var deserialized = JsonSerializer.Deserialize(json); Assert.NotNull(deserialized); Assert.Equal(msg.DeploymentId, deserialized!.DeploymentId); @@ -66,7 +66,7 @@ public class MessageConventionTests // Simulate a newer version with an extra field var json = """{"DeploymentId":"dep-1","InstanceUniqueName":"inst-1","RevisionHash":"abc","FlattenedConfigurationJson":"{}","DeployedBy":"admin","Timestamp":"2025-01-01T00:00:00+00:00","NewField":"extra"}"""; - var deserialized = JsonSerializer.Deserialize(json); + var deserialized = JsonSerializer.Deserialize(json); Assert.NotNull(deserialized); Assert.Equal("dep-1", deserialized!.DeploymentId); @@ -78,7 +78,7 @@ public class MessageConventionTests // DeploymentStatusResponse has nullable ErrorMessage var json = """{"DeploymentId":"dep-1","InstanceUniqueName":"inst-1","Status":2,"Timestamp":"2025-01-01T00:00:00+00:00"}"""; - var deserialized = JsonSerializer.Deserialize(json); + var deserialized = JsonSerializer.Deserialize(json); Assert.NotNull(deserialized); Assert.Equal("dep-1", deserialized!.DeploymentId); @@ -88,13 +88,13 @@ public class MessageConventionTests [Fact] public void JsonRoundTrip_SiteHealthReport_ShouldSucceed() { - var msg = new ScadaLink.Commons.Messages.Health.SiteHealthReport( + var msg = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Health.SiteHealthReport( "site-1", 1, DateTimeOffset.UtcNow, - new Dictionary + new Dictionary { - ["conn1"] = ScadaLink.Commons.Types.Enums.ConnectionHealth.Connected + ["conn1"] = ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.ConnectionHealth.Connected }, - new Dictionary + new Dictionary { ["conn1"] = new(10, 8) }, @@ -103,7 +103,7 @@ public class MessageConventionTests 0, 0, 0, 0); var json = JsonSerializer.Serialize(msg); - var deserialized = JsonSerializer.Deserialize(json); + var deserialized = JsonSerializer.Deserialize(json); Assert.NotNull(deserialized); Assert.Equal("site-1", deserialized!.SiteId); @@ -113,9 +113,9 @@ public class MessageConventionTests [Fact] public void JsonRoundTrip_DeployArtifactsCommand_ShouldSucceed() { - var msg = new ScadaLink.Commons.Messages.Artifacts.DeployArtifactsCommand( + var msg = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Artifacts.DeployArtifactsCommand( "dep-1", - new List + new List { new("script1", "code", null, null) }, @@ -123,7 +123,7 @@ public class MessageConventionTests DateTimeOffset.UtcNow); var json = JsonSerializer.Serialize(msg); - var deserialized = JsonSerializer.Deserialize(json); + var deserialized = JsonSerializer.Deserialize(json); Assert.NotNull(deserialized); Assert.Equal("dep-1", deserialized!.DeploymentId); diff --git a/tests/ScadaLink.Commons.Tests/Messages/NotificationMessagesTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/NotificationMessagesTests.cs similarity index 98% rename from tests/ScadaLink.Commons.Tests/Messages/NotificationMessagesTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/NotificationMessagesTests.cs index 2b6569cc..7bbb6c75 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/NotificationMessagesTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/NotificationMessagesTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications; -namespace ScadaLink.Commons.Tests.Messages; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages; /// /// Notification Outbox: construction and value-equality tests for the diff --git a/tests/ScadaLink.Commons.Tests/Messages/SiteCallQueriesTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/SiteCallQueriesTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Messages/SiteCallQueriesTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/SiteCallQueriesTests.cs index a702e14b..b278c449 100644 --- a/tests/ScadaLink.Commons.Tests/Messages/SiteCallQueriesTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Messages/SiteCallQueriesTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; -namespace ScadaLink.Commons.Tests.Messages; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Messages; /// /// Site Call Audit (#22): construction, value-equality and optionality tests diff --git a/tests/ScadaLink.Commons.Tests/Types/ApiKeyHasherTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ApiKeyHasherTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Types/ApiKeyHasherTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ApiKeyHasherTests.cs index a33456a9..9395ec52 100644 --- a/tests/ScadaLink.Commons.Tests/Types/ApiKeyHasherTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ApiKeyHasherTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// ConfigurationDatabase-012: the inbound-API bearer credential is stored as a diff --git a/tests/ScadaLink.Commons.Tests/Types/AuditQueryParamParsersTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/AuditQueryParamParsersTests.cs similarity index 94% rename from tests/ScadaLink.Commons.Tests/Types/AuditQueryParamParsersTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/AuditQueryParamParsersTests.cs index 3f8ad0c1..1438b045 100644 --- a/tests/ScadaLink.Commons.Tests/Types/AuditQueryParamParsersTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/AuditQueryParamParsersTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Audit Log #23 (M8): tests for the shared lax multi-value query-param parsers diff --git a/tests/ScadaLink.Commons.Tests/Types/DataConnections/OpcUaEndpointConfigSerializerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/DataConnections/OpcUaEndpointConfigSerializerTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Types/DataConnections/OpcUaEndpointConfigSerializerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/DataConnections/OpcUaEndpointConfigSerializerTests.cs index 34f258da..e400879f 100644 --- a/tests/ScadaLink.Commons.Tests/Types/DataConnections/OpcUaEndpointConfigSerializerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/DataConnections/OpcUaEndpointConfigSerializerTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Serialization; -using ScadaLink.Commons.Types.DataConnections; +using ZB.MOM.WW.ScadaBridge.Commons.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Types.DataConnections; -namespace ScadaLink.Commons.Tests.Types.DataConnections; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types.DataConnections; public class OpcUaEndpointConfigSerializerTests { @@ -120,13 +120,13 @@ public class OpcUaEndpointConfigSerializerTests // Real-world legacy producer emitted mixed JSON value types: // string for endpoint, number for publishInterval, etc. var legacyJson = """ - {"endpoint":"opc.tcp://scadalink-opcua:50000","securityMode":"None","publishInterval":1000,"AutoAcceptUntrustedCerts":false,"SessionTimeoutMs":45000} + {"endpoint":"opc.tcp://scadabridge-opcua:50000","securityMode":"None","publishInterval":1000,"AutoAcceptUntrustedCerts":false,"SessionTimeoutMs":45000} """; var (config, isLegacy) = OpcUaEndpointConfigSerializer.Deserialize(legacyJson); Assert.True(isLegacy); - Assert.Equal("opc.tcp://scadalink-opcua:50000", config.EndpointUrl); + Assert.Equal("opc.tcp://scadabridge-opcua:50000", config.EndpointUrl); Assert.Equal(OpcUaSecurityMode.None, config.SecurityMode); Assert.False(config.AutoAcceptUntrustedCerts); Assert.Equal(45000, config.SessionTimeoutMs); @@ -277,7 +277,7 @@ public class OpcUaEndpointConfigSerializerTests EndpointUrl = "opc.tcp://x:4840", DiscardOldest = false, SubscriptionPriority = 200, - SubscriptionDisplayName = "ScadaLink-Primary", + SubscriptionDisplayName = "ScadaBridge-Primary", TimestampsToReturn = OpcUaTimestampsToReturn.Both }; @@ -287,7 +287,7 @@ public class OpcUaEndpointConfigSerializerTests Assert.False(isLegacy); Assert.False(round.DiscardOldest); Assert.Equal((byte)200, round.SubscriptionPriority); - Assert.Equal("ScadaLink-Primary", round.SubscriptionDisplayName); + Assert.Equal("ScadaBridge-Primary", round.SubscriptionDisplayName); Assert.Equal(OpcUaTimestampsToReturn.Both, round.TimestampsToReturn); } @@ -364,14 +364,14 @@ public class OpcUaEndpointConfigSerializerTests EndpointUrl = "opc.tcp://x:4840", DiscardOldest = false, SubscriptionPriority = 50, - SubscriptionDisplayName = "ScadaLink-Edge", + SubscriptionDisplayName = "ScadaBridge-Edge", TimestampsToReturn = OpcUaTimestampsToReturn.Server }; var dict = OpcUaEndpointConfigSerializer.ToFlatDict(config); Assert.Equal("False", dict["DiscardOldest"]); Assert.Equal("50", dict["SubscriptionPriority"]); - Assert.Equal("ScadaLink-Edge", dict["SubscriptionDisplayName"]); + Assert.Equal("ScadaBridge-Edge", dict["SubscriptionDisplayName"]); Assert.Equal("Server", dict["TimestampsToReturn"]); } diff --git a/tests/ScadaLink.Commons.Tests/Types/DynamicJsonElementTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/DynamicJsonElementTests.cs similarity index 98% rename from tests/ScadaLink.Commons.Tests/Types/DynamicJsonElementTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/DynamicJsonElementTests.cs index cd500d22..4026f094 100644 --- a/tests/ScadaLink.Commons.Tests/Types/DynamicJsonElementTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/DynamicJsonElementTests.cs @@ -1,8 +1,8 @@ using System.Dynamic; using System.Text.Json; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Tests for , including the Commons-002 regression: diff --git a/tests/ScadaLink.Commons.Tests/Types/EnumTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/EnumTests.cs similarity index 95% rename from tests/ScadaLink.Commons.Tests/Types/EnumTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/EnumTests.cs index 6507f7dd..2db01f51 100644 --- a/tests/ScadaLink.Commons.Tests/Types/EnumTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/EnumTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; public class EnumTests { diff --git a/tests/ScadaLink.Commons.Tests/Types/Enums/AuditEnumTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Enums/AuditEnumTests.cs similarity index 95% rename from tests/ScadaLink.Commons.Tests/Types/Enums/AuditEnumTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Enums/AuditEnumTests.cs index c9470a27..a94ae3fa 100644 --- a/tests/ScadaLink.Commons.Tests/Types/Enums/AuditEnumTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Enums/AuditEnumTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Commons.Tests.Types.Enums; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types.Enums; /// /// Asserts the exact member sets of the Audit Log (#23) enums. diff --git a/tests/ScadaLink.Commons.Tests/Types/FlatteningAndScriptScopeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/FlatteningAndScriptScopeTests.cs similarity index 88% rename from tests/ScadaLink.Commons.Tests/Types/FlatteningAndScriptScopeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/FlatteningAndScriptScopeTests.cs index 4a9aca4b..911e9965 100644 --- a/tests/ScadaLink.Commons.Tests/Types/FlatteningAndScriptScopeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/FlatteningAndScriptScopeTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.Commons.Types.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Scripts; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Commons-010: coverage for the small computed-property logic on diff --git a/tests/ScadaLink.Commons.Tests/Types/ResultTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ResultTests.cs similarity index 95% rename from tests/ScadaLink.Commons.Tests/Types/ResultTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ResultTests.cs index c33f7d90..9d355ed9 100644 --- a/tests/ScadaLink.Commons.Tests/Types/ResultTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ResultTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; public class ResultTests { diff --git a/tests/ScadaLink.Commons.Tests/Types/RetryPolicyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/RetryPolicyTests.cs similarity index 90% rename from tests/ScadaLink.Commons.Tests/Types/RetryPolicyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/RetryPolicyTests.cs index 2c495ee6..10a89568 100644 --- a/tests/ScadaLink.Commons.Tests/Types/RetryPolicyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/RetryPolicyTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; public class RetryPolicyTests { diff --git a/tests/ScadaLink.Commons.Tests/Types/ScriptArgsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ScriptArgsTests.cs similarity index 95% rename from tests/ScadaLink.Commons.Tests/Types/ScriptArgsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ScriptArgsTests.cs index 2d742752..fd57969b 100644 --- a/tests/ScadaLink.Commons.Tests/Types/ScriptArgsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ScriptArgsTests.cs @@ -1,7 +1,7 @@ using System.Collections; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Commons-010: coverage for — the script-call diff --git a/tests/ScadaLink.Commons.Tests/Types/ScriptParametersTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ScriptParametersTests.cs similarity index 99% rename from tests/ScadaLink.Commons.Tests/Types/ScriptParametersTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ScriptParametersTests.cs index b25845d7..42897673 100644 --- a/tests/ScadaLink.Commons.Tests/Types/ScriptParametersTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ScriptParametersTests.cs @@ -1,7 +1,7 @@ using System.Text.Json; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; public class ScriptParametersTests { diff --git a/tests/ScadaLink.Commons.Tests/Types/SiteCallOperationalTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/SiteCallOperationalTests.cs similarity index 94% rename from tests/ScadaLink.Commons.Tests/Types/SiteCallOperationalTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/SiteCallOperationalTests.cs index 29d9eb42..e66804a9 100644 --- a/tests/ScadaLink.Commons.Tests/Types/SiteCallOperationalTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/SiteCallOperationalTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Verifies — the positional record carried on diff --git a/tests/ScadaLink.Commons.Tests/Types/SiteNotificationKpiSnapshotTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/SiteNotificationKpiSnapshotTests.cs similarity index 89% rename from tests/ScadaLink.Commons.Tests/Types/SiteNotificationKpiSnapshotTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/SiteNotificationKpiSnapshotTests.cs index 3e3550c5..2439b04f 100644 --- a/tests/ScadaLink.Commons.Tests/Types/SiteNotificationKpiSnapshotTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/SiteNotificationKpiSnapshotTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; public class SiteNotificationKpiSnapshotTests { diff --git a/tests/ScadaLink.Commons.Tests/Types/StaleTagMonitorRaceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/StaleTagMonitorRaceTests.cs similarity index 98% rename from tests/ScadaLink.Commons.Tests/Types/StaleTagMonitorRaceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/StaleTagMonitorRaceTests.cs index 89ef9f8a..2bcf3e33 100644 --- a/tests/ScadaLink.Commons.Tests/Types/StaleTagMonitorRaceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/StaleTagMonitorRaceTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Regression tests for Commons-001: the check-then-act race between the timer diff --git a/tests/ScadaLink.Commons.Tests/Types/StaleTagMonitorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/StaleTagMonitorTests.cs similarity index 97% rename from tests/ScadaLink.Commons.Tests/Types/StaleTagMonitorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/StaleTagMonitorTests.cs index 04e35ece..2ac7a171 100644 --- a/tests/ScadaLink.Commons.Tests/Types/StaleTagMonitorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/StaleTagMonitorTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; public class StaleTagMonitorTests { diff --git a/tests/ScadaLink.Commons.Tests/Types/TrackedOperationIdTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/TrackedOperationIdTests.cs similarity index 95% rename from tests/ScadaLink.Commons.Tests/Types/TrackedOperationIdTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/TrackedOperationIdTests.cs index 3e8822da..bf2a25c0 100644 --- a/tests/ScadaLink.Commons.Tests/Types/TrackedOperationIdTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/TrackedOperationIdTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Audit Log #23 (M3): tests for the strongly-typed cached-operation identifier diff --git a/tests/ScadaLink.Commons.Tests/Types/Transport/EncryptionMetadataTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/EncryptionMetadataTests.cs similarity index 97% rename from tests/ScadaLink.Commons.Tests/Types/Transport/EncryptionMetadataTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/EncryptionMetadataTests.cs index 61af1d27..20a5f90b 100644 --- a/tests/ScadaLink.Commons.Tests/Types/Transport/EncryptionMetadataTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/EncryptionMetadataTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Commons.Tests.Types.Transport; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types.Transport; /// /// Commons-015: must reject malformed envelopes at diff --git a/tests/ScadaLink.Commons.Tests/Types/Transport/TransportRecordsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/TransportRecordsTests.cs similarity index 97% rename from tests/ScadaLink.Commons.Tests/Types/Transport/TransportRecordsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/TransportRecordsTests.cs index b5c1033a..ba58da1f 100644 --- a/tests/ScadaLink.Commons.Tests/Types/Transport/TransportRecordsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/Transport/TransportRecordsTests.cs @@ -1,7 +1,7 @@ using System.Text.Json; -using ScadaLink.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; -namespace ScadaLink.Commons.Tests.Types.Transport; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types.Transport; /// /// Commons-020: focused shape / round-trip tests for the Transport (#24) record DTOs @@ -44,7 +44,7 @@ public sealed class TransportRecordsTests CreatedAtUtc: new DateTimeOffset(2026, 5, 28, 12, 0, 0, TimeSpan.Zero), SourceEnvironment: "cli", ExportedBy: "alice", - ScadaLinkVersion: "0.9.0", + ScadaBridgeVersion: "0.9.0", ContentHash: "sha256:deadbeef", Encryption: null, Summary: summary, @@ -54,7 +54,7 @@ public sealed class TransportRecordsTests Assert.Equal("1.0", manifest.SchemaVersion); Assert.Equal("cli", manifest.SourceEnvironment); Assert.Equal("alice", manifest.ExportedBy); - Assert.Equal("0.9.0", manifest.ScadaLinkVersion); + Assert.Equal("0.9.0", manifest.ScadaBridgeVersion); Assert.Equal("sha256:deadbeef", manifest.ContentHash); Assert.Null(manifest.Encryption); Assert.Equal(summary, manifest.Summary); @@ -78,7 +78,7 @@ public sealed class TransportRecordsTests CreatedAtUtc: new DateTimeOffset(2026, 5, 28, 12, 0, 0, TimeSpan.Zero), SourceEnvironment: "ui", ExportedBy: "bob", - ScadaLinkVersion: "0.9.0", + ScadaBridgeVersion: "0.9.0", ContentHash: "sha256:abc", Encryption: encryption, Summary: summary, diff --git a/tests/ScadaLink.Commons.Tests/Types/ValueFormatterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ValueFormatterTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Types/ValueFormatterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ValueFormatterTests.cs index 3ef74dcf..fa24a55c 100644 --- a/tests/ScadaLink.Commons.Tests/Types/ValueFormatterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Types/ValueFormatterTests.cs @@ -1,7 +1,7 @@ using System.Globalization; -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.Commons.Tests.Types; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Types; /// /// Tests for . Includes the Commons-012 regression: diff --git a/tests/ScadaLink.Commons.Tests/Validators/OpcUaEndpointConfigValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Validators/OpcUaEndpointConfigValidatorTests.cs similarity index 96% rename from tests/ScadaLink.Commons.Tests/Validators/OpcUaEndpointConfigValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Validators/OpcUaEndpointConfigValidatorTests.cs index 10ddcb07..86cc9df3 100644 --- a/tests/ScadaLink.Commons.Tests/Validators/OpcUaEndpointConfigValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/Validators/OpcUaEndpointConfigValidatorTests.cs @@ -1,8 +1,8 @@ -using ScadaLink.Commons.Types.DataConnections; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.Commons.Validators; +using ZB.MOM.WW.ScadaBridge.Commons.Types.DataConnections; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Validators; -namespace ScadaLink.Commons.Tests.Validators; +namespace ZB.MOM.WW.ScadaBridge.Commons.Tests.Validators; public class OpcUaEndpointConfigValidatorTests { diff --git a/tests/ScadaLink.Commons.Tests/ScadaLink.Commons.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ZB.MOM.WW.ScadaBridge.Commons.Tests.csproj similarity index 84% rename from tests/ScadaLink.Commons.Tests/ScadaLink.Commons.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ZB.MOM.WW.ScadaBridge.Commons.Tests.csproj index d7a9feb9..621db8e6 100644 --- a/tests/ScadaLink.Commons.Tests/ScadaLink.Commons.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.Commons.Tests/ZB.MOM.WW.ScadaBridge.Commons.Tests.csproj @@ -20,7 +20,7 @@ - + \ No newline at end of file diff --git a/tests/ScadaLink.Communication.Tests/AuditEventDtoMapperTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/AuditEventDtoMapperTests.cs similarity index 98% rename from tests/ScadaLink.Communication.Tests/AuditEventDtoMapperTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/AuditEventDtoMapperTests.cs index caf9e99f..8a61ee98 100644 --- a/tests/ScadaLink.Communication.Tests/AuditEventDtoMapperTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/AuditEventDtoMapperTests.cs @@ -1,9 +1,9 @@ using Google.Protobuf.WellKnownTypes; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Round-trip + edge tests for the that bridges diff --git a/tests/ScadaLink.Communication.Tests/CentralCommunicationActorAuditTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CentralCommunicationActorAuditTests.cs similarity index 93% rename from tests/ScadaLink.Communication.Tests/CentralCommunicationActorAuditTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CentralCommunicationActorAuditTests.cs index f004ec21..3767bea0 100644 --- a/tests/ScadaLink.Communication.Tests/CentralCommunicationActorAuditTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CentralCommunicationActorAuditTests.cs @@ -3,14 +3,14 @@ using Akka.TestKit; using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Tests for the Audit Log (#23) site→central ClusterClient ingest routing on diff --git a/tests/ScadaLink.Communication.Tests/CentralCommunicationActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CentralCommunicationActorTests.cs similarity index 93% rename from tests/ScadaLink.Communication.Tests/CentralCommunicationActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CentralCommunicationActorTests.cs index 82492861..90b557fe 100644 --- a/tests/ScadaLink.Communication.Tests/CentralCommunicationActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CentralCommunicationActorTests.cs @@ -4,18 +4,18 @@ using Akka.Cluster.Tools.Client; using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Communication; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.DebugView; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Communication.Actors; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DebugView; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; using Akka.TestKit; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Tests for CentralCommunicationActor with per-site ClusterClient routing. @@ -84,7 +84,7 @@ public class CentralCommunicationActorTests : TestKit [Fact] public void ClusterClientRouting_RoutesToConfiguredSite() { - var site = CreateSite("site1", "akka.tcp://scadalink@host:8082"); + var site = CreateSite("site1", "akka.tcp://scadabridge@host:8082"); var (actor, _, siteProbes) = CreateActorWithMockRepo(new[] { site }); // Wait for auto-refresh (PreStart schedules with TimeSpan.Zero initial delay) @@ -151,7 +151,7 @@ public class CentralCommunicationActorTests : TestKit [Fact] public void RefreshSiteAddresses_UpdatesCache() { - var site1 = CreateSite("site1", "akka.tcp://scadalink@host1:8082"); + var site1 = CreateSite("site1", "akka.tcp://scadabridge@host1:8082"); var (actor, mockRepo, siteProbes) = CreateActorWithMockRepo(new[] { site1 }); // Wait for initial load @@ -165,7 +165,7 @@ public class CentralCommunicationActorTests : TestKit Assert.Equal("dep1", ((DeployInstanceCommand)msg1.Message).DeploymentId); // Update mock repo to return both sites - var site2 = CreateSite("site2", "akka.tcp://scadalink@host2:8082"); + var site2 = CreateSite("site2", "akka.tcp://scadabridge@host2:8082"); mockRepo.GetAllSitesAsync(Arg.Any()) .Returns(new List { site1, site2 }); @@ -215,7 +215,7 @@ public class CentralCommunicationActorTests : TestKit // through, leaving the cache half-updated (some sites registered, others not). // The fix wraps the parse in a try/catch that logs and skips the bad site so // a single garbage row cannot starve every other site of its ClusterClient. - var goodSite = CreateSite("good-site", "akka.tcp://scadalink@host1:8082"); + var goodSite = CreateSite("good-site", "akka.tcp://scadabridge@host1:8082"); // A garbage address that ActorPath.Parse rejects. var badSite = CreateSite("bad-site", "this is not a valid actor path !!!"); @@ -308,8 +308,8 @@ public class CentralCommunicationActorTests : TestKit public void BothContactPoints_UsedInSingleClient() { var site = CreateSite("site1", - "akka.tcp://scadalink@host1:8082", - "akka.tcp://scadalink@host2:8082"); + "akka.tcp://scadabridge@host1:8082", + "akka.tcp://scadabridge@host2:8082"); var (actor, _, siteProbes, mockFactory) = CreateActorWithFactory(new[] { site }); diff --git a/tests/ScadaLink.Communication.Tests/CommunicationOptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CommunicationOptionsTests.cs similarity index 97% rename from tests/ScadaLink.Communication.Tests/CommunicationOptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CommunicationOptionsTests.cs index bee4ee59..08773331 100644 --- a/tests/ScadaLink.Communication.Tests/CommunicationOptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CommunicationOptionsTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// WP-2: Tests for per-pattern timeout configuration. diff --git a/tests/ScadaLink.Communication.Tests/CommunicationServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CommunicationServiceTests.cs similarity index 98% rename from tests/ScadaLink.Communication.Tests/CommunicationServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CommunicationServiceTests.cs index df093952..f6a2ae3d 100644 --- a/tests/ScadaLink.Communication.Tests/CommunicationServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CommunicationServiceTests.cs @@ -2,13 +2,13 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// WP-2: Tests for CommunicationService initialization and state. diff --git a/tests/ScadaLink.Communication.Tests/CoordinatorSupervisionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CoordinatorSupervisionTests.cs similarity index 95% rename from tests/ScadaLink.Communication.Tests/CoordinatorSupervisionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CoordinatorSupervisionTests.cs index 3c740719..8cec74f4 100644 --- a/tests/ScadaLink.Communication.Tests/CoordinatorSupervisionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/CoordinatorSupervisionTests.cs @@ -2,10 +2,10 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Regression tests for Communication-004 — coordinator actors must declare an diff --git a/tests/ScadaLink.Communication.Tests/DebugStreamServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/DebugStreamServiceTests.cs similarity index 90% rename from tests/ScadaLink.Communication.Tests/DebugStreamServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/DebugStreamServiceTests.cs index 1ddf2f98..f91b0377 100644 --- a/tests/ScadaLink.Communication.Tests/DebugStreamServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/DebugStreamServiceTests.cs @@ -4,14 +4,14 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Communication; -using ScadaLink.Communication.Actors; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Tests for DebugStreamService session lifecycle. diff --git a/tests/ScadaLink.Communication.Tests/Grpc/CleanupVerificationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/CleanupVerificationTests.cs similarity index 97% rename from tests/ScadaLink.Communication.Tests/Grpc/CleanupVerificationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/CleanupVerificationTests.cs index c665238b..ab28f93a 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/CleanupVerificationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/CleanupVerificationTests.cs @@ -3,9 +3,9 @@ using Akka.TestKit.Xunit2; using Grpc.Core; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; /// /// Verifies that after a gRPC stream is cancelled, the SiteStreamManager diff --git a/tests/ScadaLink.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs similarity index 98% rename from tests/ScadaLink.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs index b5fb06fe..00a0381a 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/DebugStreamBridgeActorTests.cs @@ -1,12 +1,12 @@ using Akka.Actor; using Akka.TestKit; using Akka.TestKit.Xunit2; -using ScadaLink.Commons.Messages.DebugView; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Communication.Actors; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DebugView; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; /// /// Tests for DebugStreamBridgeActor with gRPC streaming integration. diff --git a/tests/ScadaLink.Communication.Tests/Grpc/GrpcOptionsWiringTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/GrpcOptionsWiringTests.cs similarity index 93% rename from tests/ScadaLink.Communication.Tests/Grpc/GrpcOptionsWiringTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/GrpcOptionsWiringTests.cs index ce76421e..1420f272 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/GrpcOptionsWiringTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/GrpcOptionsWiringTests.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Communication; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; /// /// Regression tests for Communication-005 — the gRPC keepalive and diff --git a/tests/ScadaLink.Communication.Tests/Grpc/NoClusterClientStreamingRegressionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/NoClusterClientStreamingRegressionTests.cs similarity index 89% rename from tests/ScadaLink.Communication.Tests/Grpc/NoClusterClientStreamingRegressionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/NoClusterClientStreamingRegressionTests.cs index 28dcf333..63845413 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/NoClusterClientStreamingRegressionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/NoClusterClientStreamingRegressionTests.cs @@ -1,14 +1,14 @@ using System.Reflection; -using ScadaLink.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; /// /// Regression tests ensuring that the old ClusterClient-based debug streaming /// path is not reintroduced. Debug streaming now flows through gRPC. /// /// Note: The DebugStreamEvent type-does-not-exist check lives in -/// ScadaLink.Commons.Tests/ArchitecturalConstraintTests.cs and is not +/// ZB.MOM.WW.ScadaBridge.Commons.Tests/ArchitecturalConstraintTests.cs and is not /// duplicated here. /// public class NoClusterClientStreamingRegressionTests diff --git a/tests/ScadaLink.Communication.Tests/Grpc/ProtoContractTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoContractTests.cs similarity index 96% rename from tests/ScadaLink.Communication.Tests/Grpc/ProtoContractTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoContractTests.cs index 26bc7ebf..5dca8360 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/ProtoContractTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoContractTests.cs @@ -1,7 +1,7 @@ using Google.Protobuf.WellKnownTypes; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; /// /// Guardrail tests that verify all oneof variants in SiteStreamEvent have diff --git a/tests/ScadaLink.Communication.Tests/Grpc/ProtoRoundtripTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoRoundtripTests.cs similarity index 98% rename from tests/ScadaLink.Communication.Tests/Grpc/ProtoRoundtripTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoRoundtripTests.cs index 6df09c29..548726e8 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/ProtoRoundtripTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/ProtoRoundtripTests.cs @@ -1,8 +1,8 @@ using Google.Protobuf; using Google.Protobuf.WellKnownTypes; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; public class ProtoRoundtripTests { diff --git a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryDisposeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryDisposeTests.cs similarity index 97% rename from tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryDisposeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryDisposeTests.cs index 1f93ec8f..7446efd1 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryDisposeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryDisposeTests.cs @@ -1,8 +1,8 @@ using System.Collections.Concurrent; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; /// /// Regression tests for Communication-007 — the factory's synchronous diff --git a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs similarity index 97% rename from tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs index 4642935e..6ab28000 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientFactoryTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; public class SiteStreamGrpcClientFactoryTests { diff --git a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs similarity index 97% rename from tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs index 92739e6d..d7ae9b6f 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcClientTests.cs @@ -1,9 +1,9 @@ using Google.Protobuf.WellKnownTypes; -using ScadaLink.Communication.Grpc; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; public class SiteStreamGrpcClientTests { diff --git a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs similarity index 99% rename from tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs index 2f5e03a1..ffb4fe2b 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/SiteStreamGrpcServerTests.cs @@ -5,9 +5,9 @@ using Grpc.Core; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; public class SiteStreamGrpcServerTests : TestKit { diff --git a/tests/ScadaLink.Communication.Tests/Grpc/StreamRelayActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs similarity index 95% rename from tests/ScadaLink.Communication.Tests/Grpc/StreamRelayActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs index 546a5dac..3882684f 100644 --- a/tests/ScadaLink.Communication.Tests/Grpc/StreamRelayActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs @@ -2,13 +2,13 @@ using System.Threading.Channels; using Akka.Actor; using Akka.TestKit.Xunit2; using Google.Protobuf.WellKnownTypes; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication.Actors; -using ScadaLink.Communication.Grpc; -using AlarmState = ScadaLink.Commons.Types.Enums.AlarmState; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; +using AlarmState = ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.AlarmState; -namespace ScadaLink.Communication.Tests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Grpc; public class StreamRelayActorTests : TestKit { diff --git a/tests/ScadaLink.Communication.Tests/MessageContractTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/MessageContractTests.cs similarity index 95% rename from tests/ScadaLink.Communication.Tests/MessageContractTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/MessageContractTests.cs index 247d914f..a3ece8da 100644 --- a/tests/ScadaLink.Communication.Tests/MessageContractTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/MessageContractTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// WP-1: Tests that message contracts have correlation IDs and proper structure. diff --git a/tests/ScadaLink.Communication.Tests/Protos/AuditEventProtoTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/AuditEventProtoTests.cs similarity index 97% rename from tests/ScadaLink.Communication.Tests/Protos/AuditEventProtoTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/AuditEventProtoTests.cs index 632c8b50..0c53dafc 100644 --- a/tests/ScadaLink.Communication.Tests/Protos/AuditEventProtoTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/AuditEventProtoTests.cs @@ -1,8 +1,8 @@ using Google.Protobuf; using Google.Protobuf.WellKnownTypes; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Protos; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Protos; /// /// Wire-format round-trip tests for the Audit Log (#23) telemetry proto messages diff --git a/tests/ScadaLink.Communication.Tests/Protos/CachedTelemetryProtoTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/CachedTelemetryProtoTests.cs similarity index 98% rename from tests/ScadaLink.Communication.Tests/Protos/CachedTelemetryProtoTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/CachedTelemetryProtoTests.cs index 10d9e9bc..ae0e58d7 100644 --- a/tests/ScadaLink.Communication.Tests/Protos/CachedTelemetryProtoTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/CachedTelemetryProtoTests.cs @@ -1,8 +1,8 @@ using Google.Protobuf; using Google.Protobuf.WellKnownTypes; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Protos; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Protos; /// /// Wire-format round-trip tests for the Audit Log (#23) M3 cached-telemetry diff --git a/tests/ScadaLink.Communication.Tests/Protos/PullAuditEventsProtoTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/PullAuditEventsProtoTests.cs similarity index 96% rename from tests/ScadaLink.Communication.Tests/Protos/PullAuditEventsProtoTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/PullAuditEventsProtoTests.cs index ba9ae37d..9619cbb6 100644 --- a/tests/ScadaLink.Communication.Tests/Protos/PullAuditEventsProtoTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Protos/PullAuditEventsProtoTests.cs @@ -1,8 +1,8 @@ using Google.Protobuf; using Google.Protobuf.WellKnownTypes; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests.Protos; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests.Protos; /// /// Wire-format round-trip tests for the Audit Log (#23) M6 reconciliation diff --git a/tests/ScadaLink.Communication.Tests/SiteCallDtoMapperTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCallDtoMapperTests.cs similarity index 96% rename from tests/ScadaLink.Communication.Tests/SiteCallDtoMapperTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCallDtoMapperTests.cs index d9aa0bc7..e3a71dff 100644 --- a/tests/ScadaLink.Communication.Tests/SiteCallDtoMapperTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCallDtoMapperTests.cs @@ -1,13 +1,13 @@ using Google.Protobuf; using Google.Protobuf.WellKnownTypes; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Field-coverage + edge tests for the that /// decodes (proto) into the -/// persistence entity. +/// persistence entity. /// Only the DTO→entity direction exists — nothing in the system maps a /// SiteCall back onto the wire — so there is no round-trip test. /// IngestedAtUtc is a site-side placeholder the central ingest actor diff --git a/tests/ScadaLink.Communication.Tests/SiteCommunicationActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCommunicationActorTests.cs similarity index 96% rename from tests/ScadaLink.Communication.Tests/SiteCommunicationActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCommunicationActorTests.cs index caa6af0c..72e363ca 100644 --- a/tests/ScadaLink.Communication.Tests/SiteCommunicationActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCommunicationActorTests.cs @@ -1,15 +1,15 @@ using Akka.Actor; using Akka.Cluster.Tools.Client; using Akka.TestKit.Xunit2; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Messages.Lifecycle; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Messages.RemoteQuery; -using ScadaLink.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Lifecycle; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// WP-4: Tests for SiteCommunicationActor message routing to local actors. diff --git a/tests/ScadaLink.Communication.Tests/SiteStreamIngestAuditEventsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamIngestAuditEventsTests.cs similarity index 95% rename from tests/ScadaLink.Communication.Tests/SiteStreamIngestAuditEventsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamIngestAuditEventsTests.cs index df1f049d..c16f20fc 100644 --- a/tests/ScadaLink.Communication.Tests/SiteStreamIngestAuditEventsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamIngestAuditEventsTests.cs @@ -4,10 +4,10 @@ using Google.Protobuf.WellKnownTypes; using Grpc.Core; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Bundle D D2 tests for . diff --git a/tests/ScadaLink.Communication.Tests/SiteStreamIngestCachedTelemetryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamIngestCachedTelemetryTests.cs similarity index 96% rename from tests/ScadaLink.Communication.Tests/SiteStreamIngestCachedTelemetryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamIngestCachedTelemetryTests.cs index b5194a02..1ecbcb57 100644 --- a/tests/ScadaLink.Communication.Tests/SiteStreamIngestCachedTelemetryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamIngestCachedTelemetryTests.cs @@ -4,10 +4,10 @@ using Google.Protobuf.WellKnownTypes; using Grpc.Core; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Bundle D D2 tests for . diff --git a/tests/ScadaLink.Communication.Tests/SiteStreamPullAuditEventsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamPullAuditEventsTests.cs similarity index 96% rename from tests/ScadaLink.Communication.Tests/SiteStreamPullAuditEventsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamPullAuditEventsTests.cs index d9a6ac26..6626c5de 100644 --- a/tests/ScadaLink.Communication.Tests/SiteStreamPullAuditEventsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteStreamPullAuditEventsTests.cs @@ -4,12 +4,12 @@ using Grpc.Core; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.Communication.Tests; +namespace ZB.MOM.WW.ScadaBridge.Communication.Tests; /// /// Bundle A A2 tests for . diff --git a/tests/ScadaLink.Communication.Tests/ScadaLink.Communication.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ZB.MOM.WW.ScadaBridge.Communication.Tests.csproj similarity index 68% rename from tests/ScadaLink.Communication.Tests/ScadaLink.Communication.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ZB.MOM.WW.ScadaBridge.Communication.Tests.csproj index 68f3143d..1b62bdce 100644 --- a/tests/ScadaLink.Communication.Tests/ScadaLink.Communication.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/ZB.MOM.WW.ScadaBridge.Communication.Tests.csproj @@ -23,9 +23,9 @@ - - - + + + diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/AuditServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/AuditServiceTests.cs similarity index 91% rename from tests/ScadaLink.ConfigurationDatabase.Tests/AuditServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/AuditServiceTests.cs index c13e74b4..91d7f97f 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/AuditServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/AuditServiceTests.cs @@ -1,26 +1,26 @@ using System.Text.Json; using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class AuditServiceTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly AuditCorrelationContext _correlationContext; private readonly AuditService _auditService; public AuditServiceTests() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .Options; - _context = new ScadaLinkDbContext(options); + _context = new ScadaBridgeDbContext(options); _context.Database.OpenConnection(); _context.Database.EnsureCreated(); _correlationContext = new AuditCorrelationContext(); @@ -60,11 +60,11 @@ public class AuditServiceTests : IDisposable public async Task LogAsync_Rollback_BothChangeAndAuditRolledBack() { // Use a separate context to simulate rollback via not calling SaveChanges - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite(_context.Database.GetDbConnection()) .Options; - using var context2 = new ScadaLinkDbContext(options); + using var context2 = new ScadaBridgeDbContext(options); var auditService2 = new AuditService(context2, new AuditCorrelationContext()); var template = new Template("RollbackTemplate"); diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/ConcurrencyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ConcurrencyTests.cs similarity index 87% rename from tests/ScadaLink.ConfigurationDatabase.Tests/ConcurrencyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ConcurrencyTests.cs index 56ac4e51..2be9d353 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/ConcurrencyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ConcurrencyTests.cs @@ -1,23 +1,23 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; /// /// A test-specific DbContext that uses an explicit ConcurrencyToken on DeploymentRecord /// (as opposed to SQL Server's IsRowVersion()) so that SQLite can enforce concurrency. /// In production, the SQL Server RowVersion provides this automatically. /// -public class ConcurrencyTestDbContext : ScadaLinkDbContext +public class ConcurrencyTestDbContext : ScadaBridgeDbContext { - public ConcurrencyTestDbContext(DbContextOptions options) : base(options) { } + public ConcurrencyTestDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { @@ -44,9 +44,9 @@ public class ConcurrencyTestDbContext : ScadaLinkDbContext /// is sufficient to exercise the production stub-attach delete path under CD-017's /// concurrency rule. /// -public class RowVersionConcurrencyTestDbContext : ScadaLinkDbContext +public class RowVersionConcurrencyTestDbContext : ScadaBridgeDbContext { - public RowVersionConcurrencyTestDbContext(DbContextOptions options) : base(options) { } + public RowVersionConcurrencyTestDbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { @@ -68,7 +68,7 @@ public class ConcurrencyTests : IDisposable public ConcurrencyTests() { - _dbPath = Path.Combine(Path.GetTempPath(), $"scadalink_test_{Guid.NewGuid()}.db"); + _dbPath = Path.Combine(Path.GetTempPath(), $"scadabridge_test_{Guid.NewGuid()}.db"); } public void Dispose() @@ -77,9 +77,9 @@ public class ConcurrencyTests : IDisposable File.Delete(_dbPath); } - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite($"DataSource={_dbPath}") .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)) .Options; @@ -224,9 +224,9 @@ public class ConcurrencyTests : IDisposable () => repository.SaveChangesAsync()); } - private DbContextOptions BuildOptions() + private DbContextOptions BuildOptions() { - return new DbContextOptionsBuilder() + return new DbContextOptionsBuilder() .UseSqlite($"DataSource={_dbPath}") .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)) .Options; @@ -236,11 +236,11 @@ public class ConcurrencyTests : IDisposable public void DeploymentRecord_HasRowVersionConfigured() { // Verify the production configuration has a RowVersion shadow property - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .Options; - using var context = new ScadaLinkDbContext(options); + using var context = new ScadaBridgeDbContext(options); context.Database.OpenConnection(); context.Database.EnsureCreated(); diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs similarity index 96% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs index c14c67ef..599da48a 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/AuditLogEntityTypeConfigurationTests.cs @@ -1,10 +1,10 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Configurations; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Configurations; -namespace ScadaLink.ConfigurationDatabase.Tests.Configurations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Configurations; /// /// Schema-level tests for (#23 M1 Bundle B). @@ -15,7 +15,7 @@ namespace ScadaLink.ConfigurationDatabase.Tests.Configurations; /// public class AuditLogEntityTypeConfigurationTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; public AuditLogEntityTypeConfigurationTests() { diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/SiteCallEntityTypeConfigurationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/SiteCallEntityTypeConfigurationTests.cs similarity index 93% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/SiteCallEntityTypeConfigurationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/SiteCallEntityTypeConfigurationTests.cs index ed0720ba..cafa21fb 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Configurations/SiteCallEntityTypeConfigurationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Configurations/SiteCallEntityTypeConfigurationTests.cs @@ -1,9 +1,9 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Configurations; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Configurations; -namespace ScadaLink.ConfigurationDatabase.Tests.Configurations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Configurations; /// /// Schema-level tests for (#22 / #23 M3 Bundle B). @@ -15,7 +15,7 @@ namespace ScadaLink.ConfigurationDatabase.Tests.Configurations; /// public class SiteCallEntityTypeConfigurationTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; public SiteCallEntityTypeConfigurationTests() { diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/DataProtectionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/DataProtectionTests.cs similarity index 67% rename from tests/ScadaLink.ConfigurationDatabase.Tests/DataProtectionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/DataProtectionTests.cs index 46e54623..716a1b0d 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/DataProtectionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/DataProtectionTests.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.DataProtection; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class DataProtectionTests : IDisposable { @@ -11,7 +11,7 @@ public class DataProtectionTests : IDisposable public DataProtectionTests() { - _dbPath = Path.Combine(Path.GetTempPath(), $"scadalink_dp_test_{Guid.NewGuid()}.db"); + _dbPath = Path.Combine(Path.GetTempPath(), $"scadabridge_dp_test_{Guid.NewGuid()}.db"); } public void Dispose() @@ -26,20 +26,20 @@ public class DataProtectionTests : IDisposable var connectionString = $"DataSource={_dbPath}"; // Create the database schema - var setupOptions = new DbContextOptionsBuilder() + var setupOptions = new DbContextOptionsBuilder() .UseSqlite(connectionString) .Options; - using (var setupCtx = new ScadaLinkDbContext(setupOptions)) + using (var setupCtx = new ScadaBridgeDbContext(setupOptions)) { setupCtx.Database.EnsureCreated(); } // Container 1: protect some data var services1 = new ServiceCollection(); - services1.AddDbContext(opt => opt.UseSqlite(connectionString)); + services1.AddDbContext(opt => opt.UseSqlite(connectionString)); services1.AddDataProtection() - .SetApplicationName("ScadaLink") - .PersistKeysToDbContext(); + .SetApplicationName("ScadaBridge") + .PersistKeysToDbContext(); using var provider1 = services1.BuildServiceProvider(); var protector1 = provider1.GetRequiredService() @@ -48,10 +48,10 @@ public class DataProtectionTests : IDisposable // Container 2: unprotect using the same DB (shared keys) var services2 = new ServiceCollection(); - services2.AddDbContext(opt => opt.UseSqlite(connectionString)); + services2.AddDbContext(opt => opt.UseSqlite(connectionString)); services2.AddDataProtection() - .SetApplicationName("ScadaLink") - .PersistKeysToDbContext(); + .SetApplicationName("ScadaBridge") + .PersistKeysToDbContext(); using var provider2 = services2.BuildServiceProvider(); var protector2 = provider2.GetRequiredService() diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/DesignTimeDbContextFactoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/DesignTimeDbContextFactoryTests.cs similarity index 90% rename from tests/ScadaLink.ConfigurationDatabase.Tests/DesignTimeDbContextFactoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/DesignTimeDbContextFactoryTests.cs index 36c572f9..00bacb49 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/DesignTimeDbContextFactoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/DesignTimeDbContextFactoryTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class DesignTimeDbContextFactoryTests : IDisposable { @@ -39,7 +39,7 @@ public class DesignTimeDbContextFactoryTests : IDisposable // The design-time connection string may be supplied via an environment variable // rather than a source literal. Environment.SetEnvironmentVariable(EnvVar, - "Server=localhost,1433;Database=ScadaLink_Config;Trusted_Connection=True;TrustServerCertificate=True"); + "Server=localhost,1433;Database=ScadaBridge_Config;Trusted_Connection=True;TrustServerCertificate=True"); var factory = new DesignTimeDbContextFactory(); using var context = factory.CreateDbContext(Array.Empty()); diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/EphemeralEncryptionFallbackTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/EphemeralEncryptionFallbackTests.cs similarity index 84% rename from tests/ScadaLink.ConfigurationDatabase.Tests/EphemeralEncryptionFallbackTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/EphemeralEncryptionFallbackTests.cs index 519a51b8..9b10a52e 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/EphemeralEncryptionFallbackTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/EphemeralEncryptionFallbackTests.cs @@ -1,13 +1,13 @@ using Microsoft.AspNetCore.DataProtection; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; /// -/// Regression guard for ConfigurationDatabase-013: a +/// Regression guard for ConfigurationDatabase-013: a /// constructed without an explicit Data Protection provider (the single-argument /// constructor) must NOT silently encrypt secret columns with a throwaway ephemeral /// key — that would persist ciphertext that becomes permanently undecryptable on the @@ -16,8 +16,8 @@ namespace ScadaLink.ConfigurationDatabase.Tests; /// public class EphemeralEncryptionFallbackTests { - private static DbContextOptions SqliteOptions() => - new DbContextOptionsBuilder() + private static DbContextOptions SqliteOptions() => + new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)) .Options; @@ -27,7 +27,7 @@ public class EphemeralEncryptionFallbackTests { // Single-argument constructor: no Data Protection provider supplied (the // design-time / schema-only path). Schema creation must still succeed. - using var context = new ScadaLinkDbContext(SqliteOptions()); + using var context = new ScadaBridgeDbContext(SqliteOptions()); context.Database.OpenConnection(); context.Database.EnsureCreated(); @@ -49,7 +49,7 @@ public class EphemeralEncryptionFallbackTests { // The schema-only / no-provider context must remain fully usable for entities // that have no encrypted secret columns — only secret writes are gated. - using var context = new ScadaLinkDbContext(SqliteOptions()); + using var context = new ScadaBridgeDbContext(SqliteOptions()); context.Database.OpenConnection(); context.Database.EnsureCreated(); @@ -66,7 +66,7 @@ public class EphemeralEncryptionFallbackTests { // Sanity check: the gating must not regress the supported runtime path where a // real Data Protection provider is supplied. - using var context = new ScadaLinkDbContext(SqliteOptions(), new EphemeralDataProtectionProvider()); + using var context = new ScadaBridgeDbContext(SqliteOptions(), new EphemeralDataProtectionProvider()); context.Database.OpenConnection(); context.Database.EnsureCreated(); diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/InboundApiRepositoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/InboundApiRepositoryTests.cs similarity index 95% rename from tests/ScadaLink.ConfigurationDatabase.Tests/InboundApiRepositoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/InboundApiRepositoryTests.cs index d927e32f..8bb9dd97 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/InboundApiRepositoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/InboundApiRepositoryTests.cs @@ -1,14 +1,14 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class InboundApiRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly CapturingLogger _logger = new(); private readonly InboundApiRepository _repository; diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs similarity index 95% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs index 08dba1fe..52dddb78 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Maintenance/AuditLogPartitionMaintenanceTests.cs @@ -2,11 +2,11 @@ using System.Data.Common; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.ConfigurationDatabase.Maintenance; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Maintenance; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Maintenance; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Maintenance; /// /// Bundle D (#23 M6-T5) integration tests for @@ -32,11 +32,11 @@ public class AuditLogPartitionMaintenanceTests : IClassFixture - new(new DbContextOptionsBuilder() + private ScadaBridgeDbContext CreateContext() => + new(new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString).Options); - private AuditLogPartitionMaintenance NewMaintenance(ScadaLinkDbContext ctx) => + private AuditLogPartitionMaintenance NewMaintenance(ScadaBridgeDbContext ctx) => new(ctx, NullLogger.Instance); /// @@ -183,11 +183,11 @@ public class AuditLogPartitionMaintenanceTests : IClassFixture() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .AddInterceptors(interceptor) .Options; - await using var ctx = new ScadaLinkDbContext(options); + await using var ctx = new ScadaBridgeDbContext(options); var maintenance = NewMaintenance(ctx); await Assert.ThrowsAsync( diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddAuditLogSourceNodeMigrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddAuditLogSourceNodeMigrationTests.cs similarity index 98% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddAuditLogSourceNodeMigrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddAuditLogSourceNodeMigrationTests.cs index 3d07565d..04da5e80 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddAuditLogSourceNodeMigrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddAuditLogSourceNodeMigrationTests.cs @@ -1,6 +1,6 @@ using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Migrations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; /// /// SourceNode-stamping (#23) integration tests for the diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddAuditLogTableMigrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddAuditLogTableMigrationTests.cs similarity index 91% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddAuditLogTableMigrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddAuditLogTableMigrationTests.cs index 159690a0..f4c364a9 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddAuditLogTableMigrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddAuditLogTableMigrationTests.cs @@ -1,7 +1,7 @@ using Microsoft.Data.SqlClient; using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Migrations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; /// /// Bundle C (#23 M1) integration tests: applies the EF migrations to a @@ -115,7 +115,7 @@ public class AddAuditLogTableMigrationTests : IClassFixture( "SELECT COUNT(*) FROM sys.database_principals " + - "WHERE name = 'scadalink_audit_writer' AND type = 'R';"); + "WHERE name = 'scadabridge_audit_writer' AND type = 'R';"); Assert.Equal(1, roleExists); // GRANT INSERT + GRANT SELECT must be present (G state = grant). @@ -123,7 +123,7 @@ public class AddAuditLogTableMigrationTests : IClassFixture( "SELECT COUNT(*) FROM sys.database_principals " + - "WHERE name = 'scadalink_audit_purger' AND type = 'R';"); + "WHERE name = 'scadabridge_audit_purger' AND type = 'R';"); Assert.Equal(1, roleExists); // SELECT on AuditLog. @@ -169,7 +169,7 @@ public class AddAuditLogTableMigrationTests : IClassFixture /// Audit Log #23 (ExecutionId Task 5) integration test for the diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddNotificationOriginParentExecutionIdMigrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddNotificationOriginParentExecutionIdMigrationTests.cs similarity index 97% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddNotificationOriginParentExecutionIdMigrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddNotificationOriginParentExecutionIdMigrationTests.cs index 8a7e390f..5c4b3b2c 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddNotificationOriginParentExecutionIdMigrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddNotificationOriginParentExecutionIdMigrationTests.cs @@ -1,6 +1,6 @@ using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Migrations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; /// /// Audit Log ParentExecutionId integration test for the diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddNotificationSourceNodeMigrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddNotificationSourceNodeMigrationTests.cs similarity index 97% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddNotificationSourceNodeMigrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddNotificationSourceNodeMigrationTests.cs index 9dd2b0fc..31b4f931 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddNotificationSourceNodeMigrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddNotificationSourceNodeMigrationTests.cs @@ -1,6 +1,6 @@ using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Migrations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; /// /// SourceNode-stamping (#23) integration tests for the diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddSiteCallSourceNodeMigrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddSiteCallSourceNodeMigrationTests.cs similarity index 97% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddSiteCallSourceNodeMigrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddSiteCallSourceNodeMigrationTests.cs index 0505ef52..c9e771aa 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddSiteCallSourceNodeMigrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddSiteCallSourceNodeMigrationTests.cs @@ -1,6 +1,6 @@ using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Migrations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; /// /// SourceNode-stamping (#23) integration tests for the diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddSiteCallsTableMigrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddSiteCallsTableMigrationTests.cs similarity index 98% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddSiteCallsTableMigrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddSiteCallsTableMigrationTests.cs index ff60d188..43c17de6 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/AddSiteCallsTableMigrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/AddSiteCallsTableMigrationTests.cs @@ -1,7 +1,7 @@ using Microsoft.Data.SqlClient; using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Migrations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; /// /// Bundle B2 (#22, #23 M3) integration tests for the AddSiteCallsTable diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/MsSqlMigrationFixture.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/MsSqlMigrationFixture.cs similarity index 94% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/MsSqlMigrationFixture.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/MsSqlMigrationFixture.cs index e5906a06..f0722bbb 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Migrations/MsSqlMigrationFixture.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Migrations/MsSqlMigrationFixture.cs @@ -1,7 +1,7 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; -namespace ScadaLink.ConfigurationDatabase.Tests.Migrations; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; /// /// Per-test-class MSSQL fixture for the Bundle C integration tests (#23 M1). @@ -31,7 +31,7 @@ public sealed class MsSqlMigrationFixture : IDisposable // Connect Timeout=3 makes the fixture fail fast (~3s) in a no-container // environment rather than hanging on SqlClient's default 30s connect timeout. private const string DefaultAdminConnectionString = - "Server=localhost,1433;User Id=sa;Password=ScadaLink_Dev1#;TrustServerCertificate=true;Encrypt=false;Connect Timeout=3"; + "Server=localhost,1433;User Id=sa;Password=ScadaBridge_Dev1#;TrustServerCertificate=true;Encrypt=false;Connect Timeout=3"; private const string AdminEnvVar = "SCADALINK_MSSQL_TEST_CONN"; @@ -58,7 +58,7 @@ public sealed class MsSqlMigrationFixture : IDisposable { // Short, lowercase guid suffix keeps the database identifier under SQL Server's // 128-char limit and safe for raw concatenation (no quoting required). - DatabaseName = $"ScadaLinkAuditMigTest_{Guid.NewGuid():N}".Substring(0, 38); + DatabaseName = $"ScadaBridgeAuditMigTest_{Guid.NewGuid():N}".Substring(0, 38); // Env var lets CI / power users override the admin endpoint; absent // defaults to the local docker dev container's sa connection. @@ -148,18 +148,18 @@ public sealed class MsSqlMigrationFixture : IDisposable /// /// Applies the EF migrations to the per-fixture test database via a freshly - /// constructed pointed at it. Uses the + /// constructed pointed at it. Uses the /// schema-only single-argument constructor — the AuditLog migration does /// not write secret-bearing columns at apply time. Called once from the /// constructor; tests do not invoke this directly. /// private static async Task ApplyMigrationsCore(string connectionString, CancellationToken cancellationToken) { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(connectionString) .Options; - await using var context = new ScadaLinkDbContext(options); + await using var context = new ScadaBridgeDbContext(options); await context.Database.MigrateAsync(cancellationToken); } diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/NotificationOutboxRepositoryPerSiteKpiTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/NotificationOutboxRepositoryPerSiteKpiTests.cs similarity index 91% rename from tests/ScadaLink.ConfigurationDatabase.Tests/NotificationOutboxRepositoryPerSiteKpiTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/NotificationOutboxRepositoryPerSiteKpiTests.cs index f88b4b99..0b5442e7 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/NotificationOutboxRepositoryPerSiteKpiTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/NotificationOutboxRepositoryPerSiteKpiTests.cs @@ -1,16 +1,16 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; // Coverage for per-site KPI aggregation in the Notification Outbox repository // (Task 2 of the notifications-nav-group feature). public class NotificationOutboxRepositoryPerSiteKpiTests { - private static ScadaLinkDbContext NewContext() => SqliteTestHelper.CreateInMemoryContext(); + private static ScadaBridgeDbContext NewContext() => SqliteTestHelper.CreateInMemoryContext(); private static Notification NewNotification( string sourceSiteId, diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/AuditLogRepositoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/AuditLogRepositoryTests.cs similarity index 98% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/AuditLogRepositoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/AuditLogRepositoryTests.cs index ae1c72ad..1ae62b32 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/AuditLogRepositoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/AuditLogRepositoryTests.cs @@ -1,14 +1,14 @@ using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Repositories; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Repositories; /// /// Bundle D (#23 M1) integration tests for . Uses @@ -1059,7 +1059,7 @@ public class AuditLogRepositoryTests : IClassFixture await Assert.ThrowsAsync(() => call); } - private async Task ScalarAsync(ScadaLinkDbContext context, string sql) + private async Task ScalarAsync(ScadaBridgeDbContext context, string sql) { var conn = context.Database.GetDbConnection(); if (conn.State != System.Data.ConnectionState.Open) @@ -1078,12 +1078,12 @@ public class AuditLogRepositoryTests : IClassFixture // --- helpers ------------------------------------------------------------ - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static string NewSiteId() => diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs similarity index 89% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs index 44c09c02..93a483eb 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs @@ -1,12 +1,12 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Repositories; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Repositories; /// /// CD-015 race-fix integration tests for @@ -103,12 +103,12 @@ public class NotificationOutboxRepositoryIntegrationTests : IClassFixture() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static Notification MakeNotification( diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/SiteCallAuditRepositoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/SiteCallAuditRepositoryTests.cs similarity index 98% rename from tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/SiteCallAuditRepositoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/SiteCallAuditRepositoryTests.cs index 4e77af76..cef28b81 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/SiteCallAuditRepositoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/SiteCallAuditRepositoryTests.cs @@ -1,13 +1,13 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; using Xunit; -namespace ScadaLink.ConfigurationDatabase.Tests.Repositories; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Repositories; /// /// Bundle B3 (#22, #23 M3) integration tests for . @@ -499,12 +499,12 @@ public class SiteCallAuditRepositoryTests : IClassFixture // --- helpers ------------------------------------------------------------ - private ScadaLinkDbContext CreateContext() + private ScadaBridgeDbContext CreateContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static string NewSiteId() => diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/RepositoryCoverageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/RepositoryCoverageTests.cs similarity index 96% rename from tests/ScadaLink.ConfigurationDatabase.Tests/RepositoryCoverageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/RepositoryCoverageTests.cs index cf1b0711..8c08d030 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/RepositoryCoverageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/RepositoryCoverageTests.cs @@ -1,24 +1,24 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Notifications; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; // Regression coverage for ConfigurationDatabase-010 (repositories / InstanceLocator lacked // direct tests) and ConfigurationDatabase-011 (inconsistent constructor null-guarding). public class ExternalSystemRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly ExternalSystemRepository _repository; public ExternalSystemRepositoryTests() @@ -170,7 +170,7 @@ public class ExternalSystemRepositoryTests : IDisposable public class NotificationRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly NotificationRepository _repository; public NotificationRepositoryTests() @@ -246,7 +246,7 @@ public class NotificationRepositoryTests : IDisposable public class NotificationOutboxConfigurationTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; public NotificationOutboxConfigurationTests() { @@ -384,7 +384,7 @@ public class NotificationOutboxConfigurationTests : IDisposable // Coverage for the Notification Outbox repository (Task 5 of the notification-outbox feature). public class NotificationOutboxRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly NotificationOutboxRepository _repository; public NotificationOutboxRepositoryTests() @@ -420,7 +420,7 @@ public class NotificationOutboxRepositoryTests : IDisposable } // InsertIfNotExistsAsync coverage lives in - // tests/ScadaLink.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs + // tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/Repositories/NotificationOutboxRepositoryIntegrationTests.cs // — the method is raw-SQL (IF NOT EXISTS … INSERT) so it must execute against // SQL Server, not the SQLite in-memory provider this class uses. @@ -697,7 +697,7 @@ public class NotificationOutboxRepositoryTests : IDisposable public class SiteRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly SiteRepository _repository; public SiteRepositoryTests() @@ -785,7 +785,7 @@ public class SiteRepositoryTests : IDisposable public class DeploymentManagerRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly DeploymentManagerRepository _repository; public DeploymentManagerRepositoryTests() @@ -911,7 +911,7 @@ public class DeploymentManagerRepositoryTests : IDisposable public class InstanceLocatorTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly InstanceLocator _locator; public InstanceLocatorTests() diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/RepositoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/RepositoryTests.cs similarity index 95% rename from tests/ScadaLink.ConfigurationDatabase.Tests/RepositoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/RepositoryTests.cs index a8d25af1..ebf36fc4 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/RepositoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/RepositoryTests.cs @@ -1,29 +1,29 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Security; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class SecurityRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly SecurityRepository _repository; public SecurityRepositoryTests() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .Options; - _context = new ScadaLinkDbContext(options); + _context = new ScadaBridgeDbContext(options); _context.Database.OpenConnection(); _context.Database.EnsureCreated(); _repository = new SecurityRepository(_context); @@ -185,7 +185,7 @@ public class SecurityRepositoryTests : IDisposable public class CentralUiRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly CentralUiRepository _repository; public CentralUiRepositoryTests() diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/SchemaConfigurationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SchemaConfigurationTests.cs similarity index 88% rename from tests/ScadaLink.ConfigurationDatabase.Tests/SchemaConfigurationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SchemaConfigurationTests.cs index dc2a0b88..fe706928 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/SchemaConfigurationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SchemaConfigurationTests.cs @@ -1,16 +1,16 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class SchemaConfigurationTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; public SchemaConfigurationTests() { @@ -74,7 +74,7 @@ public class SchemaConfigurationTests : IDisposable public class SplitQueryBehaviourTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly TemplateEngineRepository _repository; public SplitQueryBehaviourTests() @@ -141,7 +141,7 @@ public class SplitQueryBehaviourTests : IDisposable [Fact] public void ApiKey_KeyHashColumn_IsMappedAndUniquelyIndexed() { - var entityType = _context.Model.FindEntityType(typeof(ScadaLink.Commons.Entities.InboundApi.ApiKey))!; + var entityType = _context.Model.FindEntityType(typeof(ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi.ApiKey))!; var keyHash = entityType.FindProperty("KeyHash"); Assert.NotNull(keyHash); @@ -156,7 +156,7 @@ public class SplitQueryBehaviourTests : IDisposable [Fact] public void ApiKey_HasNoPlaintextKeyValueColumn() { - var entityType = _context.Model.FindEntityType(typeof(ScadaLink.Commons.Entities.InboundApi.ApiKey))!; + var entityType = _context.Model.FindEntityType(typeof(ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi.ApiKey))!; Assert.Null(entityType.FindProperty("KeyValue")); } diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/SecretEncryptionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SecretEncryptionTests.cs similarity index 91% rename from tests/ScadaLink.ConfigurationDatabase.Tests/SecretEncryptionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SecretEncryptionTests.cs index 36d2ff7d..c51f34ea 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/SecretEncryptionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SecretEncryptionTests.cs @@ -1,11 +1,11 @@ using Microsoft.AspNetCore.DataProtection; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; /// /// Regression guard for ConfigurationDatabase-004: secret-bearing columns @@ -14,19 +14,19 @@ namespace ScadaLink.ConfigurationDatabase.Tests; /// public class SecretEncryptionTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly IDataProtectionProvider _protectionProvider; public SecretEncryptionTests() { _protectionProvider = new EphemeralDataProtectionProvider(); - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)) .Options; - _context = new ScadaLinkDbContext(options, _protectionProvider); + _context = new ScadaBridgeDbContext(options, _protectionProvider); _context.Database.OpenConnection(); _context.Database.EnsureCreated(); } diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/SeedDataTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SeedDataTests.cs similarity index 71% rename from tests/ScadaLink.ConfigurationDatabase.Tests/SeedDataTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SeedDataTests.cs index b1f6aa8e..9e563446 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/SeedDataTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SeedDataTests.cs @@ -1,19 +1,19 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class SeedDataTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; public SeedDataTests() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .Options; - _context = new ScadaLinkDbContext(options); + _context = new ScadaBridgeDbContext(options); _context.Database.OpenConnection(); _context.Database.EnsureCreated(); } diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/ServiceCollectionExtensionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ServiceCollectionExtensionsTests.cs similarity index 91% rename from tests/ScadaLink.ConfigurationDatabase.Tests/ServiceCollectionExtensionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ServiceCollectionExtensionsTests.cs index 11baf142..647fc147 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/ServiceCollectionExtensionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ServiceCollectionExtensionsTests.cs @@ -1,10 +1,10 @@ using System.Reflection; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class ServiceCollectionExtensionsTests { diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/SqliteTestHelper.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SqliteTestHelper.cs similarity index 84% rename from tests/ScadaLink.ConfigurationDatabase.Tests/SqliteTestHelper.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SqliteTestHelper.cs index 6c603285..deeaa3ff 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/SqliteTestHelper.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/SqliteTestHelper.cs @@ -2,10 +2,10 @@ using Microsoft.AspNetCore.DataProtection; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; /// /// Test DbContext that adapts SQL Server-specific features for SQLite: @@ -17,9 +17,9 @@ namespace ScadaLink.ConfigurationDatabase.Tests; /// throw on a secret-column write (ConfigurationDatabase-013); passing a provider here /// makes the test fixture's intent explicit at the call site. /// -public class SqliteTestDbContext : ScadaLinkDbContext +public class SqliteTestDbContext : ScadaBridgeDbContext { - public SqliteTestDbContext(DbContextOptions options) + public SqliteTestDbContext(DbContextOptions options) : base(options, new EphemeralDataProtectionProvider()) { } @@ -68,9 +68,9 @@ public class SqliteTestDbContext : ScadaLinkDbContext public static class SqliteTestHelper { - public static ScadaLinkDbContext CreateInMemoryContext() + public static ScadaBridgeDbContext CreateInMemoryContext() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)) .Options; @@ -81,9 +81,9 @@ public static class SqliteTestHelper return context; } - public static ScadaLinkDbContext CreateFileContext(string dbPath) + public static ScadaBridgeDbContext CreateFileContext(string dbPath) { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite($"DataSource={dbPath}") .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)) .Options; diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/TemplateEngineRepositoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/TemplateEngineRepositoryTests.cs similarity index 93% rename from tests/ScadaLink.ConfigurationDatabase.Tests/TemplateEngineRepositoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/TemplateEngineRepositoryTests.cs index 7a3923d9..7c8b634e 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/TemplateEngineRepositoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/TemplateEngineRepositoryTests.cs @@ -1,22 +1,22 @@ using Microsoft.EntityFrameworkCore; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class TemplateEngineRepositoryTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly TemplateEngineRepository _repository; public TemplateEngineRepositoryTests() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .Options; - _context = new ScadaLinkDbContext(options); + _context = new ScadaBridgeDbContext(options); _context.Database.OpenConnection(); _context.Database.EnsureCreated(); _repository = new TemplateEngineRepository(_context); diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/UnitTest1.cs b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/UnitTest1.cs similarity index 93% rename from tests/ScadaLink.ConfigurationDatabase.Tests/UnitTest1.cs rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/UnitTest1.cs index b4c2efaf..a8d8cc7b 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/UnitTest1.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/UnitTest1.cs @@ -1,23 +1,23 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Security; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.ConfigurationDatabase.Tests; +namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests; public class DbContextTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; public DbContextTests() { @@ -366,7 +366,7 @@ public class ServiceRegistrationTests services.AddConfigurationDatabase("DataSource=:memory:"); var provider = services.BuildServiceProvider(); - var context = provider.GetService(); + var context = provider.GetService(); Assert.NotNull(context); } @@ -395,18 +395,18 @@ public class ServiceRegistrationTests public class MigrationHelperTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; public MigrationHelperTests() { // Use SQLite with PendingModelChangesWarning suppressed because the migration // was generated for SQL Server and SQLite's model representation differs slightly. - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .ConfigureWarnings(w => w.Ignore(Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.PendingModelChangesWarning)) .Options; - _context = new ScadaLinkDbContext(options); + _context = new ScadaBridgeDbContext(options); _context.Database.OpenConnection(); } diff --git a/tests/ScadaLink.ConfigurationDatabase.Tests/ScadaLink.ConfigurationDatabase.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.csproj similarity index 87% rename from tests/ScadaLink.ConfigurationDatabase.Tests/ScadaLink.ConfigurationDatabase.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.csproj index 40997e30..7424533e 100644 --- a/tests/ScadaLink.ConfigurationDatabase.Tests/ScadaLink.ConfigurationDatabase.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests/ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.csproj @@ -40,8 +40,8 @@ - - + + diff --git a/tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionActorTests.cs similarity index 99% rename from tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionActorTests.cs index c0fee246..f97b5e90 100644 --- a/tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionActorTests.cs @@ -2,13 +2,13 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using NSubstitute; using NSubstitute.Core; -using ScadaLink.Commons.Interfaces.Protocol; -using ScadaLink.Commons.Messages.DataConnection; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.DataConnectionLayer.Actors; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DataConnection; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Actors; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.DataConnectionLayer.Tests; +namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests; /// /// WP-6: Tests for DataConnectionActor Become/Stash state machine. diff --git a/tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionFactoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionFactoryTests.cs similarity index 93% rename from tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionFactoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionFactoryTests.cs index 1c0496e5..d7a31039 100644 --- a/tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionFactoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionFactoryTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.DataConnectionLayer.Adapters; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Adapters; -namespace ScadaLink.DataConnectionLayer.Tests; +namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests; /// /// WP-34: Tests for protocol extensibility via DataConnectionFactory. diff --git a/tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionManagerActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionManagerActorTests.cs similarity index 94% rename from tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionManagerActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionManagerActorTests.cs index 3b1906e8..fa143dd9 100644 --- a/tests/ScadaLink.DataConnectionLayer.Tests/DataConnectionManagerActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/DataConnectionManagerActorTests.cs @@ -1,13 +1,13 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using NSubstitute; -using ScadaLink.Commons.Interfaces.Protocol; -using ScadaLink.Commons.Messages.DataConnection; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.DataConnectionLayer.Actors; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DataConnection; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Actors; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.DataConnectionLayer.Tests; +namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests; /// /// WP-34: Tests for DataConnectionManagerActor routing and lifecycle. diff --git a/tests/ScadaLink.DataConnectionLayer.Tests/OpcUaDataConnectionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/OpcUaDataConnectionTests.cs similarity index 98% rename from tests/ScadaLink.DataConnectionLayer.Tests/OpcUaDataConnectionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/OpcUaDataConnectionTests.cs index 077c491a..4e228698 100644 --- a/tests/ScadaLink.DataConnectionLayer.Tests/OpcUaDataConnectionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/OpcUaDataConnectionTests.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Interfaces.Protocol; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.DataConnectionLayer; -using ScadaLink.DataConnectionLayer.Adapters; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Adapters; -namespace ScadaLink.DataConnectionLayer.Tests; +namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests; /// /// DataConnectionLayer-003: structural regression guard. RealOpcUaClient's diff --git a/tests/ScadaLink.DataConnectionLayer.Tests/ScadaLink.DataConnectionLayer.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests.csproj similarity index 74% rename from tests/ScadaLink.DataConnectionLayer.Tests/ScadaLink.DataConnectionLayer.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests.csproj index 94b81a4b..c55f29ed 100644 --- a/tests/ScadaLink.DataConnectionLayer.Tests/ScadaLink.DataConnectionLayer.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests.csproj @@ -22,8 +22,8 @@ - - + + diff --git a/tests/ScadaLink.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs similarity index 97% rename from tests/ScadaLink.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs index 9ea812cf..47487b91 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ArtifactDeploymentServiceTests.cs @@ -5,14 +5,14 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Artifacts; -using ScadaLink.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Artifacts; +using ZB.MOM.WW.ScadaBridge.Communication; -namespace ScadaLink.DeploymentManager.Tests; +namespace ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests; /// /// WP-7: Tests for system-wide artifact deployment. diff --git a/tests/ScadaLink.DeploymentManager.Tests/DeploymentComparisonTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentComparisonTests.cs similarity index 95% rename from tests/ScadaLink.DeploymentManager.Tests/DeploymentComparisonTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentComparisonTests.cs index 12fe49bc..0e23b0b9 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/DeploymentComparisonTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentComparisonTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.DeploymentManager.Tests; +namespace ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests; /// /// WP-8: Tests for deployed vs template-derived state comparison. diff --git a/tests/ScadaLink.DeploymentManager.Tests/DeploymentServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentServiceTests.cs similarity index 98% rename from tests/ScadaLink.DeploymentManager.Tests/DeploymentServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentServiceTests.cs index a8f94c5c..edd31c8e 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/DeploymentServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentServiceTests.cs @@ -3,20 +3,20 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.Lifecycle; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.Communication; -using ScadaLink.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Lifecycle; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; -namespace ScadaLink.DeploymentManager.Tests; +namespace ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests; /// /// WP-1/2/4/5/6/8/16: Tests for central-side DeploymentService. diff --git a/tests/ScadaLink.DeploymentManager.Tests/DeploymentStatusNotifierTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentStatusNotifierTests.cs similarity index 90% rename from tests/ScadaLink.DeploymentManager.Tests/DeploymentStatusNotifierTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentStatusNotifierTests.cs index 3a1ee809..15edc7d4 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/DeploymentStatusNotifierTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/DeploymentStatusNotifierTests.cs @@ -2,18 +2,18 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.Communication; -using ScadaLink.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; -namespace ScadaLink.DeploymentManager.Tests; +namespace ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests; /// /// CentralUI-006: regression tests proving diff --git a/tests/ScadaLink.DeploymentManager.Tests/OperationLockManagerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/OperationLockManagerTests.cs similarity index 98% rename from tests/ScadaLink.DeploymentManager.Tests/OperationLockManagerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/OperationLockManagerTests.cs index 66dd36d9..6f909843 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/OperationLockManagerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/OperationLockManagerTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.DeploymentManager.Tests; +namespace ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests; /// /// WP-3: Tests for per-instance operation lock. diff --git a/tests/ScadaLink.DeploymentManager.Tests/ServiceCollectionExtensionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ServiceCollectionExtensionsTests.cs similarity index 87% rename from tests/ScadaLink.DeploymentManager.Tests/ServiceCollectionExtensionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ServiceCollectionExtensionsTests.cs index 6c0bf178..d9b06959 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/ServiceCollectionExtensionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ServiceCollectionExtensionsTests.cs @@ -2,11 +2,11 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -namespace ScadaLink.DeploymentManager.Tests; +namespace ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests; /// /// DeploymentManager-008: DeploymentManagerOptions must be resolvable via the -/// Options pattern and bindable to the "ScadaLink:DeploymentManager" +/// Options pattern and bindable to the "ScadaBridge:DeploymentManager" /// configuration section. The component itself does not depend on /// IConfiguration (enforced by Host's OptionsTests) — the Host binds the /// section; AddDeploymentManager only guarantees IOptions resolvability. @@ -34,8 +34,8 @@ public class ServiceCollectionExtensionsTests var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new Dictionary { - ["ScadaLink:DeploymentManager:OperationLockTimeout"] = "00:00:09", - ["ScadaLink:DeploymentManager:ArtifactDeploymentTimeoutPerSite"] = "00:03:00" + ["ScadaBridge:DeploymentManager:OperationLockTimeout"] = "00:00:09", + ["ScadaBridge:DeploymentManager:ArtifactDeploymentTimeoutPerSite"] = "00:03:00" }) .Build(); @@ -54,7 +54,7 @@ public class ServiceCollectionExtensionsTests [Fact] public void OptionsSection_MatchesTheConventionalComponentSectionPath() { - Assert.Equal("ScadaLink:DeploymentManager", ServiceCollectionExtensions.OptionsSection); + Assert.Equal("ScadaBridge:DeploymentManager", ServiceCollectionExtensions.OptionsSection); } // CentralUI-006: the deployment-status notifier must be a singleton so the diff --git a/tests/ScadaLink.DeploymentManager.Tests/StateTransitionValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/StateTransitionValidatorTests.cs similarity index 96% rename from tests/ScadaLink.DeploymentManager.Tests/StateTransitionValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/StateTransitionValidatorTests.cs index 9bb30dfe..b99bda2b 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/StateTransitionValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/StateTransitionValidatorTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.DeploymentManager.Tests; +namespace ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests; /// /// WP-4: Tests for instance state transition matrix. diff --git a/tests/ScadaLink.DeploymentManager.Tests/ScadaLink.DeploymentManager.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests.csproj similarity index 59% rename from tests/ScadaLink.DeploymentManager.Tests/ScadaLink.DeploymentManager.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests.csproj index 754f7cfe..89006e83 100644 --- a/tests/ScadaLink.DeploymentManager.Tests/ScadaLink.DeploymentManager.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests/ZB.MOM.WW.ScadaBridge.DeploymentManager.Tests.csproj @@ -22,10 +22,10 @@ - - - - + + + + diff --git a/tests/ScadaLink.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs similarity index 89% rename from tests/ScadaLink.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs index 25a463ee..a7388e67 100644 --- a/tests/ScadaLink.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/DatabaseGatewayTests.cs @@ -3,10 +3,10 @@ using System.Data.Common; using System.Text.Json; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; -namespace ScadaLink.ExternalSystemGateway.Tests; +namespace ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests; /// /// WP-9: Tests for Database access — connection resolution, cached writes. @@ -88,17 +88,17 @@ public class DatabaseGatewayTests var connStr = $"Data Source={dbName};Mode=Memory;Cache=Shared"; using var keepAlive = new Microsoft.Data.Sqlite.SqliteConnection(connStr); keepAlive.Open(); - var storage = new ScadaLink.StoreAndForward.StoreAndForwardStorage( - connStr, NullLogger.Instance); + var storage = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardStorage( + connStr, NullLogger.Instance); await storage.InitializeAsync(); - var sfOptions = new ScadaLink.StoreAndForward.StoreAndForwardOptions + var sfOptions = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardOptions { DefaultMaxRetries = 99, DefaultRetryInterval = TimeSpan.FromMinutes(10), RetryTimerInterval = TimeSpan.FromMinutes(10), }; - var sf = new ScadaLink.StoreAndForward.StoreAndForwardService( - storage, sfOptions, NullLogger.Instance); + var sf = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardService( + storage, sfOptions, NullLogger.Instance); var gateway = new DatabaseGateway(_repository, NullLogger.Instance, storeAndForward: sf); @@ -112,7 +112,7 @@ public class DatabaseGatewayTests executionId: executionId, sourceScript: sourceScript); var depth = await storage.GetBufferDepthByCategoryAsync(); - Assert.Equal(1, depth[ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.CachedDbWrite]); + Assert.Equal(1, depth[ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.CachedDbWrite]); var buffered = ReadBufferedRetrySettings(connStr); Assert.Equal(5, buffered.MaxRetries); @@ -145,17 +145,17 @@ public class DatabaseGatewayTests var connStr = $"Data Source={dbName};Mode=Memory;Cache=Shared"; using var keepAlive = new Microsoft.Data.Sqlite.SqliteConnection(connStr); keepAlive.Open(); - var storage = new ScadaLink.StoreAndForward.StoreAndForwardStorage( - connStr, NullLogger.Instance); + var storage = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardStorage( + connStr, NullLogger.Instance); await storage.InitializeAsync(); - var sfOptions = new ScadaLink.StoreAndForward.StoreAndForwardOptions + var sfOptions = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardOptions { DefaultMaxRetries = 99, DefaultRetryInterval = TimeSpan.FromMinutes(10), RetryTimerInterval = TimeSpan.FromMinutes(10), }; - var sf = new ScadaLink.StoreAndForward.StoreAndForwardService( - storage, sfOptions, NullLogger.Instance); + var sf = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardService( + storage, sfOptions, NullLogger.Instance); var gateway = new DatabaseGateway(_repository, NullLogger.Instance, storeAndForward: sf); @@ -194,10 +194,10 @@ public class DatabaseGatewayTests StubConnection(connection: null); var gateway = new DatabaseGateway(_repository, NullLogger.Instance); - var message = new ScadaLink.StoreAndForward.StoreAndForwardMessage + var message = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardMessage { Id = Guid.NewGuid().ToString("N"), - Category = ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.CachedDbWrite, + Category = ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.CachedDbWrite, Target = "gone-db", PayloadJson = """{"ConnectionName":"gone-db","Sql":"INSERT INTO t VALUES (1)","Parameters":null}""", @@ -219,10 +219,10 @@ public class DatabaseGatewayTests // retry the same poison row forever. var gateway = new DatabaseGateway(_repository, NullLogger.Instance); - var poisonMessage = new ScadaLink.StoreAndForward.StoreAndForwardMessage + var poisonMessage = new ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardMessage { Id = Guid.NewGuid().ToString("N"), - Category = ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.CachedDbWrite, + Category = ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.CachedDbWrite, Target = "someDb", // Truncated mid-write — `{` opens an object that never closes. PayloadJson = "{\"ConnectionName\":\"someDb\",\"Sql\":\"INSERT", diff --git a/tests/ScadaLink.ExternalSystemGateway.Tests/ErrorClassifierTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ErrorClassifierTests.cs similarity index 97% rename from tests/ScadaLink.ExternalSystemGateway.Tests/ErrorClassifierTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ErrorClassifierTests.cs index 3e0664f5..d61ce571 100644 --- a/tests/ScadaLink.ExternalSystemGateway.Tests/ErrorClassifierTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ErrorClassifierTests.cs @@ -1,6 +1,6 @@ using System.Net; -namespace ScadaLink.ExternalSystemGateway.Tests; +namespace ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests; /// /// WP-8: Tests for HTTP error classification. diff --git a/tests/ScadaLink.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs similarity index 98% rename from tests/ScadaLink.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs index d78833aa..24e36d27 100644 --- a/tests/ScadaLink.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ExternalSystemClientTests.cs @@ -4,11 +4,11 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.ExternalSystemGateway.Tests; +namespace ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests; /// /// WP-6/7: Tests for ExternalSystemClient — HTTP client, call modes, error handling. @@ -175,12 +175,12 @@ public class ExternalSystemClientTests // ── ExternalSystemGateway-001: buffered-call delivery handler ── - private static ScadaLink.StoreAndForward.StoreAndForwardMessage BufferedCall( + private static ZB.MOM.WW.ScadaBridge.StoreAndForward.StoreAndForwardMessage BufferedCall( string systemName, string methodName) => new() { Id = Guid.NewGuid().ToString("N"), - Category = ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, + Category = ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, Target = systemName, PayloadJson = $$"""{"SystemName":"{{systemName}}","MethodName":"{{methodName}}","Parameters":null}""", @@ -249,7 +249,7 @@ public class ExternalSystemClientTests var poisonMessage = new StoreAndForwardMessage { Id = Guid.NewGuid().ToString("N"), - Category = ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, + Category = ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, Target = "TestAPI", // Truncated mid-write — `{` opens an object that never closes. PayloadJson = "{\"SystemName\":\"TestAPI\",\"MethodName\":\"get", @@ -289,7 +289,7 @@ public class ExternalSystemClientTests var handlerInvocations = 0; sf.RegisterDeliveryHandler( - ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, + ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, _ => { Interlocked.Increment(ref handlerInvocations); return Task.FromResult(false); }); var client = new ExternalSystemClient( @@ -451,7 +451,7 @@ public class ExternalSystemClientTests Assert.True(result.WasBuffered); var depth = await storage.GetBufferDepthByCategoryAsync(); - Assert.Equal(1, depth[ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem]); + Assert.Equal(1, depth[ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem]); var buffered = ReadBufferedRetrySettings(connStr); Assert.Equal(7, buffered.MaxRetries); @@ -677,7 +677,7 @@ public class ExternalSystemClientTests var depth = await storage.GetBufferDepthByCategoryAsync(); Assert.False( - depth.TryGetValue(ScadaLink.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, out var n) && n > 0, + depth.TryGetValue(ZB.MOM.WW.ScadaBridge.Commons.Types.Enums.StoreAndForwardCategory.ExternalSystem, out var n) && n > 0, "A caller-cancelled CachedCall must not be buffered for retry"); } diff --git a/tests/ScadaLink.ExternalSystemGateway.Tests/ServiceWiringTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ServiceWiringTests.cs similarity index 93% rename from tests/ScadaLink.ExternalSystemGateway.Tests/ServiceWiringTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ServiceWiringTests.cs index 5fa06a0a..7d68c923 100644 --- a/tests/ScadaLink.ExternalSystemGateway.Tests/ServiceWiringTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ServiceWiringTests.cs @@ -2,9 +2,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Http; using NSubstitute; -using ScadaLink.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; -namespace ScadaLink.ExternalSystemGateway.Tests; +namespace ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests; /// /// ExternalSystemGateway-013: configuration options must actually influence the @@ -18,7 +18,7 @@ public class ServiceWiringTests var config = new ConfigurationBuilder() .AddInMemoryCollection(new Dictionary { - ["ScadaLink:ExternalSystemGateway:MaxConcurrentConnectionsPerSystem"] = "4", + ["ScadaBridge:ExternalSystemGateway:MaxConcurrentConnectionsPerSystem"] = "4", }) .Build(); @@ -51,7 +51,7 @@ public class ServiceWiringTests var config = new ConfigurationBuilder() .AddInMemoryCollection(new Dictionary { - ["ScadaLink:ExternalSystemGateway:MaxConcurrentConnectionsPerSystem"] = "4", + ["ScadaBridge:ExternalSystemGateway:MaxConcurrentConnectionsPerSystem"] = "4", }) .Build(); diff --git a/tests/ScadaLink.ExternalSystemGateway.Tests/ScadaLink.ExternalSystemGateway.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests.csproj similarity index 64% rename from tests/ScadaLink.ExternalSystemGateway.Tests/ScadaLink.ExternalSystemGateway.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests.csproj index ce9ca800..d2b57969 100644 --- a/tests/ScadaLink.ExternalSystemGateway.Tests/ScadaLink.ExternalSystemGateway.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests/ZB.MOM.WW.ScadaBridge.ExternalSystemGateway.Tests.csproj @@ -21,9 +21,9 @@ - - - + + + diff --git a/tests/ScadaLink.HealthMonitoring.Tests/AuditRedactionFailureMetricTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/AuditRedactionFailureMetricTests.cs similarity index 97% rename from tests/ScadaLink.HealthMonitoring.Tests/AuditRedactionFailureMetricTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/AuditRedactionFailureMetricTests.cs index 26185616..aaa48ab5 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/AuditRedactionFailureMetricTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/AuditRedactionFailureMetricTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; /// /// Bundle C (M5-T7) regression coverage. The Audit Log payload filter diff --git a/tests/ScadaLink.HealthMonitoring.Tests/CentralHealthAggregatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/CentralHealthAggregatorTests.cs similarity index 99% rename from tests/ScadaLink.HealthMonitoring.Tests/CentralHealthAggregatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/CentralHealthAggregatorTests.cs index 595371bc..b1b93e26 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/CentralHealthAggregatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/CentralHealthAggregatorTests.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; /// /// A simple fake TimeProvider for testing that allows advancing time manually. diff --git a/tests/ScadaLink.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs similarity index 99% rename from tests/ScadaLink.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs index a992fb9d..9d3cae53 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/CentralHealthReportLoopTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; /// /// HealthMonitoring-009 regression: the central self-report loop had no test diff --git a/tests/ScadaLink.HealthMonitoring.Tests/HealthMonitoringOptionsValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/HealthMonitoringOptionsValidatorTests.cs similarity index 97% rename from tests/ScadaLink.HealthMonitoring.Tests/HealthMonitoringOptionsValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/HealthMonitoringOptionsValidatorTests.cs index 45321883..089c9137 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/HealthMonitoringOptionsValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/HealthMonitoringOptionsValidatorTests.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Options; -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; /// /// HealthMonitoring-014 regression: intervals diff --git a/tests/ScadaLink.HealthMonitoring.Tests/HealthReportSenderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/HealthReportSenderTests.cs similarity index 98% rename from tests/ScadaLink.HealthMonitoring.Tests/HealthReportSenderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/HealthReportSenderTests.cs index 9276c0a5..fc8c26c0 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/HealthReportSenderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/HealthReportSenderTests.cs @@ -2,11 +2,11 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; public class HealthReportSenderTests { diff --git a/tests/ScadaLink.HealthMonitoring.Tests/SiteAuditBacklogMetricTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteAuditBacklogMetricTests.cs similarity index 96% rename from tests/ScadaLink.HealthMonitoring.Tests/SiteAuditBacklogMetricTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteAuditBacklogMetricTests.cs index a57f773d..e448eea3 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/SiteAuditBacklogMetricTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteAuditBacklogMetricTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types; -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; /// /// Bundle E (M6-T6) regression coverage. The site-side audit-log SQLite writer diff --git a/tests/ScadaLink.HealthMonitoring.Tests/SiteAuditWriteFailuresMetricTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteAuditWriteFailuresMetricTests.cs similarity index 97% rename from tests/ScadaLink.HealthMonitoring.Tests/SiteAuditWriteFailuresMetricTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteAuditWriteFailuresMetricTests.cs index 0fdb5336..f2ec8b2f 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/SiteAuditWriteFailuresMetricTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteAuditWriteFailuresMetricTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; /// /// Bundle G (M2-T11) regression coverage. The site-side Audit Log writer chain diff --git a/tests/ScadaLink.HealthMonitoring.Tests/SiteHealthCollectorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteHealthCollectorTests.cs similarity index 97% rename from tests/ScadaLink.HealthMonitoring.Tests/SiteHealthCollectorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteHealthCollectorTests.cs index 27eedb43..d4b0c2f9 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/SiteHealthCollectorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/SiteHealthCollectorTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.HealthMonitoring.Tests; +namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests; public class SiteHealthCollectorTests { @@ -163,7 +163,7 @@ public class SiteHealthCollectorTests [Fact] public void SetClusterNodes_ReflectedInReport() { - var nodes = new List + var nodes = new List { new("node-a", true, "Active"), new("node-b", true, "Standby") diff --git a/tests/ScadaLink.HealthMonitoring.Tests/ScadaLink.HealthMonitoring.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests.csproj similarity index 86% rename from tests/ScadaLink.HealthMonitoring.Tests/ScadaLink.HealthMonitoring.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests.csproj index da63b841..f3bf6d48 100644 --- a/tests/ScadaLink.HealthMonitoring.Tests/ScadaLink.HealthMonitoring.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests/ZB.MOM.WW.ScadaBridge.HealthMonitoring.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/tests/ScadaLink.Host.Tests/ActorPathTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ActorPathTests.cs similarity index 72% rename from tests/ScadaLink.Host.Tests/ActorPathTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ActorPathTests.cs index 0b52945b..18263df2 100644 --- a/tests/ScadaLink.Host.Tests/ActorPathTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ActorPathTests.cs @@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.Host; -using ScadaLink.Host.Actors; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Host; +using ZB.MOM.WW.ScadaBridge.Host.Actors; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; [CollectionDefinition("ActorSystem")] public class ActorSystemCollection : ICollectionFixture { } @@ -36,36 +36,36 @@ public class CentralActorPathTests : IAsyncLifetime { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:25510", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:25520", - ["ScadaLink:Cluster:MinNrOfMembers"] = "1", - ["ScadaLink:Database:SkipMigrations"] = "true", - ["ScadaLink:Security:JwtSigningKey"] = "test-signing-key-must-be-at-least-32-chars-long!", - ["ScadaLink:Security:LdapServer"] = "localhost", - ["ScadaLink:Security:LdapPort"] = "3893", - ["ScadaLink:Security:LdapUseTls"] = "false", - ["ScadaLink:Security:AllowInsecureLdap"] = "true", - ["ScadaLink:Security:LdapSearchBase"] = "dc=scadalink,dc=local", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:25510", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:25520", + ["ScadaBridge:Cluster:MinNrOfMembers"] = "1", + ["ScadaBridge:Database:SkipMigrations"] = "true", + ["ScadaBridge:Security:JwtSigningKey"] = "test-signing-key-must-be-at-least-32-chars-long!", + ["ScadaBridge:Security:LdapServer"] = "localhost", + ["ScadaBridge:Security:LdapPort"] = "3893", + ["ScadaBridge:Security:LdapUseTls"] = "false", + ["ScadaBridge:Security:AllowInsecureLdap"] = "true", + ["ScadaBridge:Security:LdapSearchBase"] = "dc=scadabridge,dc=local", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); builder.ConfigureServices(services => { // Replace SQL Server with in-memory database var descriptorsToRemove = services .Where(d => - d.ServiceType == typeof(DbContextOptions) || + d.ServiceType == typeof(DbContextOptions) || d.ServiceType == typeof(DbContextOptions) || - d.ServiceType == typeof(ScadaLinkDbContext) || + d.ServiceType == typeof(ScadaBridgeDbContext) || d.ServiceType.FullName?.Contains("EntityFrameworkCore") == true) .ToList(); foreach (var d in descriptorsToRemove) services.Remove(d); - services.AddDbContext(options => + services.AddDbContext(options => options.UseInMemoryDatabase($"ActorPathTests_{Guid.NewGuid()}")); }); }); @@ -128,7 +128,7 @@ public class SiteActorPathTests : IAsyncLifetime public async Task InitializeAsync() { - _tempDbPath = Path.Combine(Path.GetTempPath(), $"scadalink_actor_test_{Guid.NewGuid()}.db"); + _tempDbPath = Path.Combine(Path.GetTempPath(), $"scadabridge_actor_test_{Guid.NewGuid()}.db"); var builder = Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(); builder.ConfigureAppConfiguration(config => @@ -136,16 +136,16 @@ public class SiteActorPathTests : IAsyncLifetime config.Sources.Clear(); config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:Role"] = "Site", - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:SiteId"] = "TestSite", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:25510", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:25520", - ["ScadaLink:Cluster:MinNrOfMembers"] = "1", - ["ScadaLink:Database:SiteDbPath"] = _tempDbPath, + ["ScadaBridge:Node:Role"] = "Site", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:SiteId"] = "TestSite", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:25510", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:25520", + ["ScadaBridge:Cluster:MinNrOfMembers"] = "1", + ["ScadaBridge:Database:SiteDbPath"] = _tempDbPath, // Configure a dummy central contact point to trigger ClusterClient creation - ["ScadaLink:Communication:CentralContactPoints:0"] = "akka.tcp://scadalink@localhost:25510", + ["ScadaBridge:Communication:CentralContactPoints:0"] = "akka.tcp://scadabridge@localhost:25510", }); }); builder.ConfigureServices((context, services) => diff --git a/tests/ScadaLink.Host.Tests/AkkaBootstrapTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/AkkaBootstrapTests.cs similarity index 81% rename from tests/ScadaLink.Host.Tests/AkkaBootstrapTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/AkkaBootstrapTests.cs index 78df70c9..c9e8173f 100644 --- a/tests/ScadaLink.Host.Tests/AkkaBootstrapTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/AkkaBootstrapTests.cs @@ -1,7 +1,7 @@ using Akka.Actor; using Akka.Configuration; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// WP-13: Tests for Akka.NET actor system bootstrap. @@ -30,7 +30,7 @@ akka { } } cluster { - seed-nodes = [""akka.tcp://scadalink-test@localhost:0""] + seed-nodes = [""akka.tcp://scadabridge-test@localhost:0""] roles = [""Central""] min-nr-of-members = 1 } @@ -39,10 +39,10 @@ akka { } }"; var config = ConfigurationFactory.ParseString(hocon); - _actorSystem = ActorSystem.Create("scadalink-test", config); + _actorSystem = ActorSystem.Create("scadabridge-test", config); Assert.NotNull(_actorSystem); - Assert.Equal("scadalink-test", _actorSystem.Name); + Assert.Equal("scadabridge-test", _actorSystem.Name); } [Fact] @@ -60,7 +60,7 @@ akka { } } cluster { - seed-nodes = [""akka.tcp://scadalink-test@localhost:0""] + seed-nodes = [""akka.tcp://scadabridge-test@localhost:0""] roles = [""Central""] run-coordinated-shutdown-when-down = on } @@ -69,7 +69,7 @@ akka { } }"; var config = ConfigurationFactory.ParseString(hocon); - _actorSystem = ActorSystem.Create("scadalink-cs-test", config); + _actorSystem = ActorSystem.Create("scadabridge-cs-test", config); var csConfig = _actorSystem.Settings.Config.GetString("akka.coordinated-shutdown.run-by-clr-shutdown-hook"); Assert.Equal("on", csConfig); diff --git a/tests/ScadaLink.Host.Tests/AkkaHostedServiceAuditWiringTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/AkkaHostedServiceAuditWiringTests.cs similarity index 83% rename from tests/ScadaLink.Host.Tests/AkkaHostedServiceAuditWiringTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/AkkaHostedServiceAuditWiringTests.cs index e9d52a43..b4c5e815 100644 --- a/tests/ScadaLink.Host.Tests/AkkaHostedServiceAuditWiringTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/AkkaHostedServiceAuditWiringTests.cs @@ -6,17 +6,17 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.ClusterInfrastructure; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.Host; -using ScadaLink.Host.Actors; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.AuditLog; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.ClusterInfrastructure; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Host; +using ZB.MOM.WW.ScadaBridge.Host.Actors; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Bundle E (M2 Task E1) — verifies the Audit Log (#23) DI surface is wired @@ -51,7 +51,7 @@ public class AkkaHostedServiceAuditWiringHoconTests }; var clusterOptions = new ClusterOptions { - SeedNodes = new List { "akka.tcp://scadalink@localhost:2551" }, + SeedNodes = new List { "akka.tcp://scadabridge@localhost:2551" }, SplitBrainResolverStrategy = "keep-oldest", MinNrOfMembers = 1, StableAfter = TimeSpan.FromSeconds(15), @@ -102,35 +102,35 @@ public class CentralAuditWiringTests : IDisposable { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", - ["ScadaLink:Database:SkipMigrations"] = "true", - ["ScadaLink:Security:JwtSigningKey"] = "test-signing-key-must-be-at-least-32-chars-long!", - ["ScadaLink:Security:LdapServer"] = "localhost", - ["ScadaLink:Security:LdapPort"] = "3893", - ["ScadaLink:Security:LdapUseTls"] = "false", - ["ScadaLink:Security:AllowInsecureLdap"] = "true", - ["ScadaLink:Security:LdapSearchBase"] = "dc=scadalink,dc=local", - ["ScadaLink:InboundApi:ApiKeyPepper"] = "test-inbound-api-key-pepper-at-least-32-chars!", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", + ["ScadaBridge:Database:SkipMigrations"] = "true", + ["ScadaBridge:Security:JwtSigningKey"] = "test-signing-key-must-be-at-least-32-chars-long!", + ["ScadaBridge:Security:LdapServer"] = "localhost", + ["ScadaBridge:Security:LdapPort"] = "3893", + ["ScadaBridge:Security:LdapUseTls"] = "false", + ["ScadaBridge:Security:AllowInsecureLdap"] = "true", + ["ScadaBridge:Security:LdapSearchBase"] = "dc=scadabridge,dc=local", + ["ScadaBridge:InboundApi:ApiKeyPepper"] = "test-inbound-api-key-pepper-at-least-32-chars!", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); builder.ConfigureServices(services => { var descriptorsToRemove = services .Where(d => - d.ServiceType == typeof(DbContextOptions) || + d.ServiceType == typeof(DbContextOptions) || d.ServiceType == typeof(DbContextOptions) || - d.ServiceType == typeof(ScadaLinkDbContext) || + d.ServiceType == typeof(ScadaBridgeDbContext) || d.ServiceType.FullName?.Contains("EntityFrameworkCore") == true) .ToList(); foreach (var d in descriptorsToRemove) services.Remove(d); - services.AddDbContext(options => + services.AddDbContext(options => options.UseInMemoryDatabase($"CentralAuditWiringTests_{Guid.NewGuid()}")); AkkaHostedServiceRemover.RemoveAkkaHostedServiceOnly(services); @@ -162,7 +162,7 @@ public class CentralAuditWiringTests : IDisposable [Fact] public void Central_Resolves_AuditLogOptions() { - var opts = _factory.Services.GetService>(); + var opts = _factory.Services.GetService>(); Assert.NotNull(opts); Assert.NotNull(opts!.Value); } @@ -239,20 +239,20 @@ public class SiteAuditWiringTests : IDisposable public SiteAuditWiringTests() { - _tempDbPath = Path.Combine(Path.GetTempPath(), $"scadalink_audit_wiring_{Guid.NewGuid()}.db"); + _tempDbPath = Path.Combine(Path.GetTempPath(), $"scadabridge_audit_wiring_{Guid.NewGuid()}.db"); var builder = WebApplication.CreateBuilder(); builder.Configuration.Sources.Clear(); builder.Configuration.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:Role"] = "Site", - ["ScadaLink:Node:NodeHostname"] = "test-site", - ["ScadaLink:Node:SiteId"] = "TestSite", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Node:GrpcPort"] = "0", - ["ScadaLink:Database:SiteDbPath"] = _tempDbPath, - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", + ["ScadaBridge:Node:Role"] = "Site", + ["ScadaBridge:Node:NodeHostname"] = "test-site", + ["ScadaBridge:Node:SiteId"] = "TestSite", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Node:GrpcPort"] = "0", + ["ScadaBridge:Database:SiteDbPath"] = _tempDbPath, + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", // SqliteAuditWriter would attempt to open a SQLite file when first // resolved; point it at an in-memory connection so the test doesn't // pollute the working directory. @@ -260,7 +260,7 @@ public class SiteAuditWiringTests : IDisposable }); builder.Services.AddGrpc(); - builder.Services.AddSingleton(); + builder.Services.AddSingleton(); SiteServiceRegistration.Configure(builder.Services, builder.Configuration); AkkaHostedServiceRemover.RemoveAkkaHostedServiceOnly(builder.Services); diff --git a/tests/ScadaLink.Host.Tests/CentralDbTestEnvironment.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CentralDbTestEnvironment.cs similarity index 81% rename from tests/ScadaLink.Host.Tests/CentralDbTestEnvironment.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CentralDbTestEnvironment.cs index e79690c0..2ec1cf61 100644 --- a/tests/ScadaLink.Host.Tests/CentralDbTestEnvironment.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CentralDbTestEnvironment.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Host-003: appsettings.Central.json no longer commits database connection @@ -15,9 +15,9 @@ internal sealed class CentralDbTestEnvironment : IDisposable // Local dev/test database — same credentials the infra docker-compose stack uses. // This is a test fixture value, not a committed production secret. private const string ConfigurationDb = - "Server=localhost,1433;Database=ScadaLinkConfig;User Id=scadalink_app;Password=ScadaLink_Dev1#;TrustServerCertificate=true"; + "Server=localhost,1433;Database=ScadaBridgeConfig;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true"; - private const string ConfigKey = "ScadaLink__Database__ConfigurationDb"; + private const string ConfigKey = "ScadaBridge__Database__ConfigurationDb"; private readonly string? _previousConfig; diff --git a/tests/ScadaLink.Host.Tests/CompositionRootTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CompositionRootTests.cs similarity index 82% rename from tests/ScadaLink.Host.Tests/CompositionRootTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CompositionRootTests.cs index 1d4c6930..74d4390f 100644 --- a/tests/ScadaLink.Host.Tests/CompositionRootTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CompositionRootTests.cs @@ -6,36 +6,36 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; -using ScadaLink.ClusterInfrastructure; -using ScadaLink.Communication; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.DataConnectionLayer; -using ScadaLink.DeploymentManager; -using ScadaLink.ExternalSystemGateway; -using ScadaLink.HealthMonitoring; -using ScadaLink.Host; -using ScadaLink.Host.Actors; -using ScadaLink.Host.Health; -using ScadaLink.InboundAPI; -using ScadaLink.ManagementService; -using ScadaLink.NotificationService; -using ScadaLink.Security; -using ScadaLink.SiteEventLogging; -using ScadaLink.Communication.Grpc; -using ScadaLink.SiteRuntime; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Repositories; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.SiteRuntime.Streaming; -using ScadaLink.StoreAndForward; -using ScadaLink.TemplateEngine; -using ScadaLink.TemplateEngine.Flattening; -using ScadaLink.TemplateEngine.Services; -using ScadaLink.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.ClusterInfrastructure; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer; +using ZB.MOM.WW.ScadaBridge.DeploymentManager; +using ZB.MOM.WW.ScadaBridge.ExternalSystemGateway; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Host; +using ZB.MOM.WW.ScadaBridge.Host.Actors; +using ZB.MOM.WW.ScadaBridge.Host.Health; +using ZB.MOM.WW.ScadaBridge.InboundAPI; +using ZB.MOM.WW.ScadaBridge.ManagementService; +using ZB.MOM.WW.ScadaBridge.NotificationService; +using ZB.MOM.WW.ScadaBridge.Security; +using ZB.MOM.WW.ScadaBridge.SiteEventLogging; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.SiteRuntime; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Repositories; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Streaming; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.TemplateEngine; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Removes AkkaHostedService from running as a hosted service while keeping it @@ -96,40 +96,40 @@ public class CentralCompositionRootTests : IDisposable { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", - ["ScadaLink:Database:SkipMigrations"] = "true", - ["ScadaLink:Security:JwtSigningKey"] = "test-signing-key-must-be-at-least-32-chars-long!", - ["ScadaLink:Security:LdapServer"] = "localhost", - ["ScadaLink:Security:LdapPort"] = "3893", - ["ScadaLink:Security:LdapUseTls"] = "false", - ["ScadaLink:Security:AllowInsecureLdap"] = "true", - ["ScadaLink:Security:LdapSearchBase"] = "dc=scadalink,dc=local", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", + ["ScadaBridge:Database:SkipMigrations"] = "true", + ["ScadaBridge:Security:JwtSigningKey"] = "test-signing-key-must-be-at-least-32-chars-long!", + ["ScadaBridge:Security:LdapServer"] = "localhost", + ["ScadaBridge:Security:LdapPort"] = "3893", + ["ScadaBridge:Security:LdapUseTls"] = "false", + ["ScadaBridge:Security:AllowInsecureLdap"] = "true", + ["ScadaBridge:Security:LdapSearchBase"] = "dc=scadabridge,dc=local", // ConfigurationDatabase-012: inbound-API keys are hashed // with a server-side HMAC pepper; ApiKeyHasher fails fast // if it is missing or weak, so resolving ApiKeyValidator // requires a configured pepper. - ["ScadaLink:InboundApi:ApiKeyPepper"] = "test-inbound-api-key-pepper-at-least-32-chars!", + ["ScadaBridge:InboundApi:ApiKeyPepper"] = "test-inbound-api-key-pepper-at-least-32-chars!", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); builder.ConfigureServices(services => { // Replace SQL Server with in-memory database var descriptorsToRemove = services .Where(d => - d.ServiceType == typeof(DbContextOptions) || + d.ServiceType == typeof(DbContextOptions) || d.ServiceType == typeof(DbContextOptions) || - d.ServiceType == typeof(ScadaLinkDbContext) || + d.ServiceType == typeof(ScadaBridgeDbContext) || d.ServiceType.FullName?.Contains("EntityFrameworkCore") == true) .ToList(); foreach (var d in descriptorsToRemove) services.Remove(d); - services.AddDbContext(options => + services.AddDbContext(options => options.UseInMemoryDatabase($"CompositionRootTests_{Guid.NewGuid()}")); // Keep AkkaHostedService in DI (other services depend on it) @@ -213,7 +213,7 @@ public class CentralCompositionRootTests : IDisposable new object[] { typeof(Func) }, new object[] { typeof(OAuth2TokenService) }, // ConfigurationDatabase repositories - new object[] { typeof(ScadaLinkDbContext) }, + new object[] { typeof(ScadaBridgeDbContext) }, new object[] { typeof(ISecurityRepository) }, new object[] { typeof(ICentralUiRepository) }, new object[] { typeof(ITemplateEngineRepository) }, @@ -320,26 +320,26 @@ public class SiteCompositionRootTests : IDisposable public SiteCompositionRootTests() { - _tempDbPath = Path.Combine(Path.GetTempPath(), $"scadalink_test_{Guid.NewGuid()}.db"); + _tempDbPath = Path.Combine(Path.GetTempPath(), $"scadabridge_test_{Guid.NewGuid()}.db"); var builder = WebApplication.CreateBuilder(); builder.Configuration.Sources.Clear(); builder.Configuration.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:Role"] = "Site", - ["ScadaLink:Node:NodeHostname"] = "test-site", - ["ScadaLink:Node:SiteId"] = "TestSite", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Node:GrpcPort"] = "0", - ["ScadaLink:Database:SiteDbPath"] = _tempDbPath, + ["ScadaBridge:Node:Role"] = "Site", + ["ScadaBridge:Node:NodeHostname"] = "test-site", + ["ScadaBridge:Node:SiteId"] = "TestSite", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Node:GrpcPort"] = "0", + ["ScadaBridge:Database:SiteDbPath"] = _tempDbPath, // ClusterOptions requires at least one seed node (ClusterOptionsValidator). - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", }); // gRPC server registration (mirrors Program.cs site section) builder.Services.AddGrpc(); - builder.Services.AddSingleton(); + builder.Services.AddSingleton(); SiteServiceRegistration.Configure(builder.Services, builder.Configuration); diff --git a/tests/ScadaLink.Host.Tests/ConfigSecretsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ConfigSecretsTests.cs similarity index 87% rename from tests/ScadaLink.Host.Tests/ConfigSecretsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ConfigSecretsTests.cs index 4f34a022..d01249fa 100644 --- a/tests/ScadaLink.Host.Tests/ConfigSecretsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ConfigSecretsTests.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Text.Json; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Host-003 regression: secrets must not be committed in plaintext in the @@ -19,26 +19,26 @@ public class ConfigSecretsTests var dir = new DirectoryInfo(assemblyDir); while (dir != null) { - var hostPath = Path.Combine(dir.FullName, "src", "ScadaLink.Host"); + var hostPath = Path.Combine(dir.FullName, "src", "ZB.MOM.WW.ScadaBridge.Host"); if (Directory.Exists(hostPath)) return hostPath; dir = dir.Parent; } - throw new DirectoryNotFoundException("Could not locate src/ScadaLink.Host"); + throw new DirectoryNotFoundException("Could not locate src/ZB.MOM.WW.ScadaBridge.Host"); } - private static JsonElement ScadaLinkSection() + private static JsonElement ScadaBridgeSection() { var path = Path.Combine(FindHostProjectDirectory(), "appsettings.Central.json"); var json = File.ReadAllText(path); using var doc = JsonDocument.Parse(json); - return doc.RootElement.GetProperty("ScadaLink").Clone(); + return doc.RootElement.GetProperty("ScadaBridge").Clone(); } [Fact] public void CentralConfig_ConnectionStrings_ContainNoPlaintextPassword() { - var db = ScadaLinkSection().GetProperty("Database"); + var db = ScadaBridgeSection().GetProperty("Database"); foreach (var prop in db.EnumerateObject()) { var value = prop.Value.GetString() ?? string.Empty; @@ -61,7 +61,7 @@ public class ConfigSecretsTests [Fact] public void CentralConfig_LdapServiceAccountPassword_IsNotCommitted() { - var security = ScadaLinkSection().GetProperty("Security"); + var security = ScadaBridgeSection().GetProperty("Security"); if (security.TryGetProperty("LdapServiceAccountPassword", out var pw)) { var value = pw.GetString() ?? string.Empty; @@ -75,7 +75,7 @@ public class ConfigSecretsTests [Fact] public void CentralConfig_JwtSigningKey_IsNotCommitted() { - var security = ScadaLinkSection().GetProperty("Security"); + var security = ScadaBridgeSection().GetProperty("Security"); if (security.TryGetProperty("JwtSigningKey", out var key)) { var value = key.GetString() ?? string.Empty; diff --git a/tests/ScadaLink.Host.Tests/CoordinatedShutdownTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CoordinatedShutdownTests.cs similarity index 93% rename from tests/ScadaLink.Host.Tests/CoordinatedShutdownTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CoordinatedShutdownTests.cs index 9c696804..a6320bff 100644 --- a/tests/ScadaLink.Host.Tests/CoordinatedShutdownTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/CoordinatedShutdownTests.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// WP-16: Tests for CoordinatedShutdown configuration. @@ -49,7 +49,7 @@ public class CoordinatedShutdownTests while (dir != null) { - var hostPath = Path.Combine(dir.FullName, "src", "ScadaLink.Host"); + var hostPath = Path.Combine(dir.FullName, "src", "ZB.MOM.WW.ScadaBridge.Host"); if (Directory.Exists(hostPath)) return hostPath; dir = dir.Parent; diff --git a/tests/ScadaLink.Host.Tests/DeadLetterMonitorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/DeadLetterMonitorTests.cs similarity index 96% rename from tests/ScadaLink.Host.Tests/DeadLetterMonitorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/DeadLetterMonitorTests.cs index 9936b4c6..ae754e74 100644 --- a/tests/ScadaLink.Host.Tests/DeadLetterMonitorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/DeadLetterMonitorTests.cs @@ -3,9 +3,9 @@ using Akka.Event; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Host.Actors; +using ZB.MOM.WW.ScadaBridge.Host.Actors; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// WP-15: Tests for DeadLetterMonitorActor. diff --git a/tests/ScadaLink.Host.Tests/HealthCheckTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HealthCheckTests.cs similarity index 74% rename from tests/ScadaLink.Host.Tests/HealthCheckTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HealthCheckTests.cs index 11d32b8d..7f0cec38 100644 --- a/tests/ScadaLink.Host.Tests/HealthCheckTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HealthCheckTests.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.Configuration; -using ScadaLink.Host.Health; +using ZB.MOM.WW.ScadaBridge.Host.Health; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// WP-12: Tests for /health/ready and /health/active endpoints. @@ -40,15 +40,15 @@ public class HealthCheckTests : IDisposable { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", - ["ScadaLink:Database:SkipMigrations"] = "true", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", + ["ScadaBridge:Database:SkipMigrations"] = "true", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); }); _disposables.Add(factory); @@ -86,15 +86,15 @@ public class HealthCheckTests : IDisposable { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", - ["ScadaLink:Database:SkipMigrations"] = "true", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", + ["ScadaBridge:Database:SkipMigrations"] = "true", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); }); _disposables.Add(factory); @@ -136,15 +136,15 @@ public class HealthCheckTests : IDisposable { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", - ["ScadaLink:Database:SkipMigrations"] = "true", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", + ["ScadaBridge:Database:SkipMigrations"] = "true", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); }); _disposables.Add(factory); @@ -182,14 +182,14 @@ public class HealthCheckTests : IDisposable { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Database:SkipMigrations"] = "true", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Database:SkipMigrations"] = "true", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); }); _disposables.Add(factory); diff --git a/tests/ScadaLink.Host.Tests/HoconBuilderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HoconBuilderTests.cs similarity index 96% rename from tests/ScadaLink.Host.Tests/HoconBuilderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HoconBuilderTests.cs index ebb7b100..85ba2606 100644 --- a/tests/ScadaLink.Host.Tests/HoconBuilderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HoconBuilderTests.cs @@ -1,8 +1,8 @@ using Akka.Configuration; -using ScadaLink.ClusterInfrastructure; -using ScadaLink.Host.Actors; +using ZB.MOM.WW.ScadaBridge.ClusterInfrastructure; +using ZB.MOM.WW.ScadaBridge.Host.Actors; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Host-006: the Akka HOCON document must be assembled with every interpolated value @@ -16,8 +16,8 @@ public class HoconBuilderTests { SeedNodes = new List { - "akka.tcp://scadalink@localhost:8081", - "akka.tcp://scadalink@localhost:8082", + "akka.tcp://scadabridge@localhost:8081", + "akka.tcp://scadabridge@localhost:8082", }, SplitBrainResolverStrategy = "keep-oldest", MinNrOfMembers = 1, diff --git a/tests/ScadaLink.Host.Tests/HostStartupTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HostStartupTests.cs similarity index 77% rename from tests/ScadaLink.Host.Tests/HostStartupTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HostStartupTests.cs index 4a8b7415..d1286046 100644 --- a/tests/ScadaLink.Host.Tests/HostStartupTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/HostStartupTests.cs @@ -5,9 +5,9 @@ using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using ScadaLink.Host; +using ZB.MOM.WW.ScadaBridge.Host; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; public class HostStartupTests : IDisposable { @@ -41,15 +41,15 @@ public class HostStartupTests : IDisposable { config.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:NodeHostname"] = "localhost", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@localhost:2551", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@localhost:2552", - ["ScadaLink:Database:SkipMigrations"] = "true", + ["ScadaBridge:Node:NodeHostname"] = "localhost", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@localhost:2551", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@localhost:2552", + ["ScadaBridge:Database:SkipMigrations"] = "true", }); }); - builder.UseSetting("ScadaLink:Node:Role", "Central"); - builder.UseSetting("ScadaLink:Database:SkipMigrations", "true"); + builder.UseSetting("ScadaBridge:Node:Role", "Central"); + builder.UseSetting("ScadaBridge:Database:SkipMigrations", "true"); }); _disposables.Add(factory); @@ -73,15 +73,15 @@ public class HostStartupTests : IDisposable builder.Configuration.Sources.Clear(); builder.Configuration.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:Role"] = "Site", - ["ScadaLink:Node:NodeHostname"] = "test-site", - ["ScadaLink:Node:SiteId"] = "TestSite", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Node:GrpcPort"] = "0", + ["ScadaBridge:Node:Role"] = "Site", + ["ScadaBridge:Node:NodeHostname"] = "test-site", + ["ScadaBridge:Node:SiteId"] = "TestSite", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Node:GrpcPort"] = "0", }); builder.Services.AddGrpc(); - builder.Services.AddSingleton(); + builder.Services.AddSingleton(); SiteServiceRegistration.Configure(builder.Services, builder.Configuration); // Remove AkkaHostedService from running @@ -102,11 +102,11 @@ public class HostStartupTests : IDisposable builder.Configuration.Sources.Clear(); builder.Configuration.AddInMemoryCollection(new Dictionary { - ["ScadaLink:Node:Role"] = "Site", - ["ScadaLink:Node:NodeHostname"] = "test-site", - ["ScadaLink:Node:SiteId"] = "TestSite", - ["ScadaLink:Node:RemotingPort"] = "0", - ["ScadaLink:Node:GrpcPort"] = "0", + ["ScadaBridge:Node:Role"] = "Site", + ["ScadaBridge:Node:NodeHostname"] = "test-site", + ["ScadaBridge:Node:SiteId"] = "TestSite", + ["ScadaBridge:Node:RemotingPort"] = "0", + ["ScadaBridge:Node:GrpcPort"] = "0", }); builder.WebHost.ConfigureKestrel(options => @@ -118,7 +118,7 @@ public class HostStartupTests : IDisposable }); builder.Services.AddGrpc(); - builder.Services.AddSingleton(); + builder.Services.AddSingleton(); SiteServiceRegistration.Configure(builder.Services, builder.Configuration); // Remove AkkaHostedService from running @@ -169,7 +169,7 @@ public class HostStartupTests : IDisposable while (dir != null) { - var hostPath = Path.Combine(dir.FullName, "src", "ScadaLink.Host"); + var hostPath = Path.Combine(dir.FullName, "src", "ZB.MOM.WW.ScadaBridge.Host"); if (Directory.Exists(hostPath)) return hostPath; dir = dir.Parent; diff --git a/tests/ScadaLink.Host.Tests/LoggerConfigurationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/LoggerConfigurationTests.cs similarity index 88% rename from tests/ScadaLink.Host.Tests/LoggerConfigurationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/LoggerConfigurationTests.cs index f8327343..9e2a6df9 100644 --- a/tests/ScadaLink.Host.Tests/LoggerConfigurationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/LoggerConfigurationTests.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Configuration; using Serilog.Events; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// -/// Host-011: ScadaLink:Logging:MinimumLevel must actually drive the Serilog +/// Host-011: ScadaBridge:Logging:MinimumLevel must actually drive the Serilog /// minimum level. Previously the value was bound into /// but never read, so editing it had no effect. /// @@ -14,7 +14,7 @@ public class LoggerConfigurationTests { var values = new Dictionary(); if (minimumLevel != null) - values["ScadaLink:Logging:MinimumLevel"] = minimumLevel; + values["ScadaBridge:Logging:MinimumLevel"] = minimumLevel; return new ConfigurationBuilder().AddInMemoryCollection(values).Build(); } @@ -66,7 +66,7 @@ public class LoggerConfigurationTests } /// - /// Host-022: an unrecognised ScadaLink:Logging:MinimumLevel (e.g. a typo + /// Host-022: an unrecognised ScadaBridge:Logging:MinimumLevel (e.g. a typo /// like "Informaiton") must NOT abort startup but MUST emit a one-shot warning /// naming the offending value and the fallback so the silent coercion is /// visible. Null/blank is treated as "unset" and silently defaults. @@ -110,7 +110,7 @@ public class LoggerConfigurationTests } /// - /// Host-020: ScadaLink:Logging:MinimumLevel is the documented source + /// Host-020: ScadaBridge:Logging:MinimumLevel is the documented source /// of truth for the Serilog floor, and the explicit MinimumLevel.Is /// call deliberately runs after ReadFrom.Configuration(...) so a /// Serilog:MinimumLevel entry is overridden. To make that precedence @@ -126,7 +126,7 @@ public class LoggerConfigurationTests var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new Dictionary { - ["ScadaLink:Logging:MinimumLevel"] = "Warning", + ["ScadaBridge:Logging:MinimumLevel"] = "Warning", ["Serilog:MinimumLevel"] = "Debug", }) .Build(); @@ -136,25 +136,25 @@ public class LoggerConfigurationTests var warning = writer.ToString(); Assert.Contains("warning", warning, StringComparison.OrdinalIgnoreCase); Assert.Contains("Serilog:MinimumLevel", warning); - Assert.Contains("ScadaLink:Logging:MinimumLevel", warning); + Assert.Contains("ScadaBridge:Logging:MinimumLevel", warning); Assert.Contains("Debug", warning); Assert.Contains("Warning", warning); } [Fact] - public void Build_OnlyScadaLinkMinimumLevelSet_NoOverrideWarning() + public void Build_OnlyScadaBridgeMinimumLevelSet_NoOverrideWarning() { var writer = new StringWriter(); var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new Dictionary { - ["ScadaLink:Logging:MinimumLevel"] = "Warning", + ["ScadaBridge:Logging:MinimumLevel"] = "Warning", }) .Build(); LoggerConfigurationFactory.Build(configuration, "Central", "central", "node1", writer); - // No Serilog override -> no override-warning. (The ScadaLink value is + // No Serilog override -> no override-warning. (The ScadaBridge value is // a recognised level, so ParseLevel is silent too.) Assert.Empty(writer.ToString()); } diff --git a/tests/ScadaLink.Host.Tests/NodeIdentityProviderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/NodeIdentityProviderTests.cs similarity index 92% rename from tests/ScadaLink.Host.Tests/NodeIdentityProviderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/NodeIdentityProviderTests.cs index c7322a25..563cc6ad 100644 --- a/tests/ScadaLink.Host.Tests/NodeIdentityProviderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/NodeIdentityProviderTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Options; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Tests for NodeIdentityProvider — surfaces the operator-configured semantic diff --git a/tests/ScadaLink.Host.Tests/OptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/OptionsTests.cs similarity index 98% rename from tests/ScadaLink.Host.Tests/OptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/OptionsTests.cs index 89b70f54..bb17ba74 100644 --- a/tests/ScadaLink.Host.Tests/OptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/OptionsTests.cs @@ -1,7 +1,7 @@ using System.Reflection; using Microsoft.Extensions.Configuration; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; public class OptionsTests { diff --git a/tests/ScadaLink.Host.Tests/SerilogSinkConfigTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/SerilogSinkConfigTests.cs similarity index 92% rename from tests/ScadaLink.Host.Tests/SerilogSinkConfigTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/SerilogSinkConfigTests.cs index 7a08d276..7c88fbca 100644 --- a/tests/ScadaLink.Host.Tests/SerilogSinkConfigTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/SerilogSinkConfigTests.cs @@ -2,7 +2,7 @@ using System.Reflection; using System.Text.Json; using Microsoft.Extensions.Configuration; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Host-014 regression: REQ-HOST-8 requires the Host's Serilog sinks @@ -20,12 +20,12 @@ public class SerilogSinkConfigTests var dir = new DirectoryInfo(assemblyDir); while (dir != null) { - var hostPath = Path.Combine(dir.FullName, "src", "ScadaLink.Host"); + var hostPath = Path.Combine(dir.FullName, "src", "ZB.MOM.WW.ScadaBridge.Host"); if (Directory.Exists(hostPath)) return hostPath; dir = dir.Parent; } - throw new DirectoryNotFoundException("Could not locate src/ScadaLink.Host"); + throw new DirectoryNotFoundException("Could not locate src/ZB.MOM.WW.ScadaBridge.Host"); } [Fact] @@ -56,7 +56,7 @@ public class SerilogSinkConfigTests { // A `Serilog` section in configuration must actually reach the built logger // via ReadFrom.Configuration — proving the sink set is configuration-driven. - var logDir = Path.Combine(Path.GetTempPath(), "scadalink-host014-" + Guid.NewGuid().ToString("N")); + var logDir = Path.Combine(Path.GetTempPath(), "scadabridge-host014-" + Guid.NewGuid().ToString("N")); var logPath = Path.Combine(logDir, "test-.log"); try { diff --git a/tests/ScadaLink.Host.Tests/SerilogTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/SerilogTests.cs similarity index 98% rename from tests/ScadaLink.Host.Tests/SerilogTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/SerilogTests.cs index f24a0fad..9b660368 100644 --- a/tests/ScadaLink.Host.Tests/SerilogTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/SerilogTests.cs @@ -1,7 +1,7 @@ using Serilog; using Serilog.Events; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// WP-14: Tests for Serilog structured logging with enriched properties. diff --git a/tests/ScadaLink.Host.Tests/StartupRetryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/StartupRetryTests.cs similarity index 98% rename from tests/ScadaLink.Host.Tests/StartupRetryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/StartupRetryTests.cs index e164c096..caca7db2 100644 --- a/tests/ScadaLink.Host.Tests/StartupRetryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/StartupRetryTests.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Logging.Abstractions; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// Host-010: startup preconditions (database migration) must tolerate a database diff --git a/tests/ScadaLink.Host.Tests/StartupValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/StartupValidatorTests.cs similarity index 78% rename from tests/ScadaLink.Host.Tests/StartupValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/StartupValidatorTests.cs index d2f0eddf..f6e77d16 100644 --- a/tests/ScadaLink.Host.Tests/StartupValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/StartupValidatorTests.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Configuration; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// WP-11: Tests for StartupValidator configuration validation. @@ -16,25 +16,25 @@ public class StartupValidatorTests private static Dictionary ValidCentralConfig() => new() { - ["ScadaLink:Node:Role"] = "Central", - ["ScadaLink:Node:NodeHostname"] = "central-node1", - ["ScadaLink:Node:RemotingPort"] = "8081", - ["ScadaLink:Database:ConfigurationDb"] = "Server=localhost;Database=Config;", - ["ScadaLink:Security:LdapServer"] = "ldap.example.com", - ["ScadaLink:Security:JwtSigningKey"] = "test-signing-key-at-least-32-chars-long", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@central-node1:8081", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@central-node2:8081", + ["ScadaBridge:Node:Role"] = "Central", + ["ScadaBridge:Node:NodeHostname"] = "central-node1", + ["ScadaBridge:Node:RemotingPort"] = "8081", + ["ScadaBridge:Database:ConfigurationDb"] = "Server=localhost;Database=Config;", + ["ScadaBridge:Security:LdapServer"] = "ldap.example.com", + ["ScadaBridge:Security:JwtSigningKey"] = "test-signing-key-at-least-32-chars-long", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@central-node1:8081", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@central-node2:8081", }; private static Dictionary ValidSiteConfig() => new() { - ["ScadaLink:Node:Role"] = "Site", - ["ScadaLink:Node:NodeHostname"] = "site-a-node1", - ["ScadaLink:Node:SiteId"] = "SiteA", - ["ScadaLink:Node:RemotingPort"] = "8082", - ["ScadaLink:Database:SiteDbPath"] = "./data/scadalink.db", - ["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@site-a-node1:8082", - ["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@site-a-node2:8082", + ["ScadaBridge:Node:Role"] = "Site", + ["ScadaBridge:Node:NodeHostname"] = "site-a-node1", + ["ScadaBridge:Node:SiteId"] = "SiteA", + ["ScadaBridge:Node:RemotingPort"] = "8082", + ["ScadaBridge:Database:SiteDbPath"] = "./data/scadabridge.db", + ["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@site-a-node1:8082", + ["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@site-a-node2:8082", }; [Fact] @@ -57,7 +57,7 @@ public class StartupValidatorTests public void MissingRole_FailsValidation() { var values = ValidCentralConfig(); - values.Remove("ScadaLink:Node:Role"); + values.Remove("ScadaBridge:Node:Role"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -68,7 +68,7 @@ public class StartupValidatorTests public void InvalidRole_FailsValidation() { var values = ValidCentralConfig(); - values["ScadaLink:Node:Role"] = "Unknown"; + values["ScadaBridge:Node:Role"] = "Unknown"; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -79,7 +79,7 @@ public class StartupValidatorTests public void EmptyHostname_FailsValidation() { var values = ValidCentralConfig(); - values["ScadaLink:Node:NodeHostname"] = ""; + values["ScadaBridge:Node:NodeHostname"] = ""; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -90,7 +90,7 @@ public class StartupValidatorTests public void MissingHostname_FailsValidation() { var values = ValidCentralConfig(); - values.Remove("ScadaLink:Node:NodeHostname"); + values.Remove("ScadaBridge:Node:NodeHostname"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -106,7 +106,7 @@ public class StartupValidatorTests public void InvalidPort_FailsValidation(string port) { var values = ValidCentralConfig(); - values["ScadaLink:Node:RemotingPort"] = port; + values["ScadaBridge:Node:RemotingPort"] = port; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -120,7 +120,7 @@ public class StartupValidatorTests public void ValidPort_PassesValidation(string port) { var values = ValidCentralConfig(); - values["ScadaLink:Node:RemotingPort"] = port; + values["ScadaBridge:Node:RemotingPort"] = port; var config = BuildConfig(values); var ex = Record.Exception(() => StartupValidator.Validate(config)); @@ -131,7 +131,7 @@ public class StartupValidatorTests public void Site_MissingSiteId_FailsValidation() { var values = ValidSiteConfig(); - values.Remove("ScadaLink:Node:SiteId"); + values.Remove("ScadaBridge:Node:SiteId"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -142,7 +142,7 @@ public class StartupValidatorTests public void Central_MissingConfigurationDb_FailsValidation() { var values = ValidCentralConfig(); - values.Remove("ScadaLink:Database:ConfigurationDb"); + values.Remove("ScadaBridge:Database:ConfigurationDb"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -156,7 +156,7 @@ public class StartupValidatorTests // system (only ConfigurationDb is wired into AddConfigurationDatabase). // It is no longer a required key, so its absence must not fail startup. var values = ValidCentralConfig(); - values.Remove("ScadaLink:Database:MachineDataDb"); + values.Remove("ScadaBridge:Database:MachineDataDb"); var config = BuildConfig(values); var ex = Record.Exception(() => StartupValidator.Validate(config)); @@ -167,7 +167,7 @@ public class StartupValidatorTests public void Central_MissingLdapServer_FailsValidation() { var values = ValidCentralConfig(); - values.Remove("ScadaLink:Security:LdapServer"); + values.Remove("ScadaBridge:Security:LdapServer"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -178,7 +178,7 @@ public class StartupValidatorTests public void Central_MissingJwtSigningKey_FailsValidation() { var values = ValidCentralConfig(); - values.Remove("ScadaLink:Security:JwtSigningKey"); + values.Remove("ScadaBridge:Security:JwtSigningKey"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -189,7 +189,7 @@ public class StartupValidatorTests public void Site_MissingSiteDbPath_FailsValidation() { var values = ValidSiteConfig(); - values.Remove("ScadaLink:Database:SiteDbPath"); + values.Remove("ScadaBridge:Database:SiteDbPath"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -200,7 +200,7 @@ public class StartupValidatorTests public void FewerThanTwoSeedNodes_FailsValidation() { var values = ValidCentralConfig(); - values.Remove("ScadaLink:Cluster:SeedNodes:1"); + values.Remove("ScadaBridge:Cluster:SeedNodes:1"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -211,8 +211,8 @@ public class StartupValidatorTests public void NoSeedNodes_FailsValidation() { var values = ValidCentralConfig(); - values.Remove("ScadaLink:Cluster:SeedNodes:0"); - values.Remove("ScadaLink:Cluster:SeedNodes:1"); + values.Remove("ScadaBridge:Cluster:SeedNodes:0"); + values.Remove("ScadaBridge:Cluster:SeedNodes:1"); var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -227,7 +227,7 @@ public class StartupValidatorTests public void Site_InvalidGrpcPort_FailsValidation(string grpcPort) { var values = ValidSiteConfig(); - values["ScadaLink:Node:GrpcPort"] = grpcPort; + values["ScadaBridge:Node:GrpcPort"] = grpcPort; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -238,7 +238,7 @@ public class StartupValidatorTests public void Site_ValidGrpcPort_PassesValidation() { var values = ValidSiteConfig(); - values["ScadaLink:Node:GrpcPort"] = "8083"; + values["ScadaBridge:Node:GrpcPort"] = "8083"; var config = BuildConfig(values); var ex = Record.Exception(() => StartupValidator.Validate(config)); @@ -249,7 +249,7 @@ public class StartupValidatorTests public void Central_InvalidGrpcPort_NotValidated() { var values = ValidCentralConfig(); - values["ScadaLink:Node:GrpcPort"] = "0"; + values["ScadaBridge:Node:GrpcPort"] = "0"; var config = BuildConfig(values); var ex = Record.Exception(() => StartupValidator.Validate(config)); @@ -264,8 +264,8 @@ public class StartupValidatorTests // equals this node's GrpcPort would make a joining node attempt an // Akka.Remote TCP association against the gRPC listener and fail. var values = ValidSiteConfig(); - values["ScadaLink:Node:GrpcPort"] = "8083"; - values["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@site-a-node1:8083"; + values["ScadaBridge:Node:GrpcPort"] = "8083"; + values["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@site-a-node1:8083"; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -278,7 +278,7 @@ public class StartupValidatorTests // GrpcPort is absent here, so the NodeOptions default of 8083 applies. // A seed node on 8083 must still be rejected. var values = ValidSiteConfig(); - values["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@site-a-node2:8083"; + values["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@site-a-node2:8083"; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -290,9 +290,9 @@ public class StartupValidatorTests { // Two distinct site nodes, both seed entries on the remoting port (8082). var values = ValidSiteConfig(); - values["ScadaLink:Node:GrpcPort"] = "8083"; - values["ScadaLink:Cluster:SeedNodes:0"] = "akka.tcp://scadalink@site-a-node1:8082"; - values["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@site-a-node2:8082"; + values["ScadaBridge:Node:GrpcPort"] = "8083"; + values["ScadaBridge:Cluster:SeedNodes:0"] = "akka.tcp://scadabridge@site-a-node1:8082"; + values["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@site-a-node2:8082"; var config = BuildConfig(values); var ex = Record.Exception(() => StartupValidator.Validate(config)); @@ -305,7 +305,7 @@ public class StartupValidatorTests // The gRPC-port rule applies to Site nodes only. A Central node has no // GrpcPort, so a seed node on 8083 must not be rejected. var values = ValidCentralConfig(); - values["ScadaLink:Cluster:SeedNodes:1"] = "akka.tcp://scadalink@central-node2:8083"; + values["ScadaBridge:Cluster:SeedNodes:1"] = "akka.tcp://scadabridge@central-node2:8083"; var config = BuildConfig(values); var ex = Record.Exception(() => StartupValidator.Validate(config)); @@ -319,8 +319,8 @@ public class StartupValidatorTests // RemotingPort. Identical values cause Kestrel and Akka.Remote to // contend for the same port at runtime. var values = ValidSiteConfig(); - values["ScadaLink:Node:RemotingPort"] = "8082"; - values["ScadaLink:Node:GrpcPort"] = "8082"; + values["ScadaBridge:Node:RemotingPort"] = "8082"; + values["ScadaBridge:Node:GrpcPort"] = "8082"; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -333,7 +333,7 @@ public class StartupValidatorTests // GrpcPort absent => NodeOptions default 8083. A site whose RemotingPort // is also 8083 must still be rejected. var values = ValidSiteConfig(); - values["ScadaLink:Node:RemotingPort"] = "8083"; + values["ScadaBridge:Node:RemotingPort"] = "8083"; var config = BuildConfig(values); var ex = Assert.Throws(() => StartupValidator.Validate(config)); @@ -344,8 +344,8 @@ public class StartupValidatorTests public void Site_GrpcPortDiffersFromRemotingPort_PassesValidation() { var values = ValidSiteConfig(); - values["ScadaLink:Node:RemotingPort"] = "8082"; - values["ScadaLink:Node:GrpcPort"] = "8083"; + values["ScadaBridge:Node:RemotingPort"] = "8082"; + values["ScadaBridge:Node:GrpcPort"] = "8083"; var config = BuildConfig(values); var ex = Record.Exception(() => StartupValidator.Validate(config)); diff --git a/tests/ScadaLink.Host.Tests/WindowsServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/WindowsServiceTests.cs similarity index 83% rename from tests/ScadaLink.Host.Tests/WindowsServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/WindowsServiceTests.cs index 9f1e8672..8a70cfcf 100644 --- a/tests/ScadaLink.Host.Tests/WindowsServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/WindowsServiceTests.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace ScadaLink.Host.Tests; +namespace ZB.MOM.WW.ScadaBridge.Host.Tests; /// /// WP-17: Tests for Windows Service support. @@ -31,8 +31,8 @@ public class WindowsServiceTests var hostProjectDir = FindHostProjectDirectory(); Assert.NotNull(hostProjectDir); - var csprojFile = Path.Combine(hostProjectDir, "ScadaLink.Host.csproj"); - Assert.True(File.Exists(csprojFile), "ScadaLink.Host.csproj not found"); + var csprojFile = Path.Combine(hostProjectDir, "ZB.MOM.WW.ScadaBridge.Host.csproj"); + Assert.True(File.Exists(csprojFile), "ZB.MOM.WW.ScadaBridge.Host.csproj not found"); var content = File.ReadAllText(csprojFile); Assert.Contains("Microsoft.Extensions.Hosting.WindowsServices", content); @@ -45,7 +45,7 @@ public class WindowsServiceTests while (dir != null) { - var hostPath = Path.Combine(dir.FullName, "src", "ScadaLink.Host"); + var hostPath = Path.Combine(dir.FullName, "src", "ZB.MOM.WW.ScadaBridge.Host"); if (Directory.Exists(hostPath)) return hostPath; dir = dir.Parent; diff --git a/tests/ScadaLink.Host.Tests/ScadaLink.Host.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ZB.MOM.WW.ScadaBridge.Host.Tests.csproj similarity index 90% rename from tests/ScadaLink.Host.Tests/ScadaLink.Host.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ZB.MOM.WW.ScadaBridge.Host.Tests.csproj index 68951e71..d970bf47 100644 --- a/tests/ScadaLink.Host.Tests/ScadaLink.Host.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.Host.Tests/ZB.MOM.WW.ScadaBridge.Host.Tests.csproj @@ -28,7 +28,7 @@ - + diff --git a/tests/ScadaLink.InboundAPI.Tests/ApiKeyHashValidationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ApiKeyHashValidationTests.cs similarity index 94% rename from tests/ScadaLink.InboundAPI.Tests/ApiKeyHashValidationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ApiKeyHashValidationTests.cs index c077334d..53352e8a 100644 --- a/tests/ScadaLink.InboundAPI.Tests/ApiKeyHashValidationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ApiKeyHashValidationTests.cs @@ -1,9 +1,9 @@ using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// ConfigurationDatabase-012: must authenticate by diff --git a/tests/ScadaLink.InboundAPI.Tests/ApiKeyValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ApiKeyValidatorTests.cs similarity index 97% rename from tests/ScadaLink.InboundAPI.Tests/ApiKeyValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ApiKeyValidatorTests.cs index 784eaea7..18a54a77 100644 --- a/tests/ScadaLink.InboundAPI.Tests/ApiKeyValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ApiKeyValidatorTests.cs @@ -1,8 +1,8 @@ using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// WP-1: Tests for API key validation — X-API-Key header, enabled/disabled keys, diff --git a/tests/ScadaLink.InboundAPI.Tests/EndpointContentTypeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointContentTypeTests.cs similarity index 95% rename from tests/ScadaLink.InboundAPI.Tests/EndpointContentTypeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointContentTypeTests.cs index bf17704b..31050b49 100644 --- a/tests/ScadaLink.InboundAPI.Tests/EndpointContentTypeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointContentTypeTests.cs @@ -6,15 +6,15 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; using System.Net; using System.Net.Http.Headers; using System.Text; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// InboundAPI-020: the inbound API handler must accept JSON content types diff --git a/tests/ScadaLink.InboundAPI.Tests/EndpointExtensionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointExtensionsTests.cs similarity index 97% rename from tests/ScadaLink.InboundAPI.Tests/EndpointExtensionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointExtensionsTests.cs index 16b99085..9e5dd20b 100644 --- a/tests/ScadaLink.InboundAPI.Tests/EndpointExtensionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointExtensionsTests.cs @@ -6,15 +6,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.InboundApi; -using ScadaLink.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; using System.Net; using System.Text; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// InboundAPI-023: is diff --git a/tests/ScadaLink.InboundAPI.Tests/EndpointGatingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointGatingTests.cs similarity index 99% rename from tests/ScadaLink.InboundAPI.Tests/EndpointGatingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointGatingTests.cs index d27dc1d5..5d3b0857 100644 --- a/tests/ScadaLink.InboundAPI.Tests/EndpointGatingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/EndpointGatingTests.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// InboundAPI-006 / InboundAPI-008: the POST /api/{methodName} endpoint must be diff --git a/tests/ScadaLink.InboundAPI.Tests/ForbiddenApiCheckerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ForbiddenApiCheckerTests.cs similarity index 98% rename from tests/ScadaLink.InboundAPI.Tests/ForbiddenApiCheckerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ForbiddenApiCheckerTests.cs index fe70fda6..aa9fb536 100644 --- a/tests/ScadaLink.InboundAPI.Tests/ForbiddenApiCheckerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ForbiddenApiCheckerTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// InboundAPI-005 / InboundAPI-015: tests for the script-trust-model checker. diff --git a/tests/ScadaLink.InboundAPI.Tests/InboundScriptExecutorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/InboundScriptExecutorTests.cs similarity index 98% rename from tests/ScadaLink.InboundAPI.Tests/InboundScriptExecutorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/InboundScriptExecutorTests.cs index 3f65fd8f..5d37c772 100644 --- a/tests/ScadaLink.InboundAPI.Tests/InboundScriptExecutorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/InboundScriptExecutorTests.cs @@ -1,11 +1,11 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// WP-3: Tests for script execution on central — timeout, handler dispatch, error handling. @@ -123,13 +123,13 @@ public class InboundScriptExecutorTests return ctx.Parameters["name"]; }); - var parameters = new Dictionary { { "name", "ScadaLink" } }; + var parameters = new Dictionary { { "name", "ScadaBridge" } }; var result = await _executor.ExecuteAsync( method, parameters, _route, TimeSpan.FromSeconds(10)); Assert.True(result.Success); - Assert.Contains("ScadaLink", result.ResultJson!); + Assert.Contains("ScadaBridge", result.ResultJson!); } // --- InboundAPI-001: concurrent lazy-compile must not corrupt the handler cache --- @@ -210,7 +210,7 @@ public class InboundScriptExecutorTests // A fully-qualified forbidden API call must be rejected at compile/register time // so the script never executes. var marker = System.IO.Path.Combine( - System.IO.Path.GetTempPath(), $"scadalink-pwned-{Guid.NewGuid():N}"); + System.IO.Path.GetTempPath(), $"scadabridge-pwned-{Guid.NewGuid():N}"); System.IO.File.Delete(marker); var method = new ApiMethod("evil", $"System.IO.File.WriteAllText(@\"{marker}\", \"x\"); return 1;") diff --git a/tests/ScadaLink.InboundAPI.Tests/Middleware/AuditWriteMiddlewareTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/Middleware/AuditWriteMiddlewareTests.cs similarity index 98% rename from tests/ScadaLink.InboundAPI.Tests/Middleware/AuditWriteMiddlewareTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/Middleware/AuditWriteMiddlewareTests.cs index 9c36b1d9..cc11b9b4 100644 --- a/tests/ScadaLink.InboundAPI.Tests/Middleware/AuditWriteMiddlewareTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/Middleware/AuditWriteMiddlewareTests.cs @@ -5,13 +5,13 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; -namespace ScadaLink.InboundAPI.Tests.Middleware; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests.Middleware; /// /// M4 Bundle D (D1) — verifies emits exactly one @@ -93,7 +93,7 @@ public class AuditWriteMiddlewareTests /// File-local test double — returns the /// same snapshot on every read, no change-token plumbing required. Mirrors the /// StaticMonitor pattern in - /// tests/ScadaLink.AuditLog.Tests/Payload/InboundChannelCapTests.cs. + /// tests/ZB.MOM.WW.ScadaBridge.AuditLog.Tests/Payload/InboundChannelCapTests.cs. /// private sealed class StaticAuditLogOptionsMonitor : IOptionsMonitor { diff --git a/tests/ScadaLink.InboundAPI.Tests/Middleware/MiddlewareOrderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/Middleware/MiddlewareOrderTests.cs similarity index 95% rename from tests/ScadaLink.InboundAPI.Tests/Middleware/MiddlewareOrderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/Middleware/MiddlewareOrderTests.cs index f38dec23..151d44a1 100644 --- a/tests/ScadaLink.InboundAPI.Tests/Middleware/MiddlewareOrderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/Middleware/MiddlewareOrderTests.cs @@ -7,18 +7,18 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.InboundAPI.Middleware; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.InboundAPI.Middleware; using System.Security.Claims; -namespace ScadaLink.InboundAPI.Tests.Middleware; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests.Middleware; /// /// M4 Bundle D (D2) — verifies the production pipeline order from -/// ScadaLink.Host.Program.cs for the inbound API: +/// ZB.MOM.WW.ScadaBridge.Host.Program.cs for the inbound API: /// UseAuthentication → UseAuthorization → UseAuditWriteMiddleware → endpoint. /// /// @@ -121,7 +121,7 @@ public class MiddlewareOrderTests /// /// Builds a minimal in-memory host whose pipeline mirrors the production - /// arrangement in ScadaLink.Host.Program.cs: + /// arrangement in ZB.MOM.WW.ScadaBridge.Host.Program.cs: /// UseRouting → UseAuthentication → UseAuthorization → UseAuditWriteMiddleware → endpoints. /// Marker middlewares record their entry into so /// the test can assert on the resulting ordering. diff --git a/tests/ScadaLink.InboundAPI.Tests/ParameterValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ParameterValidatorTests.cs similarity index 99% rename from tests/ScadaLink.InboundAPI.Tests/ParameterValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ParameterValidatorTests.cs index 0e758de5..a5dd3adc 100644 --- a/tests/ScadaLink.InboundAPI.Tests/ParameterValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ParameterValidatorTests.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// WP-2: Tests for parameter validation — type checking, required fields, extended type system. diff --git a/tests/ScadaLink.InboundAPI.Tests/ReturnValueValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ReturnValueValidatorTests.cs similarity index 98% rename from tests/ScadaLink.InboundAPI.Tests/ReturnValueValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ReturnValueValidatorTests.cs index 5e088302..9b831b9e 100644 --- a/tests/ScadaLink.InboundAPI.Tests/ReturnValueValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ReturnValueValidatorTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// InboundAPI-014: tests for return-value validation against a method's diff --git a/tests/ScadaLink.InboundAPI.Tests/RouteHelperTests.cs b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/RouteHelperTests.cs similarity index 99% rename from tests/ScadaLink.InboundAPI.Tests/RouteHelperTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/RouteHelperTests.cs index 6db0065a..4abcf17a 100644 --- a/tests/ScadaLink.InboundAPI.Tests/RouteHelperTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/RouteHelperTests.cs @@ -1,8 +1,8 @@ using NSubstitute; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; -namespace ScadaLink.InboundAPI.Tests; +namespace ZB.MOM.WW.ScadaBridge.InboundAPI.Tests; /// /// WP-4: Tests for / — the diff --git a/tests/ScadaLink.InboundAPI.Tests/ScadaLink.InboundAPI.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests.csproj similarity index 78% rename from tests/ScadaLink.InboundAPI.Tests/ScadaLink.InboundAPI.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests.csproj index 1ec503eb..6a23f981 100644 --- a/tests/ScadaLink.InboundAPI.Tests/ScadaLink.InboundAPI.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests/ZB.MOM.WW.ScadaBridge.InboundAPI.Tests.csproj @@ -26,8 +26,8 @@ - - + + diff --git a/tests/ScadaLink.IntegrationTests/AuditLog/SiteAuditPushFlowTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuditLog/SiteAuditPushFlowTests.cs similarity index 92% rename from tests/ScadaLink.IntegrationTests/AuditLog/SiteAuditPushFlowTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuditLog/SiteAuditPushFlowTests.cs index 82cafd07..5f53a4c8 100644 --- a/tests/ScadaLink.IntegrationTests/AuditLog/SiteAuditPushFlowTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuditLog/SiteAuditPushFlowTests.cs @@ -7,18 +7,18 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.AuditLog.Site; -using ScadaLink.AuditLog.Site.Telemetry; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Communication; -using ScadaLink.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site; +using ZB.MOM.WW.ScadaBridge.AuditLog.Site.Telemetry; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Communication; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; -namespace ScadaLink.IntegrationTests.AuditLog; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests.AuditLog; /// /// End-to-end integration test for the Audit Log (#23) site→central push path @@ -125,9 +125,9 @@ public class SiteAuditPushFlowTests : TestKit // Real AuditLogIngestActor over an in-memory repository (test-mode ctor). var centralRepo = new InMemoryAuditLogRepository(); var ingestActor = Sys.ActorOf(Props.Create(() => - new ScadaLink.AuditLog.Central.AuditLogIngestActor( + new ZB.MOM.WW.ScadaBridge.AuditLog.Central.AuditLogIngestActor( centralRepo, - NullLogger.Instance))); + NullLogger.Instance))); // Real CentralCommunicationActor. Its periodic site-address refresh // resolves an ISiteRepository from this provider; an empty result keeps @@ -149,7 +149,7 @@ public class SiteAuditPushFlowTests : TestKit // + Pending queue). A temp file so it survives across DI scopes. var dbPath = Path.Combine(Path.GetTempPath(), $"auditpush-{Guid.NewGuid():N}.db"); var writerOptions = Options.Create(new SqliteAuditWriterOptions { DatabasePath = dbPath }); - var nodeIdentity = Substitute.For(); + var nodeIdentity = Substitute.For(); nodeIdentity.NodeName.Returns((string?)null); await using var writer = new SqliteAuditWriter( writerOptions, NullLogger.Instance, nodeIdentity); diff --git a/tests/ScadaLink.IntegrationTests/AuditTransactionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuditTransactionTests.cs similarity index 85% rename from tests/ScadaLink.IntegrationTests/AuditTransactionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuditTransactionTests.cs index ea89885d..ec403e0f 100644 --- a/tests/ScadaLink.IntegrationTests/AuditTransactionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuditTransactionTests.cs @@ -1,20 +1,20 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Security; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-22: Audit transactional guarantee — entity change + audit log in same transaction. /// -public class AuditTransactionTests : IClassFixture +public class AuditTransactionTests : IClassFixture { - private readonly ScadaLinkWebApplicationFactory _factory; + private readonly ScadaBridgeWebApplicationFactory _factory; - public AuditTransactionTests(ScadaLinkWebApplicationFactory factory) + public AuditTransactionTests(ScadaBridgeWebApplicationFactory factory) { _factory = factory; } @@ -25,7 +25,7 @@ public class AuditTransactionTests : IClassFixture(); var auditService = scope.ServiceProvider.GetRequiredService(); - var dbContext = scope.ServiceProvider.GetRequiredService(); + var dbContext = scope.ServiceProvider.GetRequiredService(); // Add a mapping and an audit log entry in the same unit of work var mapping = new LdapGroupMapping("test-group-audit", "Admin"); @@ -73,7 +73,7 @@ public class AuditTransactionTests : IClassFixture(); - var dbContext2 = scope2.ServiceProvider.GetRequiredService(); + var dbContext2 = scope2.ServiceProvider.GetRequiredService(); var mappings = await securityRepo2.GetAllMappingsAsync(); Assert.DoesNotContain(mappings, m => m.LdapGroupName == "orphan-group"); diff --git a/tests/ScadaLink.IntegrationTests/AuthFlowTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuthFlowTests.cs similarity index 90% rename from tests/ScadaLink.IntegrationTests/AuthFlowTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuthFlowTests.cs index 8f86c23d..a23519e3 100644 --- a/tests/ScadaLink.IntegrationTests/AuthFlowTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/AuthFlowTests.cs @@ -1,19 +1,19 @@ using System.Net; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.CentralUI.Auth; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.CentralUI.Auth; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-22: Auth flow integration tests. /// Tests that require a running LDAP server are marked with Integration trait. /// -public class AuthFlowTests : IClassFixture +public class AuthFlowTests : IClassFixture { - private readonly ScadaLinkWebApplicationFactory _factory; + private readonly ScadaBridgeWebApplicationFactory _factory; - public AuthFlowTests(ScadaLinkWebApplicationFactory factory) + public AuthFlowTests(ScadaBridgeWebApplicationFactory factory) { _factory = factory; } @@ -107,7 +107,7 @@ public class AuthFlowTests : IClassFixture public async Task LoginEndpoint_WithValidLdapCredentials_SetsCookieAndRedirects() { // Requires GLAuth test LDAP server: docker compose -f infra/docker-compose.yml up -d glauth - // GLAuth runs on localhost:3893, baseDN dc=scadalink,dc=local, all passwords "password" + // GLAuth runs on localhost:3893, baseDN dc=scadabridge,dc=local, all passwords "password" if (!await IsLdapAvailableAsync()) { // Skip gracefully if GLAuth not running — not a test failure @@ -134,7 +134,7 @@ public class AuthFlowTests : IClassFixture // Verify auth cookie was set var setCookieHeader = response.Headers.GetValues("Set-Cookie").FirstOrDefault(); Assert.NotNull(setCookieHeader); - Assert.Contains("ScadaLink.Auth", setCookieHeader); + Assert.Contains("ZB.MOM.WW.ScadaBridge.Auth", setCookieHeader); } private static async Task IsLdapAvailableAsync() diff --git a/tests/ScadaLink.IntegrationTests/CentralFailoverTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/CentralFailoverTests.cs similarity index 98% rename from tests/ScadaLink.IntegrationTests/CentralFailoverTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/CentralFailoverTests.cs index 419523cf..2673e1be 100644 --- a/tests/ScadaLink.IntegrationTests/CentralFailoverTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/CentralFailoverTests.cs @@ -1,9 +1,9 @@ using System.Net; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-1 (Phase 8): Full-system failover testing — Central. diff --git a/tests/ScadaLink.IntegrationTests/DualNodeRecoveryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/DualNodeRecoveryTests.cs similarity index 98% rename from tests/ScadaLink.IntegrationTests/DualNodeRecoveryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/DualNodeRecoveryTests.cs index d58c980a..0cfc6485 100644 --- a/tests/ScadaLink.IntegrationTests/DualNodeRecoveryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/DualNodeRecoveryTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-3 (Phase 8): Dual-node failure recovery. diff --git a/tests/ScadaLink.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs similarity index 98% rename from tests/ScadaLink.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs index d6a4a07b..62828901 100644 --- a/tests/ScadaLink.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/Grpc/GrpcStreamIntegrationTests.cs @@ -5,11 +5,11 @@ using Google.Protobuf.WellKnownTypes; using Grpc.Core; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Communication.Actors; -using ScadaLink.Communication.Grpc; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Communication.Actors; +using ZB.MOM.WW.ScadaBridge.Communication.Grpc; -namespace ScadaLink.IntegrationTests.Grpc; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests.Grpc; /// /// Integration tests for the gRPC streaming pipeline. diff --git a/tests/ScadaLink.IntegrationTests/IntegrationSurfaceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/IntegrationSurfaceTests.cs similarity index 96% rename from tests/ScadaLink.IntegrationTests/IntegrationSurfaceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/IntegrationSurfaceTests.cs index bc3f23f6..a212b48a 100644 --- a/tests/ScadaLink.IntegrationTests/IntegrationSurfaceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/IntegrationSurfaceTests.cs @@ -4,12 +4,12 @@ using System.Text; using System.Text.Json; using Microsoft.Extensions.DependencyInjection; using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.InboundAPI; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.InboundAPI; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-14: End-to-end integration tests for Phase 7 integration surfaces. @@ -99,7 +99,7 @@ public class IntegrationSurfaceTests // NS-019: the site-shaped NotificationDeliveryService that this case exercised // was removed when sites stopped delivering notifications. The central SMTP // delivery path is now covered end-to-end by - // ScadaLink.NotificationOutbox.Tests.Delivery.EmailNotificationDeliveryAdapterTests; + // ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.Delivery.EmailNotificationDeliveryAdapterTests; // no equivalent integration-surface assertion is needed here. // ── Script Context: integration API wiring ── diff --git a/tests/ScadaLink.IntegrationTests/NotificationOutboxFlowTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/NotificationOutboxFlowTests.cs similarity index 91% rename from tests/ScadaLink.IntegrationTests/NotificationOutboxFlowTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/NotificationOutboxFlowTests.cs index b639a9a4..deded2e6 100644 --- a/tests/ScadaLink.IntegrationTests/NotificationOutboxFlowTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/NotificationOutboxFlowTests.cs @@ -8,18 +8,18 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.NotificationOutbox; -using ScadaLink.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// Task 25: end-to-end integration test for the central Notification Outbox flow. Exercises @@ -33,13 +33,13 @@ namespace ScadaLink.IntegrationTests; public class NotificationOutboxFlowTests : TestKit { /// - /// SQLite-adapted : maps columns + /// SQLite-adapted : maps columns /// to sortable ISO 8601 strings so ORDER BY CreatedAt (used by the dispatcher's /// due-batch query) works, and drops the SQL Server rowversion concurrency token. /// - private sealed class SqliteOutboxDbContext : ScadaLinkDbContext + private sealed class SqliteOutboxDbContext : ScadaBridgeDbContext { - public SqliteOutboxDbContext(DbContextOptions options) + public SqliteOutboxDbContext(DbContextOptions options) : base(options, new EphemeralDataProtectionProvider()) { } @@ -115,7 +115,7 @@ public class NotificationOutboxFlowTests : TestKit /// /// Builds the test harness: a kept-open SQLite in-memory connection with the schema created, - /// and a service provider where and the repositories are + /// and a service provider where and the repositories are /// scoped over that single connection (the actor opens a fresh DI scope per dispatch sweep). /// private static OutboxHarness BuildHarness(DeliveryOutcome adapterOutcome) @@ -123,7 +123,7 @@ public class NotificationOutboxFlowTests : TestKit var connection = new SqliteConnection("DataSource=:memory:"); connection.Open(); - var dbOptions = new DbContextOptionsBuilder() + var dbOptions = new DbContextOptionsBuilder() .UseSqlite(connection) .ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)) .Options; @@ -151,9 +151,9 @@ public class NotificationOutboxFlowTests : TestKit var services = new ServiceCollection(); // Fresh DbContext per DI scope, all over the one kept-open SQLite connection so every // scope sees the same in-memory database. - services.AddScoped(_ => new SqliteOutboxDbContext(dbOptions)); + services.AddScoped(_ => new SqliteOutboxDbContext(dbOptions)); services.AddScoped(sp => - new NotificationOutboxRepository(sp.GetRequiredService())); + new NotificationOutboxRepository(sp.GetRequiredService())); services.AddScoped(_ => notificationRepository); services.AddScoped(_ => new StubEmailAdapter(adapterOutcome)); diff --git a/tests/ScadaLink.IntegrationTests/ObservabilityTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ObservabilityTests.cs similarity index 94% rename from tests/ScadaLink.IntegrationTests/ObservabilityTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ObservabilityTests.cs index ad54d0b6..20f0004d 100644 --- a/tests/ScadaLink.IntegrationTests/ObservabilityTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ObservabilityTests.cs @@ -1,22 +1,22 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-8 (Phase 8): Observability validation. /// Verifies structured logs contain SiteId/NodeHostname/NodeRole, /// correlation IDs flow through request chains, and health dashboard shows all metric types. /// -public class ObservabilityTests : IClassFixture +public class ObservabilityTests : IClassFixture { - private readonly ScadaLinkWebApplicationFactory _factory; + private readonly ScadaBridgeWebApplicationFactory _factory; - public ObservabilityTests(ScadaLinkWebApplicationFactory factory) + public ObservabilityTests(ScadaBridgeWebApplicationFactory factory) { _factory = factory; } diff --git a/tests/ScadaLink.IntegrationTests/ReadinessTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ReadinessTests.cs similarity index 74% rename from tests/ScadaLink.IntegrationTests/ReadinessTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ReadinessTests.cs index 05395d30..0c5a0187 100644 --- a/tests/ScadaLink.IntegrationTests/ReadinessTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ReadinessTests.cs @@ -1,15 +1,15 @@ using System.Net; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-22: Readiness gating — /health/ready endpoint returns status code. /// -public class ReadinessTests : IClassFixture +public class ReadinessTests : IClassFixture { - private readonly ScadaLinkWebApplicationFactory _factory; + private readonly ScadaBridgeWebApplicationFactory _factory; - public ReadinessTests(ScadaLinkWebApplicationFactory factory) + public ReadinessTests(ScadaBridgeWebApplicationFactory factory) { _factory = factory; } diff --git a/tests/ScadaLink.IntegrationTests/RecoveryDrillTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/RecoveryDrillTests.cs similarity index 97% rename from tests/ScadaLink.IntegrationTests/RecoveryDrillTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/RecoveryDrillTests.cs index d61c8c0e..f1a3eeb3 100644 --- a/tests/ScadaLink.IntegrationTests/RecoveryDrillTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/RecoveryDrillTests.cs @@ -1,10 +1,10 @@ using System.Text.Json; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-7 (Phase 8): Recovery drill test scaffolds. diff --git a/tests/ScadaLink.IntegrationTests/ScadaLinkWebApplicationFactory.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ScadaBridgeWebApplicationFactory.cs similarity index 64% rename from tests/ScadaLink.IntegrationTests/ScadaLinkWebApplicationFactory.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ScadaBridgeWebApplicationFactory.cs index fe977b5f..bc6ddbb3 100644 --- a/tests/ScadaLink.IntegrationTests/ScadaLinkWebApplicationFactory.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ScadaBridgeWebApplicationFactory.cs @@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.Host.Actors; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.Host.Actors; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// Shared WebApplicationFactory for integration tests. @@ -15,40 +15,40 @@ namespace ScadaLink.IntegrationTests; /// Uses environment variables for config since Program.cs reads them in the initial ConfigurationBuilder /// before WebApplicationFactory can inject settings. /// -public class ScadaLinkWebApplicationFactory : WebApplicationFactory +public class ScadaBridgeWebApplicationFactory : WebApplicationFactory { /// /// Environment variables that were set by this factory, to be cleaned up on dispose. /// private readonly Dictionary _previousEnvVars = new(); - public ScadaLinkWebApplicationFactory() + public ScadaBridgeWebApplicationFactory() { // The initial ConfigurationBuilder in Program.cs reads env vars with AddEnvironmentVariables(). // The env var format uses __ as section separator. var envVars = new Dictionary { ["DOTNET_ENVIRONMENT"] = "Development", - ["ScadaLink__Node__Role"] = "Central", - ["ScadaLink__Node__NodeHostname"] = "localhost", - ["ScadaLink__Node__RemotingPort"] = "8081", - ["ScadaLink__Cluster__SeedNodes__0"] = "akka.tcp://scadalink@localhost:8081", - ["ScadaLink__Cluster__SeedNodes__1"] = "akka.tcp://scadalink@localhost:8082", - ["ScadaLink__Database__ConfigurationDb"] = "Server=localhost;Database=ScadaLink_Test;TrustServerCertificate=True", - ["ScadaLink__Database__MachineDataDb"] = "Server=localhost;Database=ScadaLink_MachineData_Test;TrustServerCertificate=True", - ["ScadaLink__Database__SkipMigrations"] = "true", - ["ScadaLink__Security__JwtSigningKey"] = "integration-test-signing-key-must-be-at-least-32-chars-long", - ["ScadaLink__Security__LdapServer"] = "localhost", - ["ScadaLink__Security__LdapPort"] = "3893", - ["ScadaLink__Security__LdapUseTls"] = "false", - ["ScadaLink__Security__AllowInsecureLdap"] = "true", - ["ScadaLink__Security__LdapSearchBase"] = "dc=scadalink,dc=local", + ["ScadaBridge__Node__Role"] = "Central", + ["ScadaBridge__Node__NodeHostname"] = "localhost", + ["ScadaBridge__Node__RemotingPort"] = "8081", + ["ScadaBridge__Cluster__SeedNodes__0"] = "akka.tcp://scadabridge@localhost:8081", + ["ScadaBridge__Cluster__SeedNodes__1"] = "akka.tcp://scadabridge@localhost:8082", + ["ScadaBridge__Database__ConfigurationDb"] = "Server=localhost;Database=ScadaBridge_Test;TrustServerCertificate=True", + ["ScadaBridge__Database__MachineDataDb"] = "Server=localhost;Database=ScadaBridge_MachineData_Test;TrustServerCertificate=True", + ["ScadaBridge__Database__SkipMigrations"] = "true", + ["ScadaBridge__Security__JwtSigningKey"] = "integration-test-signing-key-must-be-at-least-32-chars-long", + ["ScadaBridge__Security__LdapServer"] = "localhost", + ["ScadaBridge__Security__LdapPort"] = "3893", + ["ScadaBridge__Security__LdapUseTls"] = "false", + ["ScadaBridge__Security__AllowInsecureLdap"] = "true", + ["ScadaBridge__Security__LdapSearchBase"] = "dc=scadabridge,dc=local", // GLAuth places users at cn=,ou=,ou=users,dc=... — the // no-service-account fallback DN (uid=,dc=...) does not match, // so a service account is configured to enable search-then-bind: // resolve the user's real DN by (uid=) lookup, then bind it. - ["ScadaLink__Security__LdapServiceAccountDn"] = "cn=admin,ou=SCADA-Admins,ou=users,dc=scadalink,dc=local", - ["ScadaLink__Security__LdapServiceAccountPassword"] = "password", + ["ScadaBridge__Security__LdapServiceAccountDn"] = "cn=admin,ou=SCADA-Admins,ou=users,dc=scadabridge,dc=local", + ["ScadaBridge__Security__LdapServiceAccountPassword"] = "password", }; foreach (var (key, value) in envVars) @@ -68,17 +68,17 @@ public class ScadaLinkWebApplicationFactory : WebApplicationFactory // AddDbContext<> with UseSqlServer registers many internal services. We must remove them all. var descriptorsToRemove = services .Where(d => - d.ServiceType == typeof(DbContextOptions) || + d.ServiceType == typeof(DbContextOptions) || d.ServiceType == typeof(DbContextOptions) || - d.ServiceType == typeof(ScadaLinkDbContext) || + d.ServiceType == typeof(ScadaBridgeDbContext) || d.ServiceType.FullName?.Contains("EntityFrameworkCore") == true) .ToList(); foreach (var d in descriptorsToRemove) services.Remove(d); // Add in-memory database as sole provider - services.AddDbContext(options => - options.UseInMemoryDatabase($"ScadaLink_IntegrationTests_{Guid.NewGuid()}")); + services.AddDbContext(options => + options.UseInMemoryDatabase($"ScadaBridge_IntegrationTests_{Guid.NewGuid()}")); // Remove the factory-registered IHostedService registrations so // Akka.NET remoting / DNS resolution never starts in tests — but diff --git a/tests/ScadaLink.IntegrationTests/SecurityHardeningTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/SecurityHardeningTests.cs similarity index 98% rename from tests/ScadaLink.IntegrationTests/SecurityHardeningTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/SecurityHardeningTests.cs index 2b3c58d2..62b395f3 100644 --- a/tests/ScadaLink.IntegrationTests/SecurityHardeningTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/SecurityHardeningTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-5 (Phase 8): Security hardening tests. diff --git a/tests/ScadaLink.IntegrationTests/SiteFailoverTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/SiteFailoverTests.cs similarity index 96% rename from tests/ScadaLink.IntegrationTests/SiteFailoverTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/SiteFailoverTests.cs index dffe4407..0eb2d110 100644 --- a/tests/ScadaLink.IntegrationTests/SiteFailoverTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/SiteFailoverTests.cs @@ -1,11 +1,11 @@ using System.Text.Json; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-2 (Phase 8): Full-system failover testing — Site. diff --git a/tests/ScadaLink.IntegrationTests/StartupValidationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/StartupValidationTests.cs similarity index 62% rename from tests/ScadaLink.IntegrationTests/StartupValidationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/StartupValidationTests.cs index dd924c34..1940c793 100644 --- a/tests/ScadaLink.IntegrationTests/StartupValidationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/StartupValidationTests.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Testing; -namespace ScadaLink.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.IntegrationTests; /// /// WP-22: Startup validation — missing required config fails with clear error. @@ -20,10 +20,10 @@ public class StartupValidationTests using var env = new TempEnvironment(new Dictionary { ["DOTNET_ENVIRONMENT"] = "Development", - ["ScadaLink__Node__NodeHostname"] = "localhost", - ["ScadaLink__Node__RemotingPort"] = "8081", - ["ScadaLink__Cluster__SeedNodes__0"] = "akka.tcp://scadalink@localhost:8081", - ["ScadaLink__Cluster__SeedNodes__1"] = "akka.tcp://scadalink@localhost:8082", + ["ScadaBridge__Node__NodeHostname"] = "localhost", + ["ScadaBridge__Node__RemotingPort"] = "8081", + ["ScadaBridge__Cluster__SeedNodes__0"] = "akka.tcp://scadabridge@localhost:8081", + ["ScadaBridge__Cluster__SeedNodes__1"] = "akka.tcp://scadabridge@localhost:8082", }); var factory = new WebApplicationFactory(); @@ -40,14 +40,14 @@ public class StartupValidationTests using var env = new TempEnvironment(new Dictionary { ["DOTNET_ENVIRONMENT"] = "Development", - ["ScadaLink__Node__Role"] = "Central", - ["ScadaLink__Node__NodeHostname"] = "localhost", - ["ScadaLink__Node__RemotingPort"] = "8081", - ["ScadaLink__Cluster__SeedNodes__0"] = "akka.tcp://scadalink@localhost:8081", - ["ScadaLink__Cluster__SeedNodes__1"] = "akka.tcp://scadalink@localhost:8082", - ["ScadaLink__Database__ConfigurationDb"] = "Server=x;Database=x", - ["ScadaLink__Database__MachineDataDb"] = "Server=x;Database=x", - ["ScadaLink__Security__LdapServer"] = "localhost", + ["ScadaBridge__Node__Role"] = "Central", + ["ScadaBridge__Node__NodeHostname"] = "localhost", + ["ScadaBridge__Node__RemotingPort"] = "8081", + ["ScadaBridge__Cluster__SeedNodes__0"] = "akka.tcp://scadabridge@localhost:8081", + ["ScadaBridge__Cluster__SeedNodes__1"] = "akka.tcp://scadabridge@localhost:8082", + ["ScadaBridge__Database__ConfigurationDb"] = "Server=x;Database=x", + ["ScadaBridge__Database__MachineDataDb"] = "Server=x;Database=x", + ["ScadaBridge__Security__LdapServer"] = "localhost", // Deliberately missing JwtSigningKey }); @@ -62,7 +62,7 @@ public class StartupValidationTests [Fact] public void CentralRole_StartsSuccessfully_WithValidConfig() { - using var factory = new ScadaLinkWebApplicationFactory(); + using var factory = new ScadaBridgeWebApplicationFactory(); using var client = factory.CreateClient(); Assert.NotNull(client); @@ -70,33 +70,33 @@ public class StartupValidationTests /// /// Helper to temporarily set environment variables and restore them on dispose. - /// Clears all ScadaLink__ vars first to ensure a clean slate. + /// Clears all ScadaBridge__ vars first to ensure a clean slate. /// private sealed class TempEnvironment : IDisposable { private readonly Dictionary _previousValues = new(); /// - /// All ScadaLink env vars that might be set by other tests/factories. + /// All ScadaBridge env vars that might be set by other tests/factories. /// private static readonly string[] KnownKeys = { "DOTNET_ENVIRONMENT", - "ScadaLink__Node__Role", - "ScadaLink__Node__NodeHostname", - "ScadaLink__Node__RemotingPort", - "ScadaLink__Node__SiteId", - "ScadaLink__Cluster__SeedNodes__0", - "ScadaLink__Cluster__SeedNodes__1", - "ScadaLink__Database__ConfigurationDb", - "ScadaLink__Database__MachineDataDb", - "ScadaLink__Database__SkipMigrations", - "ScadaLink__Security__JwtSigningKey", - "ScadaLink__Security__LdapServer", - "ScadaLink__Security__LdapPort", - "ScadaLink__Security__LdapUseTls", - "ScadaLink__Security__AllowInsecureLdap", - "ScadaLink__Security__LdapSearchBase", + "ScadaBridge__Node__Role", + "ScadaBridge__Node__NodeHostname", + "ScadaBridge__Node__RemotingPort", + "ScadaBridge__Node__SiteId", + "ScadaBridge__Cluster__SeedNodes__0", + "ScadaBridge__Cluster__SeedNodes__1", + "ScadaBridge__Database__ConfigurationDb", + "ScadaBridge__Database__MachineDataDb", + "ScadaBridge__Database__SkipMigrations", + "ScadaBridge__Security__JwtSigningKey", + "ScadaBridge__Security__LdapServer", + "ScadaBridge__Security__LdapPort", + "ScadaBridge__Security__LdapUseTls", + "ScadaBridge__Security__AllowInsecureLdap", + "ScadaBridge__Security__LdapSearchBase", }; public TempEnvironment(Dictionary varsToSet) diff --git a/tests/ScadaLink.IntegrationTests/ScadaLink.IntegrationTests.csproj b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ZB.MOM.WW.ScadaBridge.IntegrationTests.csproj similarity index 75% rename from tests/ScadaLink.IntegrationTests/ScadaLink.IntegrationTests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ZB.MOM.WW.ScadaBridge.IntegrationTests.csproj index f266e531..6b80cb32 100644 --- a/tests/ScadaLink.IntegrationTests/ScadaLink.IntegrationTests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/ZB.MOM.WW.ScadaBridge.IntegrationTests.csproj @@ -33,9 +33,9 @@ - - - + + + diff --git a/tests/ScadaLink.IntegrationTests/xunit.runner.json b/tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/xunit.runner.json similarity index 100% rename from tests/ScadaLink.IntegrationTests/xunit.runner.json rename to tests/ZB.MOM.WW.ScadaBridge.IntegrationTests/xunit.runner.json diff --git a/tests/ScadaLink.ManagementService.Tests/ApiKeyCreationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ApiKeyCreationTests.cs similarity index 91% rename from tests/ScadaLink.ManagementService.Tests/ApiKeyCreationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ApiKeyCreationTests.cs index 6504b010..d4d046bd 100644 --- a/tests/ScadaLink.ManagementService.Tests/ApiKeyCreationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ApiKeyCreationTests.cs @@ -4,14 +4,14 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Management; -using ScadaLink.Commons.Types.InboundApi; -using ScadaLink.ManagementService; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Types.InboundApi; +using ZB.MOM.WW.ScadaBridge.ManagementService; -namespace ScadaLink.ManagementService.Tests; +namespace ZB.MOM.WW.ScadaBridge.ManagementService.Tests; /// /// ConfigurationDatabase-012: creating an API key must generate a random key, diff --git a/tests/ScadaLink.ManagementService.Tests/AuditEndpointsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/AuditEndpointsTests.cs similarity index 96% rename from tests/ScadaLink.ManagementService.Tests/AuditEndpointsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/AuditEndpointsTests.cs index cc9f4831..50c37bf3 100644 --- a/tests/ScadaLink.ManagementService.Tests/AuditEndpointsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/AuditEndpointsTests.cs @@ -10,14 +10,14 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.ManagementService; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.ManagementService; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.ManagementService.Tests; +namespace ZB.MOM.WW.ScadaBridge.ManagementService.Tests; /// /// HTTP-pipeline tests for the #23 M8 audit endpoints (). @@ -541,7 +541,7 @@ public class AuditEndpointsTests // Empty PermittedSiteIds is the system-wide signal (Admin, system-wide // Deployment, audit roles with no scope rules attached). The filter // should pass through with no restriction added. - var user = new ScadaLink.Commons.Messages.Management.AuthenticatedUser( + var user = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Management.AuthenticatedUser( "alice", "Alice", new[] { "Admin" }, Array.Empty()); var filter = new AuditLogQueryFilter(SourceSiteIds: new[] { "plant-a" }); @@ -557,7 +557,7 @@ public class AuditEndpointsTests // No explicit sourceSiteId from the caller — the helper must restrict // the query to the user's permitted set, otherwise a site-scoped audit // user could read every site's rows. - var user = new ScadaLink.Commons.Messages.Management.AuthenticatedUser( + var user = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Management.AuthenticatedUser( "alice", "Alice", new[] { "AuditReadOnly" }, new[] { "plant-a", "plant-b" }); var filter = new AuditLogQueryFilter(); @@ -571,7 +571,7 @@ public class AuditEndpointsTests [Fact] public void ApplySiteScope_ScopedUser_ExplicitInScopeFilter_KeptVerbatim() { - var user = new ScadaLink.Commons.Messages.Management.AuthenticatedUser( + var user = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Management.AuthenticatedUser( "alice", "Alice", new[] { "AuditReadOnly" }, new[] { "plant-a", "plant-b" }); var filter = new AuditLogQueryFilter(SourceSiteIds: new[] { "plant-a" }); @@ -586,7 +586,7 @@ public class AuditEndpointsTests { // Caller explicitly asked for a site they cannot see — the helper signals // "403" by returning null rather than silently producing an empty page. - var user = new ScadaLink.Commons.Messages.Management.AuthenticatedUser( + var user = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Management.AuthenticatedUser( "alice", "Alice", new[] { "AuditReadOnly" }, new[] { "plant-a" }); var filter = new AuditLogQueryFilter(SourceSiteIds: new[] { "plant-b" }); @@ -598,7 +598,7 @@ public class AuditEndpointsTests [Fact] public void ApplySiteScope_ScopedUser_MixedInAndOutOfScopeFilter_IntersectedToInScopeOnly() { - var user = new ScadaLink.Commons.Messages.Management.AuthenticatedUser( + var user = new ZB.MOM.WW.ScadaBridge.Commons.Messages.Management.AuthenticatedUser( "alice", "Alice", new[] { "AuditReadOnly" }, new[] { "plant-a" }); var filter = new AuditLogQueryFilter(SourceSiteIds: new[] { "plant-a", "plant-b" }); diff --git a/tests/ScadaLink.ManagementService.Tests/DebugStreamHubTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/DebugStreamHubTests.cs similarity index 94% rename from tests/ScadaLink.ManagementService.Tests/DebugStreamHubTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/DebugStreamHubTests.cs index 38c45270..8d5c04c3 100644 --- a/tests/ScadaLink.ManagementService.Tests/DebugStreamHubTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/DebugStreamHubTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.ManagementService; +using ZB.MOM.WW.ScadaBridge.ManagementService; -namespace ScadaLink.ManagementService.Tests; +namespace ZB.MOM.WW.ScadaBridge.ManagementService.Tests; /// /// Tests for per-instance site-scope authorization diff --git a/tests/ScadaLink.ManagementService.Tests/ManagementActorSupervisionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorSupervisionTests.cs similarity index 91% rename from tests/ScadaLink.ManagementService.Tests/ManagementActorSupervisionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorSupervisionTests.cs index 10c6e8a7..de77d998 100644 --- a/tests/ScadaLink.ManagementService.Tests/ManagementActorSupervisionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorSupervisionTests.cs @@ -1,7 +1,7 @@ using Akka.Actor; -using ScadaLink.ManagementService; +using ZB.MOM.WW.ScadaBridge.ManagementService; -namespace ScadaLink.ManagementService.Tests; +namespace ZB.MOM.WW.ScadaBridge.ManagementService.Tests; /// /// Tests for the supervision strategy diff --git a/tests/ScadaLink.ManagementService.Tests/ManagementActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorTests.cs similarity index 99% rename from tests/ScadaLink.ManagementService.Tests/ManagementActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorTests.cs index 33f7882e..d49a14d0 100644 --- a/tests/ScadaLink.ManagementService.Tests/ManagementActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementActorTests.cs @@ -4,17 +4,17 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Management; -using ScadaLink.Commons.Types; -using ScadaLink.ManagementService; -using ScadaLink.TemplateEngine; -using ScadaLink.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.ManagementService; +using ZB.MOM.WW.ScadaBridge.TemplateEngine; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; -namespace ScadaLink.ManagementService.Tests; +namespace ZB.MOM.WW.ScadaBridge.ManagementService.Tests; public class ManagementActorTests : TestKit, IDisposable { diff --git a/tests/ScadaLink.ManagementService.Tests/ManagementEndpointsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementEndpointsTests.cs similarity index 95% rename from tests/ScadaLink.ManagementService.Tests/ManagementEndpointsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementEndpointsTests.cs index a8a9008d..5aec495a 100644 --- a/tests/ScadaLink.ManagementService.Tests/ManagementEndpointsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ManagementEndpointsTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Messages.Management; -using ScadaLink.ManagementService; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.ManagementService; -namespace ScadaLink.ManagementService.Tests; +namespace ZB.MOM.WW.ScadaBridge.ManagementService.Tests; /// /// Tests for request-body parsing diff --git a/tests/ScadaLink.ManagementService.Tests/ScadaLink.ManagementService.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests.csproj similarity index 71% rename from tests/ScadaLink.ManagementService.Tests/ScadaLink.ManagementService.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests.csproj index f1f131bd..282e9052 100644 --- a/tests/ScadaLink.ManagementService.Tests/ScadaLink.ManagementService.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests/ZB.MOM.WW.ScadaBridge.ManagementService.Tests.csproj @@ -22,8 +22,8 @@ - - - + + + diff --git a/tests/ScadaLink.NotificationOutbox.Tests/Delivery/DeliveryOutcomeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/Delivery/DeliveryOutcomeTests.cs similarity index 88% rename from tests/ScadaLink.NotificationOutbox.Tests/Delivery/DeliveryOutcomeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/Delivery/DeliveryOutcomeTests.cs index 3a9d8262..22b6a0e1 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/Delivery/DeliveryOutcomeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/Delivery/DeliveryOutcomeTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; -namespace ScadaLink.NotificationOutbox.Tests.Delivery; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.Delivery; public class DeliveryOutcomeTests { diff --git a/tests/ScadaLink.NotificationOutbox.Tests/Delivery/EmailNotificationDeliveryAdapterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/Delivery/EmailNotificationDeliveryAdapterTests.cs similarity index 96% rename from tests/ScadaLink.NotificationOutbox.Tests/Delivery/EmailNotificationDeliveryAdapterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/Delivery/EmailNotificationDeliveryAdapterTests.cs index 37a5bc3b..b03c3b48 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/Delivery/EmailNotificationDeliveryAdapterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/Delivery/EmailNotificationDeliveryAdapterTests.cs @@ -4,13 +4,13 @@ using MailKit.Net.Smtp; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationService; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationService; -namespace ScadaLink.NotificationOutbox.Tests.Delivery; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.Delivery; /// /// Task 12: Tests for the Email outbox delivery adapter — list/recipient/SMTP-config diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorAttemptEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorAttemptEmissionTests.cs similarity index 96% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorAttemptEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorAttemptEmissionTests.cs index 27ebd18e..75e3ee9b 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorAttemptEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorAttemptEmissionTests.cs @@ -3,15 +3,15 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// M4 Bundle B (B2) — verifies the diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorAuditInjectionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorAuditInjectionTests.cs similarity index 89% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorAuditInjectionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorAuditInjectionTests.cs index 0b6a302e..c6885b88 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorAuditInjectionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorAuditInjectionTests.cs @@ -3,12 +3,12 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// M4 Bundle B (B1) — verifies accepts an diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs similarity index 98% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs index 950bcb14..b16a2698 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorDispatchTests.cs @@ -3,14 +3,14 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; -using ScadaLink.NotificationOutbox.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.TestSupport; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// Task 14: Tests for the dispatcher loop — the diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorIngestTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorIngestTests.cs similarity index 95% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorIngestTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorIngestTests.cs index b55be505..5b387b20 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorIngestTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorIngestTests.cs @@ -4,14 +4,14 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.TestSupport; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// Task 13: Tests for the ingest path — building a diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorPurgeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorPurgeTests.cs similarity index 90% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorPurgeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorPurgeTests.cs index b291f769..bb8c0964 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorPurgeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorPurgeTests.cs @@ -3,14 +3,14 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; -using ScadaLink.NotificationOutbox.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.TestSupport; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// Task 16: Tests for the daily purge job — the diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorQueryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorQueryTests.cs similarity index 97% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorQueryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorQueryTests.cs index 4f71714a..b7b2b4f2 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorQueryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorQueryTests.cs @@ -4,15 +4,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; using NSubstitute.ExceptionExtensions; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Notifications; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Tests.TestSupport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Notifications; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.TestSupport; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// Task 15: Tests for the query surface — the diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorTerminalEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorTerminalEmissionTests.cs similarity index 96% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorTerminalEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorTerminalEmissionTests.cs index 024b8031..3355e0b4 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxActorTerminalEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxActorTerminalEmissionTests.cs @@ -3,16 +3,16 @@ using Akka.TestKit.Xunit2; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationOutbox.Messages; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Messages; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// M4 Bundle B (B3) — verifies the diff --git a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxOptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxOptionsTests.cs similarity index 91% rename from tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxOptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxOptionsTests.cs index c9d0cf66..cfc47ff0 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/NotificationOutboxOptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/NotificationOutboxOptionsTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; public class NotificationOutboxOptionsTests { diff --git a/tests/ScadaLink.NotificationOutbox.Tests/ProjectSmokeTest.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ProjectSmokeTest.cs similarity index 63% rename from tests/ScadaLink.NotificationOutbox.Tests/ProjectSmokeTest.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ProjectSmokeTest.cs index a2366fc2..ea28201f 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/ProjectSmokeTest.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ProjectSmokeTest.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; public class ProjectSmokeTest { diff --git a/tests/ScadaLink.NotificationOutbox.Tests/ServiceRegistrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ServiceRegistrationTests.cs similarity index 89% rename from tests/ScadaLink.NotificationOutbox.Tests/ServiceRegistrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ServiceRegistrationTests.cs index fe1ee79a..1ffa7ede 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/ServiceRegistrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ServiceRegistrationTests.cs @@ -2,17 +2,17 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.NotificationOutbox.Delivery; -using ScadaLink.NotificationService; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.NotificationOutbox.Delivery; +using ZB.MOM.WW.ScadaBridge.NotificationService; -namespace ScadaLink.NotificationOutbox.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests; /// /// Task 17: Tests for — the /// DI registration extension for the Notification Outbox component. The extension binds -/// from the ScadaLink:NotificationOutbox +/// from the ScadaBridge:NotificationOutbox /// configuration section and registers the channel delivery adapter(s). /// /// The Host wires both AddNotificationService and AddNotificationOutbox on the @@ -60,7 +60,7 @@ public class ServiceRegistrationTests public void AddNotificationOutbox_OptionsSection_IsTheNotificationOutboxConfigPath() { Assert.Equal( - "ScadaLink:NotificationOutbox", + "ScadaBridge:NotificationOutbox", NotificationOutbox.ServiceCollectionExtensions.OptionsSection); } @@ -71,7 +71,7 @@ public class ServiceRegistrationTests var configuration = new ConfigurationBuilder() .AddInMemoryCollection(new Dictionary { - ["ScadaLink:NotificationOutbox:DispatchBatchSize"] = "250", + ["ScadaBridge:NotificationOutbox:DispatchBatchSize"] = "250", }) .Build(); services.AddSingleton(configuration); diff --git a/tests/ScadaLink.NotificationOutbox.Tests/TestSupport/NoOpCentralAuditWriter.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/TestSupport/NoOpCentralAuditWriter.cs similarity index 73% rename from tests/ScadaLink.NotificationOutbox.Tests/TestSupport/NoOpCentralAuditWriter.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/TestSupport/NoOpCentralAuditWriter.cs index ae82341a..6bedd735 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/TestSupport/NoOpCentralAuditWriter.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/TestSupport/NoOpCentralAuditWriter.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.NotificationOutbox.Tests.TestSupport; +namespace ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.TestSupport; /// /// Test-only no-op . Used by existing diff --git a/tests/ScadaLink.NotificationOutbox.Tests/ScadaLink.NotificationOutbox.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.csproj similarity index 87% rename from tests/ScadaLink.NotificationOutbox.Tests/ScadaLink.NotificationOutbox.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.csproj index 790e6a3c..82b6d92b 100644 --- a/tests/ScadaLink.NotificationOutbox.Tests/ScadaLink.NotificationOutbox.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests/ZB.MOM.WW.ScadaBridge.NotificationOutbox.Tests.csproj @@ -25,7 +25,7 @@ - + diff --git a/tests/ScadaLink.NotificationService.Tests/CredentialRedactorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/CredentialRedactorTests.cs similarity index 97% rename from tests/ScadaLink.NotificationService.Tests/CredentialRedactorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/CredentialRedactorTests.cs index eb2aee25..840780b6 100644 --- a/tests/ScadaLink.NotificationService.Tests/CredentialRedactorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/CredentialRedactorTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationService.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests; /// /// NS-009: Tests for scrubbing SMTP credential secrets out of log/result text. diff --git a/tests/ScadaLink.NotificationService.Tests/MailKitSmtpClientWrapperTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/MailKitSmtpClientWrapperTests.cs similarity index 98% rename from tests/ScadaLink.NotificationService.Tests/MailKitSmtpClientWrapperTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/MailKitSmtpClientWrapperTests.cs index df6e3a1a..e8b36907 100644 --- a/tests/ScadaLink.NotificationService.Tests/MailKitSmtpClientWrapperTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/MailKitSmtpClientWrapperTests.cs @@ -1,7 +1,7 @@ using System.Text; using MailKit.Security; -namespace ScadaLink.NotificationService.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests; /// /// NS-016: must never diff --git a/tests/ScadaLink.NotificationService.Tests/NotificationOptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/NotificationOptionsTests.cs similarity index 86% rename from tests/ScadaLink.NotificationService.Tests/NotificationOptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/NotificationOptionsTests.cs index b2b4d011..14da4c08 100644 --- a/tests/ScadaLink.NotificationService.Tests/NotificationOptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/NotificationOptionsTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationService.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests; /// /// WP-11: Tests for NotificationOptions defaults. diff --git a/tests/ScadaLink.NotificationService.Tests/OAuth2TokenServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/OAuth2TokenServiceTests.cs similarity index 99% rename from tests/ScadaLink.NotificationService.Tests/OAuth2TokenServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/OAuth2TokenServiceTests.cs index acedf45e..bb1fc8e2 100644 --- a/tests/ScadaLink.NotificationService.Tests/OAuth2TokenServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/OAuth2TokenServiceTests.cs @@ -3,7 +3,7 @@ using System.Text.Json; using Microsoft.Extensions.Logging.Abstractions; using NSubstitute; -namespace ScadaLink.NotificationService.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests; /// /// Tests for OAuth2 token flow — token acquisition, caching, and credential parsing. diff --git a/tests/ScadaLink.NotificationService.Tests/SmtpErrorClassifierTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/SmtpErrorClassifierTests.cs similarity index 98% rename from tests/ScadaLink.NotificationService.Tests/SmtpErrorClassifierTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/SmtpErrorClassifierTests.cs index 8ffe947e..8a4b53e0 100644 --- a/tests/ScadaLink.NotificationService.Tests/SmtpErrorClassifierTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/SmtpErrorClassifierTests.cs @@ -2,7 +2,7 @@ using System.Net.Sockets; using MailKit; using MailKit.Net.Smtp; -namespace ScadaLink.NotificationService.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests; /// /// NS-002/NS-003: Tests for the shared SMTP error classification policy. This diff --git a/tests/ScadaLink.NotificationService.Tests/SmtpTlsModeParserTests.cs b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/SmtpTlsModeParserTests.cs similarity index 95% rename from tests/ScadaLink.NotificationService.Tests/SmtpTlsModeParserTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/SmtpTlsModeParserTests.cs index e0d023bd..8c303b05 100644 --- a/tests/ScadaLink.NotificationService.Tests/SmtpTlsModeParserTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/SmtpTlsModeParserTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.NotificationService.Tests; +namespace ZB.MOM.WW.ScadaBridge.NotificationService.Tests; /// /// NS-005: Tests for parsing the configured SMTP TLS mode into the three-state enum. diff --git a/tests/ScadaLink.NotificationService.Tests/ScadaLink.NotificationService.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests.csproj similarity index 65% rename from tests/ScadaLink.NotificationService.Tests/ScadaLink.NotificationService.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests.csproj index 62a0803f..3a18ae53 100644 --- a/tests/ScadaLink.NotificationService.Tests/ScadaLink.NotificationService.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests/ZB.MOM.WW.ScadaBridge.NotificationService.Tests.csproj @@ -22,9 +22,9 @@ - - - + + + diff --git a/tests/ScadaLink.PerformanceTests/AuditLog/HotPathLatencyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/AuditLog/HotPathLatencyTests.cs similarity index 96% rename from tests/ScadaLink.PerformanceTests/AuditLog/HotPathLatencyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/AuditLog/HotPathLatencyTests.cs index 45b51343..3ffc91f6 100644 --- a/tests/ScadaLink.PerformanceTests/AuditLog/HotPathLatencyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/AuditLog/HotPathLatencyTests.cs @@ -2,12 +2,12 @@ using System.Diagnostics; using System.Text; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.AuditLog.Configuration; -using ScadaLink.AuditLog.Payload; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.AuditLog.Configuration; +using ZB.MOM.WW.ScadaBridge.AuditLog.Payload; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.PerformanceTests.AuditLog; +namespace ZB.MOM.WW.ScadaBridge.PerformanceTests.AuditLog; /// /// Bundle D (M5-T9) hot-path latency budget for . diff --git a/tests/ScadaLink.PerformanceTests/HealthAggregationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/HealthAggregationTests.cs similarity index 96% rename from tests/ScadaLink.PerformanceTests/HealthAggregationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/HealthAggregationTests.cs index b43e8ec0..2272f685 100644 --- a/tests/ScadaLink.PerformanceTests/HealthAggregationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/HealthAggregationTests.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; -namespace ScadaLink.PerformanceTests; +namespace ZB.MOM.WW.ScadaBridge.PerformanceTests; /// /// WP-4 (Phase 8): Performance test framework for health reporting aggregation. diff --git a/tests/ScadaLink.PerformanceTests/StaggeredStartupTests.cs b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/StaggeredStartupTests.cs similarity index 98% rename from tests/ScadaLink.PerformanceTests/StaggeredStartupTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/StaggeredStartupTests.cs index 4771769f..1cf5ed0f 100644 --- a/tests/ScadaLink.PerformanceTests/StaggeredStartupTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/StaggeredStartupTests.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace ScadaLink.PerformanceTests; +namespace ZB.MOM.WW.ScadaBridge.PerformanceTests; /// /// WP-4 (Phase 8): Performance test framework for staggered startup. diff --git a/tests/ScadaLink.PerformanceTests/ScadaLink.PerformanceTests.csproj b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/ZB.MOM.WW.ScadaBridge.PerformanceTests.csproj similarity index 53% rename from tests/ScadaLink.PerformanceTests/ScadaLink.PerformanceTests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/ZB.MOM.WW.ScadaBridge.PerformanceTests.csproj index 659a59df..bd285f71 100644 --- a/tests/ScadaLink.PerformanceTests/ScadaLink.PerformanceTests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.PerformanceTests/ZB.MOM.WW.ScadaBridge.PerformanceTests.csproj @@ -21,11 +21,11 @@ - - - - - + + + + + diff --git a/tests/ScadaLink.Security.Tests/SecurityTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Security.Tests/SecurityTests.cs similarity index 98% rename from tests/ScadaLink.Security.Tests/SecurityTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Security.Tests/SecurityTests.cs index 1b8b0261..5041032d 100644 --- a/tests/ScadaLink.Security.Tests/SecurityTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Security.Tests/SecurityTests.cs @@ -5,13 +5,13 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Entities.Security; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Security; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.Security; -namespace ScadaLink.Security.Tests; +namespace ZB.MOM.WW.ScadaBridge.Security.Tests; #region WP-6: LdapAuthService Tests @@ -253,17 +253,17 @@ public class JwtTokenServiceTests public class RoleMapperTests : IDisposable { - private readonly ScadaLinkDbContext _context; + private readonly ScadaBridgeDbContext _context; private readonly SecurityRepository _securityRepo; private readonly RoleMapper _roleMapper; public RoleMapperTests() { - var options = new DbContextOptionsBuilder() + var options = new DbContextOptionsBuilder() .UseSqlite("DataSource=:memory:") .Options; - _context = new ScadaLinkDbContext(options); + _context = new ScadaBridgeDbContext(options); _context.Database.OpenConnection(); _context.Database.EnsureCreated(); _securityRepo = new SecurityRepository(_context); @@ -1205,7 +1205,7 @@ public class AuthorizationPolicyTests private static async Task EvaluatePolicy(string policyName, ClaimsPrincipal principal) { var services = new ServiceCollection(); - services.AddScadaLinkAuthorization(); + services.AddScadaBridgeAuthorization(); services.AddLogging(); using var provider = services.BuildServiceProvider(); diff --git a/tests/ScadaLink.Security.Tests/ScadaLink.Security.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.Security.Tests/ZB.MOM.WW.ScadaBridge.Security.Tests.csproj similarity index 74% rename from tests/ScadaLink.Security.Tests/ScadaLink.Security.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.Security.Tests/ZB.MOM.WW.ScadaBridge.Security.Tests.csproj index 3290ac6d..257ef86c 100644 --- a/tests/ScadaLink.Security.Tests/ScadaLink.Security.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.Security.Tests/ZB.MOM.WW.ScadaBridge.Security.Tests.csproj @@ -26,9 +26,9 @@ - - - + + + diff --git a/tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditActorTests.cs similarity index 98% rename from tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditActorTests.cs index 46eca679..0469e12a 100644 --- a/tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditActorTests.cs @@ -2,16 +2,16 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Tests.Migrations; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests.Migrations; -namespace ScadaLink.SiteCallAudit.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests; /// /// Bundle C1 (#22, #23 M3) tests for . Uses the @@ -30,12 +30,12 @@ public class SiteCallAuditActorTests : TestKit, IClassFixture() + var options = new DbContextOptionsBuilder() .UseSqlServer(_fixture.ConnectionString) .Options; - return new ScadaLinkDbContext(options); + return new ScadaBridgeDbContext(options); } private static string NewSiteId() => diff --git a/tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditOptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditOptionsTests.cs similarity index 89% rename from tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditOptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditOptionsTests.cs index 6778dc1b..e9e4d950 100644 --- a/tests/ScadaLink.SiteCallAudit.Tests/SiteCallAuditOptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallAuditOptionsTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteCallAudit.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests; public class SiteCallAuditOptionsTests { diff --git a/tests/ScadaLink.SiteCallAudit.Tests/SiteCallRelayTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallRelayTests.cs similarity index 94% rename from tests/ScadaLink.SiteCallAudit.Tests/SiteCallRelayTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallRelayTests.cs index 6cff69d4..924ed941 100644 --- a/tests/ScadaLink.SiteCallAudit.Tests/SiteCallRelayTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/SiteCallRelayTests.cs @@ -1,22 +1,22 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Messages.Audit; -using ScadaLink.Commons.Messages.RemoteQuery; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Audit; -using ScadaLink.Communication; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Audit; +using ZB.MOM.WW.ScadaBridge.Communication; -namespace ScadaLink.SiteCallAudit.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests; /// /// Task 5 (#22 Retry/Discard relay): tests for /// relaying operator Retry/Discard on a parked Site Call down to the owning /// site. The relay routes a / /// command via a -/// to the +/// to the /// (stood in by a TestProbe here) and awaits the site's /// . These tests never touch the /// SiteCalls repository — central never mutates the mirror row. diff --git a/tests/ScadaLink.SiteCallAudit.Tests/ScadaLink.SiteCallAudit.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests.csproj similarity index 80% rename from tests/ScadaLink.SiteCallAudit.Tests/ScadaLink.SiteCallAudit.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests.csproj index 772b7fe3..8e017f90 100644 --- a/tests/ScadaLink.SiteCallAudit.Tests/ScadaLink.SiteCallAudit.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests/ZB.MOM.WW.ScadaBridge.SiteCallAudit.Tests.csproj @@ -37,15 +37,15 @@ - + - + diff --git a/tests/ScadaLink.SiteEventLogging.Tests/EventLogCoverageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogCoverageTests.cs similarity index 97% rename from tests/ScadaLink.SiteEventLogging.Tests/EventLogCoverageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogCoverageTests.cs index 8ecda2ac..da267200 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/EventLogCoverageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogCoverageTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; /// /// Regression tests for SiteEventLogging-010: previously untested behaviours — diff --git a/tests/ScadaLink.SiteEventLogging.Tests/EventLogHandlerActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogHandlerActorTests.cs similarity index 96% rename from tests/ScadaLink.SiteEventLogging.Tests/EventLogHandlerActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogHandlerActorTests.cs index a5264a19..ea267425 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/EventLogHandlerActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogHandlerActorTests.cs @@ -1,8 +1,8 @@ using Akka.Actor; using Akka.TestKit.Xunit2; -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; /// /// Regression tests for SiteEventLogging-010: the actor message contract of diff --git a/tests/ScadaLink.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs similarity index 99% rename from tests/ScadaLink.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs index 1481b9a0..dbd7522a 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogPurgeServiceTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; public class EventLogPurgeServiceTests : IDisposable { diff --git a/tests/ScadaLink.SiteEventLogging.Tests/EventLogQueryServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogQueryServiceTests.cs similarity index 99% rename from tests/ScadaLink.SiteEventLogging.Tests/EventLogQueryServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogQueryServiceTests.cs index 28273161..b68e9d0a 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/EventLogQueryServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/EventLogQueryServiceTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; public class EventLogQueryServiceTests : IDisposable { diff --git a/tests/ScadaLink.SiteEventLogging.Tests/SchemaIndexTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SchemaIndexTests.cs similarity index 97% rename from tests/ScadaLink.SiteEventLogging.Tests/SchemaIndexTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SchemaIndexTests.cs index 5b271315..0038ad4c 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/SchemaIndexTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SchemaIndexTests.cs @@ -2,7 +2,7 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; /// /// Regression tests for SiteEventLogging-006: the schema must index the columns the diff --git a/tests/ScadaLink.SiteEventLogging.Tests/ServiceWiringTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/ServiceWiringTests.cs similarity index 98% rename from tests/ScadaLink.SiteEventLogging.Tests/ServiceWiringTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/ServiceWiringTests.cs index fc1187b5..12546e64 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/ServiceWiringTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/ServiceWiringTests.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; /// /// Regression tests for SiteEventLogging-007: the purge and query services must not diff --git a/tests/ScadaLink.SiteEventLogging.Tests/SiteEventLoggerAsyncTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SiteEventLoggerAsyncTests.cs similarity index 98% rename from tests/ScadaLink.SiteEventLogging.Tests/SiteEventLoggerAsyncTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SiteEventLoggerAsyncTests.cs index f1d766f6..4d617ff6 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/SiteEventLoggerAsyncTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SiteEventLoggerAsyncTests.cs @@ -3,7 +3,7 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; /// /// Regression tests for SiteEventLogging-005 (synchronous I/O on caller thread) diff --git a/tests/ScadaLink.SiteEventLogging.Tests/SiteEventLoggerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SiteEventLoggerTests.cs similarity index 99% rename from tests/ScadaLink.SiteEventLogging.Tests/SiteEventLoggerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SiteEventLoggerTests.cs index 20447500..76dd1059 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/SiteEventLoggerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/SiteEventLoggerTests.cs @@ -2,7 +2,7 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -namespace ScadaLink.SiteEventLogging.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests; public class SiteEventLoggerTests : IDisposable { diff --git a/tests/ScadaLink.SiteEventLogging.Tests/ScadaLink.SiteEventLogging.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests.csproj similarity index 88% rename from tests/ScadaLink.SiteEventLogging.Tests/ScadaLink.SiteEventLogging.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests.csproj index bed4ca67..58225fec 100644 --- a/tests/ScadaLink.SiteEventLogging.Tests/ScadaLink.SiteEventLogging.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests/ZB.MOM.WW.ScadaBridge.SiteEventLogging.Tests.csproj @@ -26,7 +26,7 @@ - + diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/AlarmActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/AlarmActorTests.cs similarity index 99% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/AlarmActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/AlarmActorTests.cs index da903c26..ef604db3 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/AlarmActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/AlarmActorTests.cs @@ -2,13 +2,13 @@ using Akka.Actor; using Akka.TestKit; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// WP-16: Alarm Actor tests — value match, range violation, rate of change. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerActorTests.cs similarity index 96% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerActorTests.cs index fdfd952e..2b2191ca 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerActorTests.cs @@ -2,17 +2,17 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.InboundApi; -using ScadaLink.Commons.Messages.Lifecycle; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Lifecycle; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Tests for DeploymentManagerActor: startup from SQLite, staggered batching, diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerLoggerFactoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerLoggerFactoryTests.cs similarity index 91% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerLoggerFactoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerLoggerFactoryTests.cs index 6507da3f..ad74f50b 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerLoggerFactoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerLoggerFactoryTests.cs @@ -2,15 +2,15 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Regression test for SiteRuntime-015 — must diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerMediumFindingsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerMediumFindingsTests.cs similarity index 92% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerMediumFindingsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerMediumFindingsTests.cs index a1c7b83e..a2351233 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerMediumFindingsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerMediumFindingsTests.cs @@ -1,15 +1,15 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Regression tests for the Medium-severity DeploymentManagerActor findings: @@ -146,7 +146,7 @@ public class DeploymentManagerMediumFindingsTests : TestKit, IDisposable /// /// SiteRuntime-010: when a redeployment changes a connection's configuration /// (here the failover retry count and endpoint), the Deployment Manager must - /// re-issue a + /// re-issue a /// so the DCL adopts the new configuration rather than keeping the stale one. /// [Fact] @@ -164,7 +164,7 @@ public class DeploymentManagerMediumFindingsTests : TestKit, IDisposable "dep-c1", "ConnPump", "h1", MakeConfigJsonWithConnection("ConnPump", "opc.tcp://host-a:4840", 3), "admin", DateTimeOffset.UtcNow)); - var firstCreate = dcl.ExpectMsg( + var firstCreate = dcl.ExpectMsg( TimeSpan.FromSeconds(5)); Assert.Equal("Conn1", firstCreate.ConnectionName); Assert.Equal(3, firstCreate.FailoverRetryCount); @@ -178,7 +178,7 @@ public class DeploymentManagerMediumFindingsTests : TestKit, IDisposable "admin", DateTimeOffset.UtcNow)); // The DCL must receive a fresh create command reflecting the new config. - var secondCreate = dcl.ExpectMsg( + var secondCreate = dcl.ExpectMsg( TimeSpan.FromSeconds(10)); Assert.Equal("Conn1", secondCreate.ConnectionName); Assert.Equal(7, secondCreate.FailoverRetryCount); @@ -201,7 +201,7 @@ public class DeploymentManagerMediumFindingsTests : TestKit, IDisposable var json = MakeConfigJsonWithConnection("StablePump", "opc.tcp://host-a:4840", 3); actor.Tell(new DeployInstanceCommand( "dep-s1", "StablePump", "h1", json, "admin", DateTimeOffset.UtcNow)); - dcl.ExpectMsg( + dcl.ExpectMsg( TimeSpan.FromSeconds(5)); ExpectMsg(TimeSpan.FromSeconds(5)); await Task.Delay(500); diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerRedeployTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerRedeployTests.cs similarity index 93% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerRedeployTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerRedeployTests.cs index 42976027..1e9caa5b 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/DeploymentManagerRedeployTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/DeploymentManagerRedeployTests.cs @@ -1,18 +1,18 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Deployment; -using ScadaLink.Commons.Messages.Health; -using ScadaLink.Commons.Messages.Lifecycle; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.HealthMonitoring; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Lifecycle; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.HealthMonitoring; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Regression tests for SiteRuntime-003: redeployment of an existing instance must @@ -71,7 +71,7 @@ public class DeploymentManagerRedeployTests : TestKit, IDisposable public void IncrementDeadLetter() { } public void IncrementSiteAuditWriteFailures() { } public void IncrementAuditRedactionFailure() { } - public void UpdateSiteAuditBacklog(ScadaLink.Commons.Types.SiteAuditBacklogSnapshot snapshot) { } + public void UpdateSiteAuditBacklog(ZB.MOM.WW.ScadaBridge.Commons.Types.SiteAuditBacklogSnapshot snapshot) { } public void UpdateConnectionHealth(string connectionName, ConnectionHealth health) { } public void RemoveConnection(string connectionName) { } public void UpdateTagResolution(string connectionName, int totalSubscribed, int successfullyResolved) { } diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/ExecutionActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/ExecutionActorTests.cs similarity index 95% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/ExecutionActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/ExecutionActorTests.cs index 1313359e..8d28de6d 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/ExecutionActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/ExecutionActorTests.cs @@ -3,13 +3,13 @@ using Akka.TestKit.Xunit2; using Microsoft.CodeAnalysis.CSharp.Scripting; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Scripts; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Regression coverage for SiteRuntime-016 — the short-lived execution actors diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorChildAttributeRaceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorChildAttributeRaceTests.cs similarity index 96% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorChildAttributeRaceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorChildAttributeRaceTests.cs index c435006d..f01cde4e 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorChildAttributeRaceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorChildAttributeRaceTests.cs @@ -2,15 +2,15 @@ using Akka.Actor; using Akka.TestKit; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Reflection; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Regression coverage for SiteRuntime-017 — the Instance Actor must not hand its diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs similarity index 94% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs index b6bb1296..6933cef0 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorIntegrationTests.cs @@ -1,17 +1,17 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.DebugView; -using ScadaLink.Commons.Messages.Instance; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DebugView; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Integration tests for InstanceActor with child Script/Alarm actors (WP-15, WP-16, WP-24, WP-25). diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorSetAttributeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorSetAttributeTests.cs similarity index 95% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorSetAttributeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorSetAttributeTests.cs index 46a204e0..90256837 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorSetAttributeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorSetAttributeTests.cs @@ -2,15 +2,15 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; using Akka.TestKit; -using ScadaLink.Commons.Messages.DataConnection; -using ScadaLink.Commons.Messages.Instance; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DataConnection; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Regression tests for SiteRuntime-001: Instance.SetAttribute must route writes diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorTests.cs similarity index 96% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorTests.cs index 7ca1439a..b83ca94c 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/InstanceActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/InstanceActorTests.cs @@ -2,17 +2,17 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Interfaces.Protocol; -using ScadaLink.Commons.Messages.DataConnection; -using ScadaLink.Commons.Messages.Instance; -using ScadaLink.Commons.Messages.Lifecycle; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.DataConnection; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Lifecycle; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; using System.Text.Json; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// Tests for InstanceActor: attribute loading, static overrides, and persistence. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Actors/ScriptActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/ScriptActorTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/Actors/ScriptActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/ScriptActorTests.cs index fae813a0..b82bc95c 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Actors/ScriptActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/ScriptActorTests.cs @@ -4,14 +4,14 @@ using Akka.TestKit.Xunit2; using Microsoft.CodeAnalysis.CSharp.Scripting; using Microsoft.CodeAnalysis.Scripting; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Instance; -using ScadaLink.Commons.Messages.ScriptExecution; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.SiteRuntime.Actors; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Instance; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Actors; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Actors; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Actors; /// /// WP-15: Script Actor and Script Execution Actor tests. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Integration/FailoverIntegrationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Integration/FailoverIntegrationTests.cs similarity index 98% rename from tests/ScadaLink.SiteRuntime.Tests/Integration/FailoverIntegrationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Integration/FailoverIntegrationTests.cs index 545f061e..96dea029 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Integration/FailoverIntegrationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Integration/FailoverIntegrationTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.SiteRuntime.Tests.Integration; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Integration; /// /// Integration tests for multi-node failover scenarios. diff --git a/tests/ScadaLink.SiteRuntime.Tests/NegativeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/NegativeTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/NegativeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/NegativeTests.cs index 4ba55588..133a1feb 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/NegativeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/NegativeTests.cs @@ -1,8 +1,8 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; -namespace ScadaLink.SiteRuntime.Tests; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests; /// /// Negative tests verifying design constraints. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Persistence/ArtifactStorageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Persistence/ArtifactStorageTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/Persistence/ArtifactStorageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Persistence/ArtifactStorageTests.cs index 5a2d4bf3..4459804e 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Persistence/ArtifactStorageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Persistence/ArtifactStorageTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; -namespace ScadaLink.SiteRuntime.Tests.Persistence; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Persistence; /// /// WP-33: Local Artifact Storage tests — shared scripts, external systems, diff --git a/tests/ScadaLink.SiteRuntime.Tests/Persistence/SiteStorageServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Persistence/SiteStorageServiceTests.cs similarity index 98% rename from tests/ScadaLink.SiteRuntime.Tests/Persistence/SiteStorageServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Persistence/SiteStorageServiceTests.cs index b1f93e7f..fe51198c 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Persistence/SiteStorageServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Persistence/SiteStorageServiceTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; -namespace ScadaLink.SiteRuntime.Tests.Persistence; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Persistence; /// /// Tests for SiteStorageService using file-based SQLite (temp files). diff --git a/tests/ScadaLink.SiteRuntime.Tests/Repositories/SiteRepositoryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Repositories/SiteRepositoryTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/Repositories/SiteRepositoryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Repositories/SiteRepositoryTests.cs index 8dd02359..c1a3e88e 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Repositories/SiteRepositoryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Repositories/SiteRepositoryTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.SiteRuntime.Persistence; -using ScadaLink.SiteRuntime.Repositories; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Persistence; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Repositories; -namespace ScadaLink.SiteRuntime.Tests.Repositories; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Repositories; /// /// SiteRuntime-006 / SiteRuntime-007 regression tests for the site-local repositories. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/DatabaseCachedWriteEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/DatabaseCachedWriteEmissionTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/DatabaseCachedWriteEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/DatabaseCachedWriteEmissionTests.cs index 2f87363c..37070073 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/DatabaseCachedWriteEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/DatabaseCachedWriteEmissionTests.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Logging.Abstractions; using Moq; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Audit Log #23 — M3 Bundle E (Task E6): every script-initiated diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/DatabaseSyncEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/DatabaseSyncEmissionTests.cs similarity index 98% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/DatabaseSyncEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/DatabaseSyncEmissionTests.cs index f610e805..f123a248 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/DatabaseSyncEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/DatabaseSyncEmissionTests.cs @@ -1,12 +1,12 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Moq; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Audit Log #23 — M4 Bundle A (Tasks A1+A2): every synchronous DB call made diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ExecutionCorrelationContextTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExecutionCorrelationContextTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/ExecutionCorrelationContextTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExecutionCorrelationContextTests.cs index ab7412f8..1ff3c8e2 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ExecutionCorrelationContextTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExecutionCorrelationContextTests.cs @@ -2,12 +2,12 @@ using Akka.Actor; using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Moq; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Audit Log #23 — execution-correlation tests exercised through a full diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ExternalSystemCachedCallEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExternalSystemCachedCallEmissionTests.cs similarity index 98% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/ExternalSystemCachedCallEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExternalSystemCachedCallEmissionTests.cs index ac90f4fa..ee35de2b 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ExternalSystemCachedCallEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExternalSystemCachedCallEmissionTests.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Logging.Abstractions; using Moq; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Integration; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Audit Log #23 — M3 Bundle E (Task E3): every script-initiated diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ExternalSystemCallAuditEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExternalSystemCallAuditEmissionTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/ExternalSystemCallAuditEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExternalSystemCallAuditEmissionTests.cs index b9e79482..7b464eb8 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ExternalSystemCallAuditEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ExternalSystemCallAuditEmissionTests.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Logging.Abstractions; using Moq; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Audit Log #23 — M2 Bundle F (Task F1): every script-initiated diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/NotifyHelperTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/NotifyHelperTests.cs similarity index 98% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/NotifyHelperTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/NotifyHelperTests.cs index 7cd558b0..99fa1130 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/NotifyHelperTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/NotifyHelperTests.cs @@ -3,12 +3,12 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Notification Outbox (Task 19): tests for the async Notify.Send / diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/NotifySendAuditEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/NotifySendAuditEmissionTests.cs similarity index 97% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/NotifySendAuditEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/NotifySendAuditEmissionTests.cs index 89fdbeac..a14ceab8 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/NotifySendAuditEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/NotifySendAuditEmissionTests.cs @@ -3,13 +3,13 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Entities.Audit; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Scripts; -using ScadaLink.StoreAndForward; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.StoreAndForward; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Audit Log #23 — M4 Bundle C (Task C1): every script-initiated diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/SandboxTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/SandboxTests.cs similarity index 98% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/SandboxTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/SandboxTests.cs index 6e9a4e16..eb5aa9f8 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/SandboxTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/SandboxTests.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Types; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// WP-6 (Phase 8): Script sandboxing verification. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ScopeAccessorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScopeAccessorTests.cs similarity index 94% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/ScopeAccessorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScopeAccessorTests.cs index 0618815b..9492ee27 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ScopeAccessorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScopeAccessorTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Types.Scripts; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Phase 1 of the script-scope rollout: verify path arithmetic for the new diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ScriptCompilationServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScriptCompilationServiceTests.cs similarity index 96% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/ScriptCompilationServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScriptCompilationServiceTests.cs index b71175ea..39d1f960 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ScriptCompilationServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScriptCompilationServiceTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// WP-19: Script Trust Model tests — validates forbidden API detection and compilation. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ScriptExecutionSchedulerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScriptExecutionSchedulerTests.cs similarity index 90% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/ScriptExecutionSchedulerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScriptExecutionSchedulerTests.cs index e01896b3..8321daf0 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/ScriptExecutionSchedulerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/ScriptExecutionSchedulerTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.SiteRuntime; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// SiteRuntime-009: the dedicated script-execution scheduler must run script bodies on diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/SharedScriptLibraryTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/SharedScriptLibraryTests.cs similarity index 96% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/SharedScriptLibraryTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/SharedScriptLibraryTests.cs index 2bd709f5..27c7b673 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/SharedScriptLibraryTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/SharedScriptLibraryTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// WP-17: Shared Script Library tests — compile, register, execute inline. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/TrackingApiTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/TrackingApiTests.cs similarity index 92% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/TrackingApiTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/TrackingApiTests.cs index ef8ffcb4..d278ec0c 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/TrackingApiTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/TrackingApiTests.cs @@ -1,10 +1,10 @@ using Microsoft.Extensions.Logging.Abstractions; using Moq; -using ScadaLink.Commons.Interfaces; -using ScadaLink.Commons.Types; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// Audit Log #23 (M3 Bundle A — Task A3) — script-side API tests for diff --git a/tests/ScadaLink.SiteRuntime.Tests/Scripts/TrustModelSemanticTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/TrustModelSemanticTests.cs similarity index 96% rename from tests/ScadaLink.SiteRuntime.Tests/Scripts/TrustModelSemanticTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/TrustModelSemanticTests.cs index 66683f75..6c21a277 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Scripts/TrustModelSemanticTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/TrustModelSemanticTests.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.SiteRuntime.Scripts; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Scripts; -namespace ScadaLink.SiteRuntime.Tests.Scripts; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Scripts; /// /// SiteRuntime-011: regression tests for the semantic-analysis trust-model validation. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Streaming/SiteStreamManagerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Streaming/SiteStreamManagerTests.cs similarity index 94% rename from tests/ScadaLink.SiteRuntime.Tests/Streaming/SiteStreamManagerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Streaming/SiteStreamManagerTests.cs index 1b84b790..64316ffb 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Streaming/SiteStreamManagerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Streaming/SiteStreamManagerTests.cs @@ -1,11 +1,11 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.Streaming; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Streaming; -namespace ScadaLink.SiteRuntime.Tests.Streaming; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Streaming; /// /// WP-23: Site-Wide Akka Stream tests. diff --git a/tests/ScadaLink.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs similarity index 99% rename from tests/ScadaLink.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs index a3ac99e2..f9425ec8 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Tracking/OperationTrackingStoreTests.cs @@ -1,11 +1,11 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Options; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.SiteRuntime.Tracking; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.SiteRuntime.Tracking; -namespace ScadaLink.SiteRuntime.Tests.Tracking; +namespace ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.Tracking; /// /// Audit Log #23 (M3 Bundle A — Task A2) — schema + behaviour tests for the diff --git a/tests/ScadaLink.SiteRuntime.Tests/UnitTest1.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/UnitTest1.cs similarity index 100% rename from tests/ScadaLink.SiteRuntime.Tests/UnitTest1.cs rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/UnitTest1.cs diff --git a/tests/ScadaLink.SiteRuntime.Tests/ScadaLink.SiteRuntime.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.csproj similarity index 69% rename from tests/ScadaLink.SiteRuntime.Tests/ScadaLink.SiteRuntime.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.csproj index 1bc09f8b..05546e40 100644 --- a/tests/ScadaLink.SiteRuntime.Tests/ScadaLink.SiteRuntime.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests.csproj @@ -24,9 +24,9 @@ - - - + + + diff --git a/tests/ScadaLink.StoreAndForward.Tests/CachedCallAttemptEmissionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/CachedCallAttemptEmissionTests.cs similarity index 98% rename from tests/ScadaLink.StoreAndForward.Tests/CachedCallAttemptEmissionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/CachedCallAttemptEmissionTests.cs index 145ac837..aa67d856 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/CachedCallAttemptEmissionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/CachedCallAttemptEmissionTests.cs @@ -1,10 +1,10 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// Audit Log #23 — M3 Bundle E Tasks E4 + E5: the store-and-forward retry diff --git a/tests/ScadaLink.StoreAndForward.Tests/NotificationForwarderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/NotificationForwarderTests.cs similarity index 98% rename from tests/ScadaLink.StoreAndForward.Tests/NotificationForwarderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/NotificationForwarderTests.cs index b3f34a45..4c13806e 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/NotificationForwarderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/NotificationForwarderTests.cs @@ -1,10 +1,10 @@ using System.Text.Json; using Akka.Actor; using Akka.TestKit.Xunit2; -using ScadaLink.Commons.Messages.Notification; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// Notification Outbox: tests for the site Store-and-Forward notification delivery diff --git a/tests/ScadaLink.StoreAndForward.Tests/ParkedMessageHandlerActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ParkedMessageHandlerActorTests.cs similarity index 97% rename from tests/ScadaLink.StoreAndForward.Tests/ParkedMessageHandlerActorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ParkedMessageHandlerActorTests.cs index a44eda3b..93240a69 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/ParkedMessageHandlerActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ParkedMessageHandlerActorTests.cs @@ -2,10 +2,10 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.RemoteQuery; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// StoreAndForward-013: tests for the actor diff --git a/tests/ScadaLink.StoreAndForward.Tests/ParkedOperationRelayTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ParkedOperationRelayTests.cs similarity index 97% rename from tests/ScadaLink.StoreAndForward.Tests/ParkedOperationRelayTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ParkedOperationRelayTests.cs index 7d4ef6ee..91861693 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/ParkedOperationRelayTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ParkedOperationRelayTests.cs @@ -2,11 +2,11 @@ using Akka.Actor; using Akka.TestKit.Xunit2; using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Messages.RemoteQuery; -using ScadaLink.Commons.Types; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.RemoteQuery; +using ZB.MOM.WW.ScadaBridge.Commons.Types; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// Task 5 (#22 Retry/Discard relay): tests the site-side execution of a diff --git a/tests/ScadaLink.StoreAndForward.Tests/ReplicationServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ReplicationServiceTests.cs similarity index 98% rename from tests/ScadaLink.StoreAndForward.Tests/ReplicationServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ReplicationServiceTests.cs index bd5d9ea9..6b8ce4ba 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/ReplicationServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ReplicationServiceTests.cs @@ -1,8 +1,8 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// WP-11: Tests for async replication to standby. diff --git a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardOptionsTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardOptionsTests.cs similarity index 95% rename from tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardOptionsTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardOptionsTests.cs index a94599d0..90f26f02 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardOptionsTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardOptionsTests.cs @@ -1,4 +1,4 @@ -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// WP-9: Tests for StoreAndForwardOptions defaults and configuration. diff --git a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardReplicationTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardReplicationTests.cs similarity index 98% rename from tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardReplicationTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardReplicationTests.cs index 52629a31..e5c449da 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardReplicationTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardReplicationTests.cs @@ -1,8 +1,8 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// StoreAndForward-001: the active node must forward every buffer operation diff --git a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardServiceTests.cs similarity index 99% rename from tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardServiceTests.cs index 407470b5..9d479afc 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardServiceTests.cs @@ -1,8 +1,8 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// WP-10/12/13/14: Tests for the StoreAndForwardService retry engine and management. diff --git a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardStorageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardStorageTests.cs similarity index 99% rename from tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardStorageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardStorageTests.cs index f6a2f0a8..ae66182f 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/StoreAndForwardStorageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/StoreAndForwardStorageTests.cs @@ -1,8 +1,8 @@ using Microsoft.Data.Sqlite; using Microsoft.Extensions.Logging.Abstractions; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.StoreAndForward.Tests; +namespace ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests; /// /// WP-9: Tests for SQLite persistence layer. diff --git a/tests/ScadaLink.StoreAndForward.Tests/ScadaLink.StoreAndForward.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests.csproj similarity index 75% rename from tests/ScadaLink.StoreAndForward.Tests/ScadaLink.StoreAndForward.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests.csproj index fb38e728..25dacd1d 100644 --- a/tests/ScadaLink.StoreAndForward.Tests/ScadaLink.StoreAndForward.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests.csproj @@ -22,8 +22,8 @@ - - + + diff --git a/tests/ScadaLink.StoreAndForward.Tests/xunit.runner.json b/tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/xunit.runner.json similarity index 100% rename from tests/ScadaLink.StoreAndForward.Tests/xunit.runner.json rename to tests/ZB.MOM.WW.ScadaBridge.StoreAndForward.Tests/xunit.runner.json diff --git a/tests/ScadaLink.TemplateEngine.Tests/CollisionDetectorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/CollisionDetectorTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/CollisionDetectorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/CollisionDetectorTests.cs index fdfaefde..ed851872 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/CollisionDetectorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/CollisionDetectorTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.TemplateEngine.Tests; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests; public class CollisionDetectorTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/CycleDetectorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/CycleDetectorTests.cs similarity index 98% rename from tests/ScadaLink.TemplateEngine.Tests/CycleDetectorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/CycleDetectorTests.cs index c49d7012..2b29ac3e 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/CycleDetectorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/CycleDetectorTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.TemplateEngine.Tests; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests; public class CycleDetectorTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Flattening/DeploymentPackageTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/DeploymentPackageTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/Flattening/DeploymentPackageTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/DeploymentPackageTests.cs index cde229ac..544c96d3 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Flattening/DeploymentPackageTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/DeploymentPackageTests.cs @@ -1,7 +1,7 @@ using System.Text.Json; -using ScadaLink.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; -namespace ScadaLink.TemplateEngine.Tests.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Flattening; public class DeploymentPackageTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Flattening/DiffServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/DiffServiceTests.cs similarity index 98% rename from tests/ScadaLink.TemplateEngine.Tests/Flattening/DiffServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/DiffServiceTests.cs index 404156ca..56b56331 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Flattening/DiffServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/DiffServiceTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; -namespace ScadaLink.TemplateEngine.Tests.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Flattening; public class DiffServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Flattening/FlatteningServiceMergeTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/FlatteningServiceMergeTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/Flattening/FlatteningServiceMergeTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/FlatteningServiceMergeTests.cs index d4ae23a8..ae90b442 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Flattening/FlatteningServiceMergeTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/FlatteningServiceMergeTests.cs @@ -1,12 +1,12 @@ using System.Text.Json; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; -namespace ScadaLink.TemplateEngine.Tests.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Flattening; public class FlatteningServiceMergeTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Flattening/FlatteningServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/FlatteningServiceTests.cs similarity index 98% rename from tests/ScadaLink.TemplateEngine.Tests/Flattening/FlatteningServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/FlatteningServiceTests.cs index 2c2c72d1..2a2c00db 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Flattening/FlatteningServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/FlatteningServiceTests.cs @@ -1,10 +1,10 @@ -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; -namespace ScadaLink.TemplateEngine.Tests.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Flattening; public class FlatteningServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Flattening/RevisionHashServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/RevisionHashServiceTests.cs similarity index 98% rename from tests/ScadaLink.TemplateEngine.Tests/Flattening/RevisionHashServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/RevisionHashServiceTests.cs index 0ed2d176..0c13f8ff 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Flattening/RevisionHashServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Flattening/RevisionHashServiceTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.TemplateEngine.Flattening; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Flattening; -namespace ScadaLink.TemplateEngine.Tests.Flattening; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Flattening; public class RevisionHashServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/LockEnforcerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/LockEnforcerTests.cs similarity index 98% rename from tests/ScadaLink.TemplateEngine.Tests/LockEnforcerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/LockEnforcerTests.cs index 9d9e4c1d..afa4bbb1 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/LockEnforcerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/LockEnforcerTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.TemplateEngine.Tests; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests; public class LockEnforcerTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Services/AreaServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/AreaServiceTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/Services/AreaServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/AreaServiceTests.cs index 4503d990..54e76c24 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Services/AreaServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/AreaServiceTests.cs @@ -1,10 +1,10 @@ using Moq; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; -namespace ScadaLink.TemplateEngine.Tests.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Services; public class AreaServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Services/InstanceServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/InstanceServiceTests.cs similarity index 96% rename from tests/ScadaLink.TemplateEngine.Tests/Services/InstanceServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/InstanceServiceTests.cs index 61a9a236..b1cbc66b 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Services/InstanceServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/InstanceServiceTests.cs @@ -1,13 +1,13 @@ using Moq; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Messages.Management; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; -namespace ScadaLink.TemplateEngine.Tests.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Services; public class InstanceServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Services/SiteServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/SiteServiceTests.cs similarity index 91% rename from tests/ScadaLink.TemplateEngine.Tests/Services/SiteServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/SiteServiceTests.cs index 8faa4c49..bb6a54dc 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Services/SiteServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/SiteServiceTests.cs @@ -1,11 +1,11 @@ using Moq; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Sites; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Sites; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; -namespace ScadaLink.TemplateEngine.Tests.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Services; public class SiteServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Services/TemplateDeletionServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/TemplateDeletionServiceTests.cs similarity index 96% rename from tests/ScadaLink.TemplateEngine.Tests/Services/TemplateDeletionServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/TemplateDeletionServiceTests.cs index f5cbf64f..0f5980ba 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Services/TemplateDeletionServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/TemplateDeletionServiceTests.cs @@ -1,10 +1,10 @@ using Moq; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; -namespace ScadaLink.TemplateEngine.Tests.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Services; public class TemplateDeletionServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Services/TemplateFolderServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/TemplateFolderServiceTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/Services/TemplateFolderServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/TemplateFolderServiceTests.cs index 2dece198..e5011df8 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Services/TemplateFolderServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Services/TemplateFolderServiceTests.cs @@ -1,10 +1,10 @@ using Moq; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.TemplateEngine.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Services; -namespace ScadaLink.TemplateEngine.Tests.Services; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Services; public class TemplateFolderServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/SharedScriptServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/SharedScriptServiceTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/SharedScriptServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/SharedScriptServiceTests.cs index 8b4c0de7..cfe14e9c 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/SharedScriptServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/SharedScriptServiceTests.cs @@ -1,9 +1,9 @@ using Moq; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; -namespace ScadaLink.TemplateEngine.Tests; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests; public class SharedScriptServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/TemplateNamingTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateNamingTests.cs similarity index 96% rename from tests/ScadaLink.TemplateEngine.Tests/TemplateNamingTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateNamingTests.cs index a3ab0818..e2a35e3d 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/TemplateNamingTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateNamingTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; -namespace ScadaLink.TemplateEngine.Tests; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests; /// /// Coverage for — the computed diff --git a/tests/ScadaLink.TemplateEngine.Tests/TemplateResolverTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateResolverTests.cs similarity index 98% rename from tests/ScadaLink.TemplateEngine.Tests/TemplateResolverTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateResolverTests.cs index 7ac5c0f2..c05185ba 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/TemplateResolverTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateResolverTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.TemplateEngine.Tests; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests; public class TemplateResolverTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/TemplateServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateServiceTests.cs similarity index 99% rename from tests/ScadaLink.TemplateEngine.Tests/TemplateServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateServiceTests.cs index 7d01ecd5..d2feb9bc 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/TemplateServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/TemplateServiceTests.cs @@ -1,12 +1,12 @@ using Moq; -using ScadaLink.Commons.Entities.Instances; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; -namespace ScadaLink.TemplateEngine.Tests; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests; public class TemplateServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Validation/ScriptCompilerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/ScriptCompilerTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/Validation/ScriptCompilerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/ScriptCompilerTests.cs index 33ca55ea..72e59524 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Validation/ScriptCompilerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/ScriptCompilerTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; -namespace ScadaLink.TemplateEngine.Tests.Validation; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Validation; public class ScriptCompilerTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Validation/SemanticValidatorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/SemanticValidatorTests.cs similarity index 98% rename from tests/ScadaLink.TemplateEngine.Tests/Validation/SemanticValidatorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/SemanticValidatorTests.cs index 8a4f5edb..14c9f4f0 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Validation/SemanticValidatorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/SemanticValidatorTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; -namespace ScadaLink.TemplateEngine.Tests.Validation; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Validation; public class SemanticValidatorTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/Validation/ValidationServiceTests.cs b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/ValidationServiceTests.cs similarity index 97% rename from tests/ScadaLink.TemplateEngine.Tests/Validation/ValidationServiceTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/ValidationServiceTests.cs index 6a7182b3..c71b278c 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/Validation/ValidationServiceTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/Validation/ValidationServiceTests.cs @@ -1,7 +1,7 @@ -using ScadaLink.Commons.Types.Flattening; -using ScadaLink.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; -namespace ScadaLink.TemplateEngine.Tests.Validation; +namespace ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.Validation; public class ValidationServiceTests { diff --git a/tests/ScadaLink.TemplateEngine.Tests/ScadaLink.TemplateEngine.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.csproj similarity index 84% rename from tests/ScadaLink.TemplateEngine.Tests/ScadaLink.TemplateEngine.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.csproj index f3399b1d..17b38fd2 100644 --- a/tests/ScadaLink.TemplateEngine.Tests/ScadaLink.TemplateEngine.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests/ZB.MOM.WW.ScadaBridge.TemplateEngine.Tests.csproj @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/tests/ScadaLink.Transport.IntegrationTests/CompositionImportTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/CompositionImportTests.cs similarity index 93% rename from tests/ScadaLink.Transport.IntegrationTests/CompositionImportTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/CompositionImportTests.cs index b3c0dc1f..f9ee0c23 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/CompositionImportTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/CompositionImportTests.cs @@ -2,18 +2,18 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; -namespace ScadaLink.Transport.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests; /// /// FU-B — integration coverage for the post-flush second-pass rewire in @@ -33,7 +33,7 @@ public sealed class CompositionImportTests : IDisposable new ConfigurationBuilder().AddInMemoryCollection().Build()); var dbName = $"CompositionImportTests_{Guid.NewGuid()}"; - services.AddDbContext(opts => opts + services.AddDbContext(opts => opts .UseInMemoryDatabase(dbName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))); @@ -59,7 +59,7 @@ public sealed class CompositionImportTests : IDisposable { await using var scope = _provider.CreateAsyncScope(); var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var templateIds = await ctx.Templates.Select(t => t.Id).ToListAsync(); var selection = new ExportSelection( @@ -84,7 +84,7 @@ public sealed class CompositionImportTests : IDisposable private async Task WipeTemplatesAsync() { await using var scope = _provider.CreateAsyncScope(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.TemplateCompositions.RemoveRange(ctx.TemplateCompositions); ctx.TemplateAlarms.RemoveRange(ctx.TemplateAlarms); ctx.TemplateScripts.RemoveRange(ctx.TemplateScripts); @@ -99,7 +99,7 @@ public sealed class CompositionImportTests : IDisposable // Seed: Template A composes Template B via InstanceName="b1". await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("B") { Description = "leaf" }); await ctx.SaveChangesAsync(); var b = await ctx.Templates.SingleAsync(t => t.Name == "B"); @@ -147,7 +147,7 @@ public sealed class CompositionImportTests : IDisposable // Assert: A has exactly one TemplateComposition pointing at B. await using (var assertScope = _provider.CreateAsyncScope()) { - var ctx = assertScope.ServiceProvider.GetRequiredService(); + var ctx = assertScope.ServiceProvider.GetRequiredService(); var a = await ctx.Templates .Include(t => t.Compositions) .SingleAsync(t => t.Name == "A"); @@ -168,7 +168,7 @@ public sealed class CompositionImportTests : IDisposable // and the composition edge must NOT be written. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("B") { Description = "leaf" }); await ctx.SaveChangesAsync(); var b = await ctx.Templates.SingleAsync(t => t.Name == "B"); @@ -213,7 +213,7 @@ public sealed class CompositionImportTests : IDisposable await using (var assertScope = _provider.CreateAsyncScope()) { - var ctx = assertScope.ServiceProvider.GetRequiredService(); + var ctx = assertScope.ServiceProvider.GetRequiredService(); var a = await ctx.Templates .Include(t => t.Compositions) .SingleAsync(t => t.Name == "A"); @@ -246,7 +246,7 @@ public sealed class CompositionImportTests : IDisposable // re-resolve the FK to Startup's new id. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("Pump") { Description = "with alarm" }; ctx.Templates.Add(t); await ctx.SaveChangesAsync(); @@ -292,7 +292,7 @@ public sealed class CompositionImportTests : IDisposable await using (var assertScope = _provider.CreateAsyncScope()) { - var ctx = assertScope.ServiceProvider.GetRequiredService(); + var ctx = assertScope.ServiceProvider.GetRequiredService(); var pump = await ctx.Templates .Include(t => t.Alarms) .Include(t => t.Scripts) diff --git a/tests/ScadaLink.Transport.IntegrationTests/ConflictResolutionTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ConflictResolutionTests.cs similarity index 91% rename from tests/ScadaLink.Transport.IntegrationTests/ConflictResolutionTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ConflictResolutionTests.cs index 616f195d..a6f242d2 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/ConflictResolutionTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ConflictResolutionTests.cs @@ -2,17 +2,17 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; -namespace ScadaLink.Transport.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests; /// /// T26 — integration conflict-resolution tests. The unit-level Apply paths @@ -31,7 +31,7 @@ public sealed class ConflictResolutionTests : IDisposable new ConfigurationBuilder().AddInMemoryCollection().Build()); var dbName = $"ConflictResolutionTests_{Guid.NewGuid()}"; - services.AddDbContext(opts => opts + services.AddDbContext(opts => opts .UseInMemoryDatabase(dbName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))); @@ -59,7 +59,7 @@ public sealed class ConflictResolutionTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var templateIds = await ctx.Templates.Select(t => t.Id).ToListAsync(); var sharedScriptIds = await ctx.SharedScripts.Select(s => s.Id).ToListAsync(); @@ -98,7 +98,7 @@ public sealed class ConflictResolutionTests : IDisposable // Apply with Overwrite must restore "new". await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "new" }); await ctx.SaveChangesAsync(); } @@ -107,7 +107,7 @@ public sealed class ConflictResolutionTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var existing = await ctx.Templates.SingleAsync(t => t.Name == "Pump"); existing.Description = "old"; await ctx.SaveChangesAsync(); @@ -129,7 +129,7 @@ public sealed class ConflictResolutionTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var pump = await ctx.Templates.SingleAsync(t => t.Name == "Pump"); Assert.Equal("new", pump.Description); } @@ -144,14 +144,14 @@ public sealed class ConflictResolutionTests : IDisposable // target row, and the summary must report Skipped=1. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "replace" }); await ctx.SaveChangesAsync(); } var sessionId = await ExportAndLoadAsync(); await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var existing = await ctx.Templates.SingleAsync(t => t.Name == "Pump"); existing.Description = "keep"; await ctx.SaveChangesAsync(); @@ -173,7 +173,7 @@ public sealed class ConflictResolutionTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var pump = await ctx.Templates.SingleAsync(t => t.Name == "Pump"); Assert.Equal("keep", pump.Description); } @@ -190,14 +190,14 @@ public sealed class ConflictResolutionTests : IDisposable // untouched and a second Pump.Imported template must materialise. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "from-bundle" }); await ctx.SaveChangesAsync(); } var sessionId = await ExportAndLoadAsync(); await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var existing = await ctx.Templates.SingleAsync(t => t.Name == "Pump"); existing.Description = "kept-original"; await ctx.SaveChangesAsync(); @@ -219,7 +219,7 @@ public sealed class ConflictResolutionTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var original = await ctx.Templates.SingleAsync(t => t.Name == "Pump"); Assert.Equal("kept-original", original.Description); diff --git a/tests/ScadaLink.Transport.IntegrationTests/Export/BundleExporterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Export/BundleExporterTests.cs similarity index 91% rename from tests/ScadaLink.Transport.IntegrationTests/Export/BundleExporterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Export/BundleExporterTests.cs index 8361a8da..32ab4562 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/Export/BundleExporterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Export/BundleExporterTests.cs @@ -2,25 +2,25 @@ using System.Security.Cryptography; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; -using ScadaLink.Transport.Encryption; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.IntegrationTests.Export; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests.Export; /// -/// Integration tests for . +/// Integration tests for . /// Builds a self-contained DI container (in-memory EF + the repositories + /// AddTransport's pipeline) and asserts the exporter round-trips a real bundle /// + writes the matching audit row. Using @@ -47,7 +47,7 @@ public sealed class BundleExporterTests : IDisposable // resolves the same underlying InMemoryStore — otherwise each scope's // DbContext gets a new GUID and the seeded rows vanish between scopes. var dbName = $"BundleExporterTests_{Guid.NewGuid()}"; - services.AddDbContext(opts => + services.AddDbContext(opts => opts.UseInMemoryDatabase(dbName)); // Repositories the resolver pulls from. @@ -79,7 +79,7 @@ public sealed class BundleExporterTests : IDisposable // so the dependency resolver's substring scan picks them up. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var helper = new SharedScript("HelperFn", "return 1;"); ctx.SharedScripts.Add(helper); @@ -122,7 +122,7 @@ public sealed class BundleExporterTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var templateIds = await ctx.Templates.Select(t => t.Id).ToListAsync(); var selection = new ExportSelection( @@ -183,7 +183,7 @@ public sealed class BundleExporterTests : IDisposable // unencrypted export path, EntityId is the SHA-256 of the zip bytes. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var entry = await ctx.AuditLogEntries.SingleAsync(); Assert.Equal("UnencryptedBundleExport", entry.Action); Assert.Equal("alice", entry.User); @@ -203,7 +203,7 @@ public sealed class BundleExporterTests : IDisposable // path, not the dependency resolver. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Solo") { Description = "alone" }); await ctx.SaveChangesAsync(); } @@ -213,7 +213,7 @@ public sealed class BundleExporterTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var ids = await ctx.Templates.Select(t => t.Id).ToListAsync(); var selection = new ExportSelection( TemplateIds: ids, @@ -272,7 +272,7 @@ public sealed class BundleExporterTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var entry = await ctx.AuditLogEntries.SingleAsync(); Assert.Equal("BundleExported", entry.Action); Assert.Equal("bob", entry.User); diff --git a/tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs similarity index 95% rename from tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs index c9e8b2d0..c5b1786f 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterApplyTests.cs @@ -2,21 +2,21 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; -using ScadaLink.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Import; -namespace ScadaLink.Transport.IntegrationTests.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests.Import; /// /// Integration tests for . Reuses the @@ -52,7 +52,7 @@ public sealed class BundleImporterApplyTests : IDisposable // ApplyAsync XML comment for the rollback-safety contract that makes // this safe (single deferred SaveChangesAsync + ChangeTracker.Clear // on catch). - services.AddDbContext(opts => opts + services.AddDbContext(opts => opts .UseInMemoryDatabase(dbName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))); @@ -85,7 +85,7 @@ public sealed class BundleImporterApplyTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var templateIds = await ctx.Templates.Select(t => t.Id).ToListAsync(); var sharedScriptIds = await ctx.SharedScripts.Select(s => s.Id).ToListAsync(); var externalSystemIds = await ctx.ExternalSystemDefinitions.Select(e => e.Id).ToListAsync(); @@ -116,7 +116,7 @@ public sealed class BundleImporterApplyTests : IDisposable private async Task WipeContentAsync() { await using var scope = _provider.CreateAsyncScope(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.RemoveRange(ctx.Templates); ctx.SharedScripts.RemoveRange(ctx.SharedScripts); ctx.TemplateFolders.RemoveRange(ctx.TemplateFolders); @@ -133,7 +133,7 @@ public sealed class BundleImporterApplyTests : IDisposable // the target). await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.SharedScripts.Add(new SharedScript("HelperFn", "return 1;")); ctx.Templates.Add(new Template("Pump") { Description = "fresh" }); await ctx.SaveChangesAsync(); @@ -157,7 +157,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); Assert.Equal(1, await ctx.Templates.CountAsync(t => t.Name == "Pump")); Assert.Equal(1, await ctx.SharedScripts.CountAsync(s => s.Name == "HelperFn")); } @@ -175,14 +175,14 @@ public sealed class BundleImporterApplyTests : IDisposable // restore the description. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "new" }); await ctx.SaveChangesAsync(); } var sessionId = await ExportAndLoadAsync(); await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = await ctx.Templates.SingleAsync(x => x.Name == "Pump"); t.Description = "old"; await ctx.SaveChangesAsync(); @@ -201,7 +201,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = await ctx.Templates.SingleAsync(x => x.Name == "Pump"); Assert.Equal("new", t.Description); } @@ -215,7 +215,7 @@ public sealed class BundleImporterApplyTests : IDisposable // target unchanged and bump Skipped count. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "stable" }); await ctx.SaveChangesAsync(); } @@ -234,7 +234,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); // Exactly one Pump still, with Description unchanged. var t = await ctx.Templates.SingleAsync(x => x.Name == "Pump"); Assert.Equal("stable", t.Description); @@ -251,7 +251,7 @@ public sealed class BundleImporterApplyTests : IDisposable // collide. Apply Rename X→Y. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("X") { Description = "orig" }); await ctx.SaveChangesAsync(); } @@ -271,7 +271,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); Assert.Equal(0, await ctx.Templates.CountAsync(t => t.Name == "X")); Assert.Equal(1, await ctx.Templates.CountAsync(t => t.Name == "Y")); } @@ -286,7 +286,7 @@ public sealed class BundleImporterApplyTests : IDisposable // target, so semantic validation must reject the apply. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("BrokenPump") { Description = "broken" }; t.Scripts.Add(new TemplateScript("init", "var x = MissingHelper();")); ctx.Templates.Add(t); @@ -309,7 +309,7 @@ public sealed class BundleImporterApplyTests : IDisposable // BundleImportFailed row exists. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); Assert.Equal(0, await ctx.Templates.CountAsync()); Assert.True(await ctx.AuditLogEntries.AnyAsync(a => a.Action == "BundleImportFailed")); } @@ -330,7 +330,7 @@ public sealed class BundleImporterApplyTests : IDisposable // accidentally leave plaintext in the store). await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("PumpForT007") { Description = "fresh" }); await ctx.SaveChangesAsync(); } @@ -356,7 +356,7 @@ public sealed class BundleImporterApplyTests : IDisposable // ApplyAsync must carry the same BundleImportId as the returned result. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.SharedScripts.Add(new SharedScript("HelperFn", "return 1;")); ctx.Templates.Add(new Template("Pump") { Description = "fresh" }); await ctx.SaveChangesAsync(); @@ -370,7 +370,7 @@ public sealed class BundleImporterApplyTests : IDisposable int beforeMaxId; await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); beforeMaxId = await ctx.AuditLogEntries.MaxAsync(a => (int?)a.Id) ?? 0; } @@ -391,7 +391,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var newRows = await ctx.AuditLogEntries.Where(a => a.Id > beforeMaxId).ToListAsync(); // We expect at least: TemplateCreated + SharedScriptCreated + BundleImported. Assert.True(newRows.Count >= 3, @@ -406,7 +406,7 @@ public sealed class BundleImporterApplyTests : IDisposable { await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "fresh" }); await ctx.SaveChangesAsync(); } @@ -427,7 +427,7 @@ public sealed class BundleImporterApplyTests : IDisposable // its AfterStateJson, and carries the BundleImportId from the result. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var row = await ctx.AuditLogEntries.SingleOrDefaultAsync(a => a.Action == "BundleImported"); Assert.NotNull(row); Assert.Equal("Bundle", row!.EntityType); @@ -448,7 +448,7 @@ public sealed class BundleImporterApplyTests : IDisposable // disowned from the failure record). await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("BrokenPump") { Description = "broken" }; t.Scripts.Add(new TemplateScript("init", "var x = MissingHelper();")); ctx.Templates.Add(t); @@ -470,7 +470,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var row = await ctx.AuditLogEntries.SingleOrDefaultAsync(a => a.Action == "BundleImportFailed"); Assert.NotNull(row); Assert.Equal("Bundle", row!.EntityType); @@ -496,7 +496,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Scripts: [Init (Code="return 1;")] await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("Pump") { Description = "from-bundle" }; t.Attributes.Add(new TemplateAttribute("SetPoint") { DataType = DataType.Float, Value = "50.0" }); t.Attributes.Add(new TemplateAttribute("Pressure") { DataType = DataType.Float, Value = "100.0" }); @@ -515,7 +515,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Description also mutated so the scalar field still flips. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var pump = await ctx.Templates .Include(t => t.Attributes) .Include(t => t.Alarms) @@ -550,7 +550,7 @@ public sealed class BundleImporterApplyTests : IDisposable int beforeMaxAuditId; await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); beforeMaxAuditId = await ctx.AuditLogEntries.MaxAsync(a => (int?)a.Id) ?? 0; } @@ -567,7 +567,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert — children mirror the bundle. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var pump = await ctx.Templates .Include(t => t.Attributes) .Include(t => t.Alarms) @@ -641,7 +641,7 @@ public sealed class BundleImporterApplyTests : IDisposable // ] await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var sys = new ExternalSystemDefinition("Erp", "https://erp.example", "ApiKey"); ctx.ExternalSystemDefinitions.Add(sys); await ctx.SaveChangesAsync(); @@ -669,7 +669,7 @@ public sealed class BundleImporterApplyTests : IDisposable // EndpointUrl / AuthType also mutated so the scalar update still fires. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var sys = await ctx.ExternalSystemDefinitions.SingleAsync(e => e.Name == "Erp"); sys.EndpointUrl = "https://wrong.example"; sys.AuthType = "Basic"; @@ -693,7 +693,7 @@ public sealed class BundleImporterApplyTests : IDisposable int beforeMaxAuditId; await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); beforeMaxAuditId = await ctx.AuditLogEntries.MaxAsync(a => (int?)a.Id) ?? 0; } @@ -710,7 +710,7 @@ public sealed class BundleImporterApplyTests : IDisposable // Assert — methods mirror the bundle exactly. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var sys = await ctx.ExternalSystemDefinitions.SingleAsync(e => e.Name == "Erp"); Assert.Equal("https://erp.example", sys.EndpointUrl); diff --git a/tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterPreviewTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterPreviewTests.cs similarity index 93% rename from tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterPreviewTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterPreviewTests.cs index ddf010ee..48b35ed6 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterPreviewTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterPreviewTests.cs @@ -1,22 +1,22 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; -namespace ScadaLink.Transport.IntegrationTests.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests.Import; /// -/// Integration tests for . +/// Integration tests for . /// Reuses the same in-memory host pattern as the exporter tests: real /// repositories, real EF in-memory provider, real Transport pipeline. Each test /// seeds the target DB, exports a bundle, then loads + previews it via the @@ -33,7 +33,7 @@ public sealed class BundleImporterPreviewTests : IDisposable new ConfigurationBuilder().AddInMemoryCollection().Build()); var dbName = $"BundleImporterPreviewTests_{Guid.NewGuid()}"; - services.AddDbContext(opts => opts.UseInMemoryDatabase(dbName)); + services.AddDbContext(opts => opts.UseInMemoryDatabase(dbName)); services.AddScoped(); services.AddScoped(); @@ -52,7 +52,7 @@ public sealed class BundleImporterPreviewTests : IDisposable { await using var scope = _provider.CreateAsyncScope(); var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var ids = await ctx.Templates.Select(t => t.Id).ToListAsync(); var selection = new ExportSelection( TemplateIds: ids, @@ -84,7 +84,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // should classify it as Identical. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "stable" }); await ctx.SaveChangesAsync(); } @@ -116,7 +116,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // Description field. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "new" }); await ctx.SaveChangesAsync(); } @@ -128,7 +128,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // something to report. The bundle still carries Description="new". await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = await ctx.Templates.SingleAsync(x => x.Name == "Pump"); t.Description = "old"; await ctx.SaveChangesAsync(); @@ -159,7 +159,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // classify it as New (target is now empty). await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.Add(new Template("Pump") { Description = "to-be-deleted" }); await ctx.SaveChangesAsync(); } @@ -169,7 +169,7 @@ public sealed class BundleImporterPreviewTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = await ctx.Templates.SingleAsync(); ctx.Templates.Remove(t); await ctx.SaveChangesAsync(); @@ -205,7 +205,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // matters for entity discovery, the body text is preserved verbatim. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.SharedScripts.Add(new SharedScript("HelperFn", "return 1;")); ctx.ExternalSystemDefinitions.Add(new ExternalSystemDefinition("ErpSystem", "https://erp.example", "ApiKey")); @@ -224,7 +224,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // HelperFn since it's in the target.) await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); // Keep HelperFn + ErpSystem so they're in the target's resolved set. // Just confirm via assertion that MissingHelper is the blocker name. await ctx.SaveChangesAsync(); @@ -261,7 +261,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // device's address space and are not script-callable. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("Pump") { Description = "tag-path-check" }; t.Attributes.Add(new TemplateAttribute("Level") { @@ -299,7 +299,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // heuristic was flagging every one of them. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("Pump") { Description = "noise-check" }; t.Scripts.Add(new TemplateScript("init", """ var now = DateTimeOffset.UtcNow; @@ -351,7 +351,7 @@ public sealed class BundleImporterPreviewTests : IDisposable // any child rows compared to the per-name fetch). await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var pump = new Template("Pump") { Description = "p1" }; pump.Attributes.Add(new TemplateAttribute("Flow")); pump.Scripts.Add(new TemplateScript("init", "return 1;")); diff --git a/tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterRollbackFailureTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterRollbackFailureTests.cs similarity index 89% rename from tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterRollbackFailureTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterRollbackFailureTests.cs index c8c18782..f2ef3e8c 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/Import/BundleImporterRollbackFailureTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/Import/BundleImporterRollbackFailureTests.cs @@ -6,20 +6,20 @@ using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Deployment; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; -using ScadaLink.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Deployment; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Import; -namespace ScadaLink.Transport.IntegrationTests.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests.Import; /// /// Covers the catch-path invariant in : @@ -65,19 +65,19 @@ public sealed class BundleImporterRollbackFailureTests : IDisposable // Register options once under the BASE DbContextOptions key, then // register the subclass as the scoped service used by repositories + // AuditService + BundleImporter. The subclass's ctor accepts - // DbContextOptions (the base type's options) so the + // DbContextOptions (the base type's options) so the // single options registration serves both. This avoids the multi-options // pitfall of AddDbContext which keys options on TImpl. services.AddSingleton(sp => { - var builder = new DbContextOptionsBuilder(); + var builder = new DbContextOptionsBuilder(); builder.UseSqlite(_sharedConnection); builder.ConfigureWarnings(w => w.Ignore(RelationalEventId.PendingModelChangesWarning)); builder.AddInterceptors(_interceptor); return builder.Options; }); - services.AddScoped(sp => new SqliteCompatibleScadaLinkDbContext( - sp.GetRequiredService>(), + services.AddScoped(sp => new SqliteCompatibleScadaBridgeDbContext( + sp.GetRequiredService>(), sp.GetRequiredService())); services.AddScoped(); @@ -92,7 +92,7 @@ public sealed class BundleImporterRollbackFailureTests : IDisposable // Build schema once on the shared connection. using var scope = _provider.CreateScope(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Database.EnsureCreated(); } @@ -112,7 +112,7 @@ public sealed class BundleImporterRollbackFailureTests : IDisposable // survive a rollback failure. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("BrokenPump") { Description = "broken" }; t.Scripts.Add(new TemplateScript("init", "var x = MissingHelper();")); ctx.Templates.Add(t); @@ -145,7 +145,7 @@ public sealed class BundleImporterRollbackFailureTests : IDisposable _interceptor.ThrowOnRollback = false; // let post-condition reads roll back cleanly await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var failed = await ctx.AuditLogEntries .SingleOrDefaultAsync(a => a.Action == "BundleImportFailed"); Assert.NotNull(failed); @@ -172,7 +172,7 @@ public sealed class BundleImporterRollbackFailureTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var templateIds = await ctx.Templates.Select(t => t.Id).ToListAsync(); var selection = new ExportSelection( TemplateIds: templateIds, @@ -201,7 +201,7 @@ public sealed class BundleImporterRollbackFailureTests : IDisposable private async Task WipeContentAsync() { await using var scope = _provider.CreateAsyncScope(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.Templates.RemoveRange(ctx.Templates); ctx.SharedScripts.RemoveRange(ctx.SharedScripts); ctx.TemplateFolders.RemoveRange(ctx.TemplateFolders); @@ -250,16 +250,16 @@ public sealed class BundleImporterRollbackFailureTests : IDisposable } /// -/// SQLite-compatible variant of used by +/// SQLite-compatible variant of used by /// . Mirrors the adaptations in -/// SqliteTestDbContext over in ScadaLink.ConfigurationDatabase.Tests +/// SqliteTestDbContext over in ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Tests /// (rowversion is nullable, DateTimeOffset stored as ISO 8601 text) but is /// duplicated here to avoid taking a project reference to that test project. /// -internal sealed class SqliteCompatibleScadaLinkDbContext : ScadaLinkDbContext +internal sealed class SqliteCompatibleScadaBridgeDbContext : ScadaBridgeDbContext { - public SqliteCompatibleScadaLinkDbContext( - DbContextOptions options, + public SqliteCompatibleScadaBridgeDbContext( + DbContextOptions options, IDataProtectionProvider dataProtectionProvider) : base(options, dataProtectionProvider) { diff --git a/tests/ScadaLink.Transport.IntegrationTests/RoundTripTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/RoundTripTests.cs similarity index 93% rename from tests/ScadaLink.Transport.IntegrationTests/RoundTripTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/RoundTripTests.cs index bc3b6377..029a1556 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/RoundTripTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/RoundTripTests.cs @@ -2,21 +2,21 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests; /// /// T25 — full export→wipe→import round-trip through the real DI pipeline. @@ -45,7 +45,7 @@ public sealed class RoundTripTests : IDisposable // Same db across all scopes — see BundleExporterTests for the rationale. var dbName = $"RoundTripTests_{Guid.NewGuid()}"; - services.AddDbContext(opts => opts + services.AddDbContext(opts => opts .UseInMemoryDatabase(dbName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))); @@ -71,7 +71,7 @@ public sealed class RoundTripTests : IDisposable // NotificationList. ---- await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.SharedScripts.Add(new SharedScript("HelperFn", "return 1;")); ctx.ExternalSystemDefinitions.Add( @@ -108,7 +108,7 @@ public sealed class RoundTripTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var templateIds = await ctx.Templates.Select(t => t.Id).ToListAsync(); var sharedScriptIds = await ctx.SharedScripts.Select(s => s.Id).ToListAsync(); @@ -154,7 +154,7 @@ public sealed class RoundTripTests : IDisposable // whole table unambiguously. ---- await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.TemplateCompositions.RemoveRange(ctx.TemplateCompositions); ctx.TemplateScripts.RemoveRange(ctx.TemplateScripts); @@ -206,7 +206,7 @@ public sealed class RoundTripTests : IDisposable // ---- 8. Assertions ---- await using (var assertScope = _provider.CreateAsyncScope()) { - var ctx = assertScope.ServiceProvider.GetRequiredService(); + var ctx = assertScope.ServiceProvider.GetRequiredService(); // 8a. Original entities are all back. Re-query by name and spot-check // the surviving key fields. diff --git a/tests/ScadaLink.Transport.IntegrationTests/SemanticValidatorImportTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/SemanticValidatorImportTests.cs similarity index 92% rename from tests/ScadaLink.Transport.IntegrationTests/SemanticValidatorImportTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/SemanticValidatorImportTests.cs index 01997462..9e7e4bf3 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/SemanticValidatorImportTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/SemanticValidatorImportTests.cs @@ -2,19 +2,19 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; -using ScadaLink.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Import; -namespace ScadaLink.Transport.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests; /// /// FU-C — integration tests for the two-tier semantic validation wired into @@ -43,7 +43,7 @@ public sealed class SemanticValidatorImportTests : IDisposable new ConfigurationBuilder().AddInMemoryCollection().Build()); var dbName = $"SemanticValidatorImportTests_{Guid.NewGuid()}"; - services.AddDbContext(opts => opts + services.AddDbContext(opts => opts .UseInMemoryDatabase(dbName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))); @@ -72,7 +72,7 @@ public sealed class SemanticValidatorImportTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var ids = await ctx.Templates.Select(t => t.Id).ToListAsync(); var selection = new ExportSelection( TemplateIds: ids, @@ -96,7 +96,7 @@ public sealed class SemanticValidatorImportTests : IDisposable // Wipe so the apply is exercising the Add path. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.TemplateAlarms.RemoveRange(ctx.TemplateAlarms); ctx.TemplateScripts.RemoveRange(ctx.TemplateScripts); ctx.TemplateAttributes.RemoveRange(ctx.TemplateAttributes); @@ -127,7 +127,7 @@ public sealed class SemanticValidatorImportTests : IDisposable // doesn't exist). Pass 1 catches it first and fails fast. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("ScriptCallsUnknown"); t.Scripts.Add(new Commons.Entities.Templates.TemplateScript( "init", @@ -161,7 +161,7 @@ public sealed class SemanticValidatorImportTests : IDisposable // Rollback — no template row landed. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); Assert.False(await ctx.Templates.AnyAsync(t => t.Name == "ScriptCallsUnknown")); } } @@ -175,7 +175,7 @@ public sealed class SemanticValidatorImportTests : IDisposable // Pass 1 doesn't scan alarm JSON, so the error reaches Pass 2. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("TankWithBadAlarm") { Description = "RangeViolation on string attr" }; t.Attributes.Add(new TemplateAttribute("Status") { @@ -218,7 +218,7 @@ public sealed class SemanticValidatorImportTests : IDisposable // Rollback — no template row landed. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); Assert.False(await ctx.Templates.AnyAsync(t => t.Name == "TankWithBadAlarm")); } } @@ -233,7 +233,7 @@ public sealed class SemanticValidatorImportTests : IDisposable // legal. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("CleanPump") { Description = "passes both passes" }; t.Attributes.Add(new TemplateAttribute("Speed") { @@ -272,7 +272,7 @@ public sealed class SemanticValidatorImportTests : IDisposable Assert.Equal(1, result.Added); await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); Assert.True(await ctx.Templates.AnyAsync(t => t.Name == "CleanPump")); Assert.True(await ctx.TemplateAlarms.AnyAsync(a => a.Name == "Overspeed")); } diff --git a/tests/ScadaLink.Transport.IntegrationTests/ValidationFailureTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ValidationFailureTests.cs similarity index 89% rename from tests/ScadaLink.Transport.IntegrationTests/ValidationFailureTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ValidationFailureTests.cs index bfacca50..fc4a7d09 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/ValidationFailureTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ValidationFailureTests.cs @@ -2,19 +2,19 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.ConfigurationDatabase.Repositories; -using ScadaLink.ConfigurationDatabase.Services; -using ScadaLink.Transport; -using ScadaLink.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Repositories; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Services; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Import; -namespace ScadaLink.Transport.IntegrationTests; +namespace ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests; /// /// T26 — integration validation-failure rollback test. Complements the unit @@ -33,7 +33,7 @@ public sealed class ValidationFailureTests : IDisposable new ConfigurationBuilder().AddInMemoryCollection().Build()); var dbName = $"ValidationFailureTests_{Guid.NewGuid()}"; - services.AddDbContext(opts => opts + services.AddDbContext(opts => opts .UseInMemoryDatabase(dbName) .ConfigureWarnings(w => w.Ignore(InMemoryEventId.TransactionIgnoredWarning))); @@ -62,7 +62,7 @@ public sealed class ValidationFailureTests : IDisposable // - Snapshot row counts so the rollback assertion is unambiguous. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var t = new Template("BrokenPump") { Description = "calls a missing helper" }; t.Scripts.Add(new TemplateScript("init", "var x = MissingHelper();")); ctx.Templates.Add(t); @@ -75,7 +75,7 @@ public sealed class ValidationFailureTests : IDisposable await using (var scope = _provider.CreateAsyncScope()) { var exporter = scope.ServiceProvider.GetRequiredService(); - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); var ids = await ctx.Templates.Select(t => t.Id).ToListAsync(); var selection = new ExportSelection( TemplateIds: ids, @@ -100,7 +100,7 @@ public sealed class ValidationFailureTests : IDisposable // not let it land). await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); ctx.TemplateScripts.RemoveRange(ctx.TemplateScripts); ctx.Templates.RemoveRange(ctx.Templates); ctx.SharedScripts.RemoveRange(ctx.SharedScripts); @@ -111,7 +111,7 @@ public sealed class ValidationFailureTests : IDisposable int sharedScriptsBefore; await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); templatesBefore = await ctx.Templates.CountAsync(); sharedScriptsBefore = await ctx.SharedScripts.CountAsync(); } @@ -151,7 +151,7 @@ public sealed class ValidationFailureTests : IDisposable // 2. No new Template or SharedScript row was committed. await using (var scope = _provider.CreateAsyncScope()) { - var ctx = scope.ServiceProvider.GetRequiredService(); + var ctx = scope.ServiceProvider.GetRequiredService(); Assert.Equal(templatesBefore, await ctx.Templates.CountAsync()); Assert.Equal(sharedScriptsBefore, await ctx.SharedScripts.CountAsync()); diff --git a/tests/ScadaLink.Transport.IntegrationTests/ScadaLink.Transport.IntegrationTests.csproj b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests.csproj similarity index 82% rename from tests/ScadaLink.Transport.IntegrationTests/ScadaLink.Transport.IntegrationTests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests.csproj index 16cc072d..76aff358 100644 --- a/tests/ScadaLink.Transport.IntegrationTests/ScadaLink.Transport.IntegrationTests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests/ZB.MOM.WW.ScadaBridge.Transport.IntegrationTests.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/tests/ScadaLink.Transport.Tests/Encryption/BundleSecretEncryptorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Encryption/BundleSecretEncryptorTests.cs similarity index 96% rename from tests/ScadaLink.Transport.Tests/Encryption/BundleSecretEncryptorTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Encryption/BundleSecretEncryptorTests.cs index 0808ab24..9e3b6627 100644 --- a/tests/ScadaLink.Transport.Tests/Encryption/BundleSecretEncryptorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Encryption/BundleSecretEncryptorTests.cs @@ -1,9 +1,9 @@ using System.Security.Cryptography; using System.Text; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; -namespace ScadaLink.Transport.Tests.Encryption; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Encryption; public sealed class BundleSecretEncryptorTests { diff --git a/tests/ScadaLink.Transport.Tests/Export/DependencyResolverTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Export/DependencyResolverTests.cs similarity index 95% rename from tests/ScadaLink.Transport.Tests/Export/DependencyResolverTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Export/DependencyResolverTests.cs index d8ec8575..54bd8465 100644 --- a/tests/ScadaLink.Transport.Tests/Export/DependencyResolverTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Export/DependencyResolverTests.cs @@ -1,13 +1,13 @@ using NSubstitute; -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Transport.Export; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Export; -namespace ScadaLink.Transport.Tests.Export; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Export; public sealed class DependencyResolverTests { diff --git a/tests/ScadaLink.Transport.Tests/Import/BundleImporterLoadTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleImporterLoadTests.cs similarity index 97% rename from tests/ScadaLink.Transport.Tests/Import/BundleImporterLoadTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleImporterLoadTests.cs index 04d1d237..ccbccb8a 100644 --- a/tests/ScadaLink.Transport.Tests/Import/BundleImporterLoadTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleImporterLoadTests.cs @@ -5,17 +5,17 @@ using System.Text.Json.Serialization; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; using NSubstitute; -using ScadaLink.Commons.Interfaces.Repositories; -using ScadaLink.Commons.Interfaces.Services; -using ScadaLink.Commons.Interfaces.Transport; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.ConfigurationDatabase; -using ScadaLink.TemplateEngine.Validation; -using ScadaLink.Transport.Encryption; -using ScadaLink.Transport.Import; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services; +using ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Transport; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.ConfigurationDatabase; +using ZB.MOM.WW.ScadaBridge.TemplateEngine.Validation; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.Tests.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Import; /// /// Unit tests for . Uses the real @@ -117,8 +117,8 @@ public sealed class BundleImporterLoadTests // LoadAsync never touches the DbContext — Preview/Apply do. Build // a no-provider DbContext so the importer's null check passes; // the in-memory provider isn't worth pulling in for unit tests. - dbContext: new ScadaLinkDbContext( - new DbContextOptionsBuilder().Options), + dbContext: new ScadaBridgeDbContext( + new DbContextOptionsBuilder().Options), semanticValidator: new SemanticValidator()); return new TestRig(importer, serializer, manifestBuilder, encryptor, store, opts); @@ -447,7 +447,7 @@ public sealed class BundleImporterLoadTests CreatedAtUtc: DateTimeOffset.UtcNow, SourceEnvironment: "dev", ExportedBy: "alice", - ScadaLinkVersion: "1.0.0", + ScadaBridgeVersion: "1.0.0", ContentHash: "sha256:" + Convert.ToHexString(SHA256.HashData(contentBytes)).ToLowerInvariant(), Encryption: null, Summary: new BundleSummary(0, 0, 0, 0, 0, 0, 0, 0, 0), diff --git a/tests/ScadaLink.Transport.Tests/Import/BundleSessionStoreTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleSessionStoreTests.cs similarity index 97% rename from tests/ScadaLink.Transport.Tests/Import/BundleSessionStoreTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleSessionStoreTests.cs index 3954c27b..69deaef7 100644 --- a/tests/ScadaLink.Transport.Tests/Import/BundleSessionStoreTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleSessionStoreTests.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Options; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Transport; -using ScadaLink.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Import; -namespace ScadaLink.Transport.Tests.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Import; public sealed class BundleSessionStoreTests { @@ -23,7 +23,7 @@ public sealed class BundleSessionStoreTests CreatedAtUtc: DateTimeOffset.UnixEpoch, SourceEnvironment: "test", ExportedBy: "t", - ScadaLinkVersion: "1", + ScadaBridgeVersion: "1", ContentHash: "0", Encryption: null, Summary: new BundleSummary(0, 0, 0, 0, 0, 0, 0, 0, 0), diff --git a/tests/ScadaLink.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs similarity index 98% rename from tests/ScadaLink.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs index 9579f06f..f480bdcf 100644 --- a/tests/ScadaLink.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Import/BundleUnlockRateLimiterTests.cs @@ -1,6 +1,6 @@ -using ScadaLink.Transport.Import; +using ZB.MOM.WW.ScadaBridge.Transport.Import; -namespace ScadaLink.Transport.Tests.Import; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Import; /// /// Transport-004: must enforce a per-key cap diff --git a/tests/ScadaLink.Transport.Tests/Serialization/BundleSerializerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/BundleSerializerTests.cs similarity index 96% rename from tests/ScadaLink.Transport.Tests/Serialization/BundleSerializerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/BundleSerializerTests.cs index c3846287..6f7a9113 100644 --- a/tests/ScadaLink.Transport.Tests/Serialization/BundleSerializerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/BundleSerializerTests.cs @@ -1,10 +1,10 @@ using System.IO.Compression; using System.Security.Cryptography; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Transport.Encryption; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Encryption; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.Tests.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Serialization; public sealed class BundleSerializerTests { diff --git a/tests/ScadaLink.Transport.Tests/Serialization/EntitySerializerTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/EntitySerializerTests.cs similarity index 95% rename from tests/ScadaLink.Transport.Tests/Serialization/EntitySerializerTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/EntitySerializerTests.cs index d9b00db3..b6c1bb93 100644 --- a/tests/ScadaLink.Transport.Tests/Serialization/EntitySerializerTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/EntitySerializerTests.cs @@ -1,12 +1,12 @@ -using ScadaLink.Commons.Entities.ExternalSystems; -using ScadaLink.Commons.Entities.InboundApi; -using ScadaLink.Commons.Entities.Notifications; -using ScadaLink.Commons.Entities.Scripts; -using ScadaLink.Commons.Entities.Templates; -using ScadaLink.Commons.Types.Enums; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.ExternalSystems; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.InboundApi; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Notifications; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts; +using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.Tests.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Serialization; public sealed class EntitySerializerTests { diff --git a/tests/ScadaLink.Transport.Tests/Serialization/ManifestBuilderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/ManifestBuilderTests.cs similarity index 92% rename from tests/ScadaLink.Transport.Tests/Serialization/ManifestBuilderTests.cs rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/ManifestBuilderTests.cs index 46a6e551..31de5388 100644 --- a/tests/ScadaLink.Transport.Tests/Serialization/ManifestBuilderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/Serialization/ManifestBuilderTests.cs @@ -1,9 +1,9 @@ using System.Security.Cryptography; using System.Text; -using ScadaLink.Commons.Types.Transport; -using ScadaLink.Transport.Serialization; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Transport; +using ZB.MOM.WW.ScadaBridge.Transport.Serialization; -namespace ScadaLink.Transport.Tests.Serialization; +namespace ZB.MOM.WW.ScadaBridge.Transport.Tests.Serialization; public sealed class ManifestBuilderTests { @@ -28,7 +28,7 @@ public sealed class ManifestBuilderTests Assert.Equal(contents, manifest.Contents); Assert.Equal("env", manifest.SourceEnvironment); Assert.Equal("user", manifest.ExportedBy); - Assert.Equal("1.0.0", manifest.ScadaLinkVersion); + Assert.Equal("1.0.0", manifest.ScadaBridgeVersion); Assert.Equal(1, manifest.BundleFormatVersion); Assert.Equal("1.0", manifest.SchemaVersion); Assert.Null(manifest.Encryption); @@ -57,7 +57,7 @@ public sealed class ManifestBuilderTests CreatedAtUtc: DateTimeOffset.UtcNow, SourceEnvironment: "env", ExportedBy: "u", - ScadaLinkVersion: "v", + ScadaBridgeVersion: "v", ContentHash: hash, Encryption: null, Summary: EmptySummary, @@ -78,7 +78,7 @@ public sealed class ManifestBuilderTests CreatedAtUtc: DateTimeOffset.UtcNow, SourceEnvironment: "env", ExportedBy: "u", - ScadaLinkVersion: "v", + ScadaBridgeVersion: "v", ContentHash: "sha256:deadbeef", Encryption: null, Summary: EmptySummary, diff --git a/tests/ScadaLink.Transport.Tests/ScadaLink.Transport.Tests.csproj b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/ZB.MOM.WW.ScadaBridge.Transport.Tests.csproj similarity index 89% rename from tests/ScadaLink.Transport.Tests/ScadaLink.Transport.Tests.csproj rename to tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/ZB.MOM.WW.ScadaBridge.Transport.Tests.csproj index 328d650b..3273bf38 100644 --- a/tests/ScadaLink.Transport.Tests/ScadaLink.Transport.Tests.csproj +++ b/tests/ZB.MOM.WW.ScadaBridge.Transport.Tests/ZB.MOM.WW.ScadaBridge.Transport.Tests.csproj @@ -25,7 +25,7 @@ - + diff --git a/tools/rename-to-scadabridge.sh b/tools/rename-to-scadabridge.sh new file mode 100755 index 00000000..a63681f8 --- /dev/null +++ b/tools/rename-to-scadabridge.sh @@ -0,0 +1,126 @@ +#!/usr/bin/env bash +# tools/rename-to-scadabridge.sh +# +# Renames the codebase from ScadaLink → ZB.MOM.WW.ScadaBridge. +# Multi-pass substitution, most-specific-first to avoid double-replacement. +# Operates on git-tracked files only (skips .git/, untracked, binaries via git grep). +# +# Usage: +# tools/rename-to-scadabridge.sh --dry-run # print affected files, no changes +# tools/rename-to-scadabridge.sh # apply text substitutions + git mv folder/file moves +# +# After running, follow with: +# dotnet restore +# dotnet build ZB.MOM.WW.ScadaBridge.slnx +# +# See docs/plans/2026-05-28-scadabridge-rename-design.md for the full design. + +set -euo pipefail + +cd "$(git rev-parse --show-toplevel)" + +DRY_RUN=0 +if [[ "${1:-}" == "--dry-run" ]]; then + DRY_RUN=1 + echo "DRY RUN mode: no changes will be made" + echo +fi + +# Exclude the design doc itself from text substitutions — it documents the +# rename and contains both old and new names on purpose. +EXCLUDE=(':(exclude)docs/plans/2026-05-28-scadabridge-rename-design.md') + +run_sed() { + local pattern="$1" + local replacement="$2" + local desc="$3" + + # git grep with --fixed-strings finds files containing the literal pattern. + # It's binary-aware and respects .gitignore. + local file_list + file_list=$(git grep -l --fixed-strings -- "$pattern" "${EXCLUDE[@]}" 2>/dev/null || true) + + local count=0 + if [[ -n "$file_list" ]]; then + count=$(printf '%s\n' "$file_list" | wc -l | tr -d ' ') + fi + + if [[ "$count" -eq 0 ]]; then + printf ' %-50s no files match\n' "$desc" + return + fi + + printf ' %-50s %d files\n' "$desc" "$count" + + if [[ "$DRY_RUN" -eq 1 ]]; then + printf '%s\n' "$file_list" | head -5 | sed 's/^/ /' + [[ "$count" -gt 5 ]] && echo " ... ($((count - 5)) more)" + return + fi + + # Escape pattern (BRE metacharacters) and replacement (& \ /). + local esc_pattern esc_replacement + esc_pattern=$(printf '%s' "$pattern" | sed 's/[][\.*^$/]/\\&/g') + esc_replacement=$(printf '%s' "$replacement" | sed 's/[\&/]/\\&/g') + + printf '%s\n' "$file_list" | tr '\n' '\0' | xargs -0 sed -i '' -e "s/$esc_pattern/$esc_replacement/g" +} + +echo "=== Phase B: text substitutions ===" +# Order matters: most-specific patterns first so later passes don't catch substrings. +run_sed "ScadaLinkDbContext" "ScadaBridgeDbContext" "1. ScadaLinkDbContext" +run_sed "ScadaLinkMachineData" "ScadaBridgeMachineData" "2. ScadaLinkMachineData" +run_sed "ScadaLinkConfig" "ScadaBridgeConfig" "3. ScadaLinkConfig" +run_sed "ScadaLink." "ZB.MOM.WW.ScadaBridge." "4. ScadaLink. (namespace/path)" +run_sed "ScadaLink" "ScadaBridge" "5. ScadaLink (bare ident)" +run_sed "scadalink-" "scadabridge-" "6. scadalink- (container/network)" +run_sed "scadalink:" "scadabridge:" "7. scadalink: (image tag)" +run_sed ".scadalink/" ".scadabridge/" "8. .scadalink/ (CLI config dir)" +run_sed "scadalink" "scadabridge" "9. scadalink (bare lowercase)" + +if [[ "$DRY_RUN" -eq 1 ]]; then + echo + echo "DRY RUN complete. No file moves performed." + exit 0 +fi + +echo +echo "=== Phase C: file/folder moves ===" + +# Rename project folders: src/ScadaLink.X → src/ZB.MOM.WW.ScadaBridge.X (and tests/) +shopt -s nullglob +for old in src/ScadaLink.* tests/ScadaLink.*; do + [[ -d "$old" ]] || continue + new="${old/ScadaLink./ZB.MOM.WW.ScadaBridge.}" + echo " git mv $old $new" + git mv "$old" "$new" +done + +# Rename .csproj files inside each renamed folder +for d in src/ZB.MOM.WW.ScadaBridge.* tests/ZB.MOM.WW.ScadaBridge.*; do + [[ -d "$d" ]] || continue + for csproj in "$d"/ScadaLink.*.csproj; do + [[ -f "$csproj" ]] || continue + newcsproj="${csproj/ScadaLink./ZB.MOM.WW.ScadaBridge.}" + echo " git mv $csproj $newcsproj" + git mv "$csproj" "$newcsproj" + done +done + +# Rename .cs files whose basename starts with ScadaLink (DbContext, WebApplicationFactory, snapshot). +while IFS= read -r f; do + new="${f//ScadaLink/ScadaBridge}" + echo " git mv $f $new" + git mv "$f" "$new" +done < <(git ls-files | awk -F/ '$NF ~ /^ScadaLink[A-Za-z]+\.cs$/') + +# Rename solution file. +if [[ -f "ScadaLink.slnx" ]]; then + echo " git mv ScadaLink.slnx ZB.MOM.WW.ScadaBridge.slnx" + git mv ScadaLink.slnx ZB.MOM.WW.ScadaBridge.slnx +fi + +shopt -u nullglob + +echo +echo "=== Done. Next: dotnet restore && dotnet build ZB.MOM.WW.ScadaBridge.slnx ==="