refactor: rename ScadaLink → ZB.MOM.WW.ScadaBridge (code + projects + namespaces)
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
## 1. Scope
|
||||
|
||||
This phase establishes the buildable, testable baseline for the entire ScadaLink system before any domain logic is implemented. It delivers:
|
||||
This phase establishes the buildable, testable baseline for the entire ScadaBridge system before any domain logic is implemented. It delivers:
|
||||
|
||||
- A .NET 10 solution with all 17 component projects and corresponding test projects, using the SLNX format.
|
||||
- The Commons component with its complete namespace/folder skeleton, shared data types, entity POCOs, repository interfaces, cross-cutting service interfaces, message contracts, and protocol abstraction interfaces.
|
||||
@@ -119,7 +119,7 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
- `[COM-5b-5]` `Interfaces/Services/` for cross-cutting service interfaces (IAuditService).
|
||||
- `[COM-5b-6]` `Entities/` subfolders by domain area: Templates, Instances, Sites, ExternalSystems, Notifications, InboundApi, Security, Deployment, Scripts, Audit.
|
||||
- `[COM-5b-7]` `Messages/` subfolders by concern: Deployment, Lifecycle, Health, Communication, Streaming, DebugView, ScriptExecution, Artifacts.
|
||||
- `[COM-5b-8]` Namespaces mirror folder structure (e.g., `ScadaLink.Commons.Entities.Templates`).
|
||||
- `[COM-5b-8]` Namespaces mirror folder structure (e.g., `ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates`).
|
||||
- `[COM-5b-9]` Interface names use `I` prefix.
|
||||
- `[COM-5b-10]` Entity classes named after domain concept — no `Entity` or `Model` suffixes.
|
||||
- `[COM-5b-11]` Message contracts named as commands, events, or responses.
|
||||
@@ -157,10 +157,10 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
### REQ-HOST-3: Configuration Binding (Phase 0 skeleton)
|
||||
|
||||
- `[HOST-3-1]` Bind configuration sections from `appsettings.json` to strongly-typed options classes using .NET Options pattern.
|
||||
- `[HOST-3-2]` Infrastructure sections: `ScadaLink:Node` (NodeOptions), `ScadaLink:Cluster` (ClusterOptions), `ScadaLink:Database` (DatabaseOptions).
|
||||
- `[HOST-3-2]` Infrastructure sections: `ScadaBridge:Node` (NodeOptions), `ScadaBridge:Cluster` (ClusterOptions), `ScadaBridge:Database` (DatabaseOptions).
|
||||
- `[HOST-3-3]` Per-component sections: DataConnection, StoreAndForward, HealthMonitoring, SiteEventLog, Communication, Security, InboundApi, Notification, Logging.
|
||||
- `[HOST-3-4]` Each component defines its own options class in its own project.
|
||||
- `[HOST-3-5]` Host binds via `services.Configure<T>(configuration.GetSection("ScadaLink:<ComponentName>"))`.
|
||||
- `[HOST-3-5]` Host binds via `services.Configure<T>(configuration.GetSection("ScadaBridge:<ComponentName>"))`.
|
||||
- `[HOST-3-6]` Components read options via `IOptions<T>` — never `IConfiguration` directly (negative).
|
||||
|
||||
### REQ-HOST-7: ASP.NET vs Generic Host (Phase 0 skeleton)
|
||||
@@ -223,8 +223,8 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
- 1 Host project (console/web application) exists under `src/`.
|
||||
- 17 corresponding test projects exist under `tests/` (one per component + Commons + Host, xUnit).
|
||||
- SLNX solution file at the repository root includes all 17 source projects and 17 test projects.
|
||||
- All 15 component library projects have a project reference to `ScadaLink.Commons`.
|
||||
- `ScadaLink.Host` has project references to all 15 component library projects + Commons (16 total).
|
||||
- All 15 component library projects have a project reference to `ZB.MOM.WW.ScadaBridge.Commons`.
|
||||
- `ZB.MOM.WW.ScadaBridge.Host` has project references to all 15 component library projects + Commons (16 total).
|
||||
- `dotnet build` succeeds with zero errors and zero warnings.
|
||||
- `dotnet test` succeeds (no tests yet, but framework is wired).
|
||||
|
||||
@@ -242,7 +242,7 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
- Top-level folders exist: `Types/`, `Types/Enums/`, `Interfaces/`, `Interfaces/Protocol/`, `Interfaces/Repositories/`, `Interfaces/Services/`, `Entities/`, `Messages/`.
|
||||
- Entity subfolders exist: `Templates/`, `Instances/`, `Sites/`, `ExternalSystems/`, `Notifications/`, `InboundApi/`, `Security/`, `Deployment/`, `Scripts/`, `Audit/`.
|
||||
- Message subfolders exist: `Deployment/`, `Lifecycle/`, `Health/`, `Communication/`, `Streaming/`, `DebugView/`, `ScriptExecution/`, `Artifacts/`.
|
||||
- Namespace conventions match folder structure (e.g., `ScadaLink.Commons.Entities.Templates`).
|
||||
- Namespace conventions match folder structure (e.g., `ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates`).
|
||||
|
||||
**Complexity**: S
|
||||
|
||||
@@ -313,9 +313,9 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
- `IExternalSystemRepository` with methods for external system definitions, method definitions, and database connection definitions. Includes `SaveChangesAsync()`.
|
||||
- `INotificationRepository` with methods for notification lists, recipients, and SMTP configuration. Includes `SaveChangesAsync()`.
|
||||
- `ICentralUiRepository` with read-oriented query methods spanning multiple domain areas.
|
||||
- All methods accept and return POCO types from `ScadaLink.Commons.Entities.*`.
|
||||
- All methods accept and return POCO types from `ZB.MOM.WW.ScadaBridge.Commons.Entities.*`.
|
||||
- No `using` or reference to `Microsoft.EntityFrameworkCore.*` in any interface file.
|
||||
- All interfaces are in `ScadaLink.Commons.Interfaces.Repositories` namespace.
|
||||
- All interfaces are in `ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories` namespace.
|
||||
- Interface names use `I` prefix.
|
||||
|
||||
**Complexity**: M
|
||||
@@ -330,7 +330,7 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
|
||||
**Acceptance Criteria**:
|
||||
- `IAuditService` interface with `LogAsync(string user, string action, string entityType, int entityId, string entityName, object? afterState)` method (or equivalent signature).
|
||||
- Located in `ScadaLink.Commons.Interfaces.Services` namespace.
|
||||
- Located in `ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services` namespace.
|
||||
- No dependency on Configuration Database or EF Core.
|
||||
- Interface is callable by any central component without depending on the audit implementation.
|
||||
|
||||
@@ -375,7 +375,7 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
- `IDataConnection` interface with methods for: connect, disconnect, subscribe to tag paths, unsubscribe, read tag value, write tag value.
|
||||
- Related types in `Interfaces/Protocol/`: `TagIdentifier` (tag path), `TagValue` (value + quality + timestamp), `ReadResult` (value or error), `WriteResult` (success/failure), `SubscriptionCallback` (delegate or interface for value change notifications), `ConnectionStatus` enum (mirrors `ConnectionHealth`: Connected, Disconnected, Connecting, Error), `QualityCode` enum (Good, Bad, Uncertain, etc.).
|
||||
- No protocol-specific references (no OPC UA types, no gRPC types) — pure abstraction.
|
||||
- Located in `ScadaLink.Commons.Interfaces.Protocol` namespace.
|
||||
- Located in `ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol` namespace.
|
||||
- All timestamp fields use `DateTimeOffset` (UTC).
|
||||
|
||||
**Complexity**: S
|
||||
@@ -408,11 +408,11 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
**Description**: Implement the Host `Program.cs` skeleton that reads node role from configuration and branches into WebApplication (central) or generic Host (site) startup paths. Wire the extension method convention with stub `AddXxx()` calls for all components, conditional on role.
|
||||
|
||||
**Acceptance Criteria**:
|
||||
- `Program.cs` reads `ScadaLink:Node:Role` from configuration.
|
||||
- `Program.cs` reads `ScadaBridge:Node:Role` from configuration.
|
||||
- When role is `Central`: uses `WebApplication.CreateBuilder`, calls `AddXxx()` for shared + central-only components, calls `MapCentralUI()` and `MapInboundAPI()` stubs.
|
||||
- When role is `Site`: uses `Host.CreateDefaultBuilder`, calls `AddXxx()` for shared + site-only components. Does **not** configure Kestrel, HTTP, or any web middleware.
|
||||
- Component registration follows the registration matrix exactly (14 components + ConfigurationDatabase on central).
|
||||
- Configuration binding: `services.Configure<NodeOptions>(config.GetSection("ScadaLink:Node"))` and equivalent for all component sections.
|
||||
- Configuration binding: `services.Configure<NodeOptions>(config.GetSection("ScadaBridge:Node"))` and equivalent for all component sections.
|
||||
- Each of the 15 component library projects exposes at minimum an `AddXxx()` extension method on `IServiceCollection` (can be empty body for Phase 0).
|
||||
- Each component that has actors (per registration matrix: ClusterInfrastructure, Communication, HealthMonitoring, ExternalSystemGateway, NotificationService, TemplateEngine, DeploymentManager, Security, SiteRuntime, DataConnectionLayer, StoreAndForward, SiteEventLogging) exposes an `AddXxxActors()` stub extension method. The method signature accepts the Akka configuration builder type (or a placeholder interface if Akka.Hosting is not yet referenced) and has an empty body in Phase 0.
|
||||
- CentralUI and InboundAPI expose `MapCentralUI()` and `MapInboundAPI()` stub extension methods on `WebApplication` (or `IEndpointRouteBuilder`).
|
||||
@@ -460,8 +460,8 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
**Description**: Create sample `appsettings.json` files for central and site roles demonstrating the full configuration structure. Document the local development topology.
|
||||
|
||||
**Acceptance Criteria**:
|
||||
- `appsettings.Central.json` with: `ScadaLink:Node` (Role=Central, NodeHostname, RemotingPort), `ScadaLink:Cluster` (seed nodes for 2-node central), `ScadaLink:Database` (ConfigurationDb and MachineDataDb connection strings pointing to local Docker SQL Server), and all per-component sections with sensible defaults.
|
||||
- `appsettings.Site.json` with: `ScadaLink:Node` (Role=Site, NodeHostname, SiteId, RemotingPort), `ScadaLink:Cluster` (seed nodes for 2-node site), `ScadaLink:Database` (SQLite paths), and all per-component sections with sensible defaults.
|
||||
- `appsettings.Central.json` with: `ScadaBridge:Node` (Role=Central, NodeHostname, RemotingPort), `ScadaBridge:Cluster` (seed nodes for 2-node central), `ScadaBridge:Database` (ConfigurationDb and MachineDataDb connection strings pointing to local Docker SQL Server), and all per-component sections with sensible defaults.
|
||||
- `appsettings.Site.json` with: `ScadaBridge:Node` (Role=Site, NodeHostname, SiteId, RemotingPort), `ScadaBridge:Cluster` (seed nodes for 2-node site), `ScadaBridge:Database` (SQLite paths), and all per-component sections with sensible defaults.
|
||||
- Both files are valid JSON and the Host loads them without error.
|
||||
- A brief topology comment block or accompanying doc section explains: 2-node central cluster, 2-node site cluster, what ports are used, how to run locally with different roles.
|
||||
|
||||
@@ -518,8 +518,8 @@ No business logic, actor systems, database connectivity, or web endpoints are im
|
||||
|
||||
Phase 0 is complete when all of the following pass:
|
||||
|
||||
1. `dotnet build ScadaLink.slnx` completes with zero errors and zero warnings.
|
||||
2. `dotnet test ScadaLink.slnx` passes all unit and integration tests.
|
||||
1. `dotnet build ZB.MOM.WW.ScadaBridge.slnx` completes with zero errors and zero warnings.
|
||||
2. `dotnet test ZB.MOM.WW.ScadaBridge.slnx` passes all unit and integration tests.
|
||||
3. Host boots successfully in central role from `appsettings.Central.json` and exits cleanly.
|
||||
4. Host boots successfully in site role from `appsettings.Site.json` and exits cleanly.
|
||||
5. Site-role Host does not open any network port.
|
||||
|
||||
Reference in New Issue
Block a user