Skip to content

MINIFICPP-2906 Add guid nodeid support for OPC processors - #2266

Draft
lordgamez wants to merge 1 commit into
apache:MINIFICPP-2894from
lordgamez:MINIFICPP-2906
Draft

lordgamez wants to merge 1 commit into
apache:MINIFICPP-2894from
lordgamez:MINIFICPP-2906

Conversation

@lordgamez

@lordgamez lordgamez commented Sep 18, 2026

Copy link
Copy Markdown
Contributor
  • Make Parent node ID property optional for PutOPCProcessor
  • Move node id parsing to onSchedule where possible
  • Add missing tests for uncovered use cases like multiple node id types
  • Additional refactoring of common code

https://issues.apache.org/jira/browse/MINIFICPP-2906

Depends on #2265


Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.

In order to streamline the review of the contribution we ask you to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?

  • Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically main)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file?
  • If applicable, have you updated the NOTICE file?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.

- Make Parent node ID property optional for PutOPCProcessor
- Move node id parsing to onSchedule where possible
- Add missing tests for uncovered use cases like multiple node id types
- Additional refactoring of common code

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.

🟡 Changes recommended

Numeric NodeIds are parsed incorrectly and cached parent-path resolutions can become stale after server changes.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds GUID NodeId support across OPC processors and makes PutOPC parent configuration optional.

Changes:

  • Centralizes NodeId parsing and GUID handling.
  • Supports updating nodes without a configured parent.
  • Expands OPC tests, documentation, and manifest metadata.
File summaries
File Description
PROCESSORS.md Documents GUID and optional parent properties.
extensions/opc/tests/PutOPCProcessorTests.cpp Tests GUID and parentless updates.
extensions/opc/tests/OpcUaTestServer.h Adds GUID and ambiguous test nodes.
extensions/opc/tests/FetchOPCProcessorTests.cpp Tests multiple NodeId types and traversal cases.
extensions/opc/src/PutOPCProcessor.cpp Refactors parent and target handling.
extensions/opc/src/OPCCommon.cpp Adds common NodeId construction and GUID attributes.
extensions/opc/src/FetchOPCProcessor.cpp Uses common scheduled parsing.
extensions/opc/src/FetchOPCHistory.cpp Reuses base NodeId parsing.
extensions/opc/src/BaseOPCProcessor.cpp Centralizes processor NodeId parsing.
extensions/opc/include/PutOPCProcessor.h Makes parent properties optional.
extensions/opc/include/OPCCommon.h Declares common NodeId builder.
extensions/opc/include/FetchOPCProcessor.h Enables GUID NodeIds.
extensions/opc/include/FetchOPCHistory.h Removes duplicate state.
extensions/opc/include/BaseOPCProcessor.h Adds shared parsed-node state.
.github/references/ubuntu_22_04_clang_arm_manifest.json Updates generated processor metadata.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +249 to 264
if (parent_node_defined_ && id_type_ == opc::OPCNodeIDType::Path && !path_node_id_resolved_) {
std::vector<opc::NodeId> translated_node_ids;
auto sc = connection_->translateBrowsePathsToNodeIdsRequest(node_id_, translated_node_ids, namespace_idx_, path_reference_types_, logger_);
if (sc != UA_STATUSCODE_GOOD) {
logger_->log_error("Failed to translate path '{}' to a node id: {}", node_id_, UA_StatusCode_name(sc));
context.yield();
return;
}
if (translated_node_ids.size() != 1) {
logger_->log_error("Path '{}' resolved to {} node ids; exactly one target node is required for put", node_id_, translated_node_ids.size());
context.yield();
return;
}
node_ = std::move(translated_node_ids[0]);
path_node_id_resolved_ = true;
}
Comment on lines +600 to +606
case opc::OPCNodeIDType::Int:
try {
return opc::NodeId{UA_NODEID_NUMERIC(namespace_idx, std::stoi(node_id))};
} catch(const std::exception&) {
auto error_msg = utils::string::join_pack(node_id, " cannot be used as an int type node ID");
return std::unexpected{error_msg};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants