Skip to content

[XRegistry] Allow clients to use explicit registry roots - #4130

Open
marcschier wants to merge 10 commits into
marcschier/wot-07-subscription-transferfrom
marcschier/wot-09-xregistry-client
Open

[XRegistry] Allow clients to use explicit registry roots#4130
marcschier wants to merge 10 commits into
marcschier/wot-07-subscription-transferfrom
marcschier/wot-09-xregistry-client

Conversation

@marcschier

Copy link
Copy Markdown
Collaborator

This extracts the xRegistry client generalisation from #4093 as PR 9 of the stacked split into independently reviewable pieces.

The change lets the xRegistry client base accept an explicit registry root NodeId while preserving the existing well-known-root default. GenericXRegistryClient exposes the same explicit-root path so callers can drive registries whose root Object is discovered separately, and the tests cover the supplied-root and fallback behavior across the lifecycle helpers.

This PR is independent of the other stack PRs and contains no WoT registry implementation or Opc.Ua.WotCon.* references. A later PR adds the WoT registry client on top of this general xRegistry client surface.

Let the xRegistry client base accept an optional registry root NodeId and keep the well-known Object as the default for existing callers. This lets generic or derived clients bind to registries whose root Object was discovered separately without changing the proxy-based lifecycle helpers.

Add a GenericXRegistryClient constructor for the explicit-root path and cover both the supplied-root and default-root behavior in the xRegistry client tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
Copilot AI review requested due to automatic review settings July 30, 2026 17:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds support for constructing xRegistry clients with an explicit registry root NodeId, while preserving the existing well-known-root default.

Changes:

  • Introduced a new XRegistryClient protected constructor overload that accepts an explicit registryNodeId and stores RegistryNodeId as an initialized property.
  • Added a matching overload on GenericXRegistryClient to expose explicit-root usage to callers.
  • Extended tests to cover explicit-root selection, null-root fallback, and lifecycle call routing to the supplied root.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/Opc.Ua.XRegistry.Tests/XRegistryClientTests.cs Adds coverage for explicit root selection/fallback and verifies lifecycle methods target the supplied root.
src/Opc.Ua.XRegistry.Client/XRegistryClient.cs Adds constructor overload taking an explicit root NodeId and changes RegistryNodeId to be set at construction.
src/Opc.Ua.XRegistry.Client/GenericXRegistryClient.cs Exposes the explicit-root constructor overload for the sealed generic client.

Comment thread src/Opc.Ua.XRegistry.Client/XRegistryClient.cs
Comment thread tests/Opc.Ua.XRegistry.Tests/XRegistryClientTests.cs
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.92%. Comparing base (cfd15f0) to head (5760a83).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4130      +/-   ##
==========================================
- Coverage   80.18%   79.92%   -0.27%     
==========================================
  Files        1514     1515       +1     
  Lines      209245   209986     +741     
  Branches    36008    36214     +206     
==========================================
+ Hits       167789   167829      +40     
- Misses      28878    29561     +683     
- Partials    12578    12596      +18     
Files with missing lines Coverage Δ
.../Opc.Ua.XRegistry.Client/GenericXRegistryClient.cs 100.00% <100.00%> (ø)
src/Opc.Ua.XRegistry.Client/XRegistryClient.cs 97.67% <100.00%> (+0.11%) ⬆️

... and 92 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add an explicit captured-call count assertion before the test indexes the first call. This keeps regressions failing with a meaningful NUnit assertion instead of an ArgumentOutOfRangeException.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
@marcschier
marcschier changed the base branch from master to marcschier/wot-07-subscription-transfer August 1, 2026 11:55
…ransfer' into marcschier/wot-09-xregistry-client
…ransfer' into marcschier/wot-09-xregistry-client
…ransfer' into marcschier/wot-09-xregistry-client
…ransfer' into marcschier/wot-09-xregistry-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants