Add runtime NodeSet-backed node managers - #3990
Conversation
|
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3990 +/- ##
==========================================
+ Coverage 77.70% 78.84% +1.14%
==========================================
Files 1385 1391 +6
Lines 183248 183805 +557
Branches 31926 32062 +136
==========================================
+ Hits 142385 144917 +2532
+ Misses 29318 27483 -1835
+ Partials 11545 11405 -140
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a server startup-time “runtime NodeSet” loading path that imports one or more NodeSet2 XML documents into the server address space without requiring source generation, integrating with the existing fluent INodeManagerBuilder surface and the default server complex-type loading pipeline.
Changes:
- Introduces
RuntimeNodeSet*types (sources/options/factory/node manager) plusAddRuntimeNodeSet(...)DI/hosting extensions for file- and stream-backed NodeSet2 loading. - Adds NUnit integration/unit coverage for runtime NodeSet loading, dependency ordering, namespace registration, and fluent callback wiring.
- Extends documentation (server NuGet README + docs set) and adds an AOT smoke test covering
AddRuntimeNodeSetregistration.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Opc.Ua.Server.Tests/RuntimeNodeSet/RuntimeNodeSetTestServer.cs | ReferenceServer subclass used to integration-test runtime NodeSet import + fluent wiring. |
| Tests/Opc.Ua.Server.Tests/RuntimeNodeSet/RuntimeNodeSetSourceTests.cs | Unit tests for runtime NodeSet sources (file/stream) and model-URI extraction behavior. |
| Tests/Opc.Ua.Server.Tests/RuntimeNodeSet/RuntimeNodeSetNodeManagerFactoryTests.cs | Unit tests for factory validation, namespace aggregation, and dependency/cycle/duplicate detection. |
| Tests/Opc.Ua.Server.Tests/RuntimeNodeSet/RuntimeNodeSetIntegrationTests.cs | End-to-end address space tests against a real server instance using runtime NodeSet loading. |
| Tests/Opc.Ua.Aot.Tests/HostingAotTests.cs | Adds AOT-safe smoke coverage for AddRuntimeNodeSet stream registration and manager creation. |
| Libraries/Opc.Ua.Server/RuntimeNodeSet/RuntimeNodeSetSource.cs | Adds RuntimeNodeSetSource abstraction and file/stream implementations with model URI metadata. |
| Libraries/Opc.Ua.Server/RuntimeNodeSet/RuntimeNodeSetOptions.cs | Adds options object controlling sources, default namespace inference, and fluent configuration callback. |
| Libraries/Opc.Ua.Server/RuntimeNodeSet/RuntimeNodeSetNodeManagerFactory.cs | Adds public async node-manager factory that parses/sorts/imports NodeSets in dependency order. |
| Libraries/Opc.Ua.Server/RuntimeNodeSet/RuntimeNodeSetNodeManager.cs | Adds internal node manager that imports NodeSets, validates, and applies fluent callbacks. |
| Libraries/Opc.Ua.Server/RuntimeNodeSet/RuntimeNodeSetBuilderExtensions.cs | Adds IOpcUaServerBuilder.AddRuntimeNodeSet(...) DI registration surface. |
| Libraries/Opc.Ua.Server/NugetREADME.md | Documents how to use AddRuntimeNodeSet from the server NuGet package. |
| Docs/SourceGeneratedNodeManagers.md | Adds a “Runtime NodeSet alternative” section pointing readers to the new approach. |
| Docs/RuntimeNodeSets.md | New end-user guide for runtime NodeSet loading semantics, ordering, and complex-type behavior. |
| Docs/README.md | Adds Runtime NodeSets to the docs index. |
| Docs/DependencyInjection.md | Updates DI feature table to include runtime NodeSet registration. |
| Docs/ComplexTypes.md | Notes that runtime NodeSets integrate with the default server complex-type pass. |
romanett
left a comment
There was a problem hiding this comment.
Add a follow up item for adding NodeManager instances to a running server.
Large merge bringing in ~60 upstream commits, most notably the repository layout consolidation (OPCFoundation#4010) that moves the whole tree under src/, samples/, tests/, tools/, docs/, and fuzzing/. Also includes the repo-wide source-generated logging migration (OPCFoundation#3908/OPCFoundation#4003), Part 4 6.6 Redundancy (OPCFoundation#3918), runtime NodeSet-backed node managers (OPCFoundation#3990), MinimalClient sample (OPCFoundation#4006), and many CTT/compliance and security fixes. Conflict resolution: * UA.slnx - took upstream's new-layout solution structure and added our branch-only UaLens under the /samples/ folder (samples/Opc.Ua.Lens/Opc.Ua.Lens.csproj). Dropped the stale Applications/McpServer entry (McpServer already lives under master's /tools/ section as tools/Opc.Ua.Mcp). * .azurepipelines/preview.yml, signlist{Debug,Release}.txt - took upstream's versions wholesale (pure old->new layout path rewrites for upstream-managed files; UaLens was never sign-listed). Relocations for our branch-only files that the consolidation could not auto-move (they exist only on our side, so upstream's rename didn't touch them): * Applications/Opc.Ua.Lens/ -> samples/Opc.Ua.Lens/ (alongside the other sample apps). Updated its csproj ProjectReferences from the old Stack/ + Libraries/ paths to the new src/ layout, and dropped the obsolete <None Remove ...Docs\NugetREADME.md> line (common.props no longer ships a shared root readme; each package owns its local NugetREADME.md, which UaLens already has). * Libraries/Opc.Ua.Client/UserManagement/{IUserManagementClient, UserManagementClient,UserManagementUser}.cs -> src/Opc.Ua.Client/UserManagement/ so they compile back into the (moved) client project. Suppressed CA1873 in the UaLens csproj (with comment + TODO): upstream's source-generated-logging migration enabled this analyzer repo-wide and it flags UaLens's 146 direct ILogger.Log* call sites. Migrating UaLens logging to [LoggerMessage] partials is tracked as follow-up. UaLens build clean (0 warnings / 0 errors). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
Add a dedicated startup-time runtime NodeSet2 loading path for servers that need to expose information models without source generation.
This introduces:
AddRuntimeNodeSetDI extensions for single files, grouped sources, and lazy stream providers.RuntimeNodeSetNodeManagerFactoryandFluentNodeManagerBaseimplementation that remain separate from source-generated NodeManagers and typed fluent builders.RequiredModeldependency ordering, parent-child linking, external reference handling, and fail-fast diagnostics.INodeManagerBuildercode-behind wiring for imported variables, methods, events, alarms, and simulations.The feature intentionally loads NodeSets only during server startup. Live add, reload, or removal after clients connect remains out of scope because it requires separate MasterNodeManager routing, NamespaceArray, model-change, subscription, and complex-type lifecycle design.
Related Issues
Validation
net10.0.net48.Checklist