Conversation
- 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
Contributor
There was a problem hiding this comment.
🟡 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}; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
For documentation related changes:
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.