Skip to content

Fix clang-tidy noise from bundled headers and flaky secured-test deadline#495

Closed
mfaferek93 wants to merge 4 commits into
mainfrom
fix/ci-vendored-tidy-and-secured-deadline
Closed

Fix clang-tidy noise from bundled headers and flaky secured-test deadline#495
mfaferek93 wants to merge 4 commits into
mainfrom
fix/ci-vendored-tidy-and-secured-deadline

Conversation

@mfaferek93

Copy link
Copy Markdown
Collaborator

Fixes the red clang-tidy job on PRs touching the OPC UA plugin, and the flaky secured integration test. Four independent commits:

  • Mark the bundled open62541 include dirs as SYSTEM in the OPC UA plugin CMake. Adding #include <open62541/client_highlevel.h> surfaced hard -Werror=old-style-cast errors from the third-party headers, because only open62541pp's dirs were SYSTEM while the bundled open62541 target's were plain -I. Verified with a probe TU: before = error flood from the vendor headers, after = only the TU's own deliberate violation is reported.
  • NOLINT-wrap the vendored headers that the tidy header filter unavoidably matches (tl/expected.hpp, the dynmsg headers) - their install paths contain "ros2_medkit". Verified the suppression does not leak: a deliberate violation in the including TU is still reported.
  • Resolve the six real clang-tidy findings in the plugin sources (special-member-functions on client/plugin/poller, two no-effect std::move on trivially-copyable handles, one range-for). Note: the event-field case was not a plain move-drop - the manual UA_Variant_copy + adopt was replaced with a direct deep-copy opcua::Variant construction to avoid leaking the copied buffer.
  • Raise the fault-surface wait deadline in the secured integration test (40s -> 120s; CTest timeout 300 -> 420). The alarm fires on the server but can miss the old deadline on slow runners; passing runs exit the poll early and are unaffected. Verified 3x green.

Tested: clang-tidy with the CI filter reports 0 findings on the touched sources; OPC UA suite 222 tests pass; flake8 clean on the test script.

…r filter

The quality job's -header-filter='.*ros2_medkit.*' matches vendored
headers because their install paths contain the package name, so any TU
including them (e.g. via lock_manager.hpp) fails with third-party
warnings. Wrap them in NOLINTBEGIN/NOLINTEND.
On slow CI runners the fired alarm does not always propagate through
report -> fault_manager -> REST within 40s. Raise the wait to 120s and
the CTest timeout to 420s so a failing run still prints diagnostics.
Passing runs exit the poll early and are unaffected.
Only open62541pp's own interface dirs were marked SYSTEM; the bundled
open62541 target's dirs stayed plain -I, so including a header like
client_highlevel.h turns its old-style casts into hard clang-tidy
errors via -Werror=old-style-cast.
Complete the special-member sets of OpcuaClient, OpcuaPlugin and
OpcuaPoller with deleted moves, drop a no-effect std::move on the
trivially copyable Subscription handle, build event-field Variants via
the deep-copy constructor, and convert an index loop to range-for.
Copilot AI review requested due to automatic review settings July 2, 2026 16:12

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

This PR reduces CI noise/failures by suppressing clang-tidy diagnostics from vendored/third-party headers and by fixing genuine clang-tidy findings in the OPC UA plugin code, while also making the secured OPC UA integration test less flaky under slow runners.

Changes:

  • Suppress clang-tidy on vendored headers that match the CI header filter using NOLINTBEGIN/NOLINTEND.
  • Adjust the OPC UA plugin build to treat both open62541pp and bundled open62541 interface include directories as SYSTEM, and fix several clang-tidy findings in OPC UA source/header code.
  • Increase the secured OPC UA integration test’s internal wait deadline and raise the corresponding CTest timeout.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/yaml_utils.hpp Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/vector_utils.hpp Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/typesupport.hpp Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/types.h Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/string_utils.hpp Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/msg_parser.hpp Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/message_reading.hpp Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_serialization/include/ros2_medkit_serialization/vendored/dynmsg/config.hpp Add clang-tidy suppression markers for vendored dynmsg header.
src/ros2_medkit_plugins/ros2_medkit_opcua/test/integration/test_opcua_secured.test.py Increase secured-test fault propagation wait deadline and document the rationale.
src/ros2_medkit_plugins/ros2_medkit_opcua/src/opcua_client.cpp Address clang-tidy findings (redundant move, safer variant deep-copy, range-for cleanup).
src/ros2_medkit_plugins/ros2_medkit_opcua/include/ros2_medkit_opcua/opcua_poller.hpp Explicitly delete move operations to satisfy special-member-functions guidance.
src/ros2_medkit_plugins/ros2_medkit_opcua/include/ros2_medkit_opcua/opcua_plugin.hpp Explicitly delete copy/move operations to satisfy special-member-functions guidance.
src/ros2_medkit_plugins/ros2_medkit_opcua/include/ros2_medkit_opcua/opcua_client.hpp Explicitly delete move operations to satisfy special-member-functions guidance.
src/ros2_medkit_plugins/ros2_medkit_opcua/CMakeLists.txt Mark third-party include dirs as SYSTEM and increase secured integration test TIMEOUT.
src/ros2_medkit_gateway/src/vendored/tl_expected/include/tl/expected.hpp Add clang-tidy suppression markers for vendored tl::expected header.

Comment on lines +358 to +364
# TIMEOUT must exceed the sum of the script's internal wait deadlines so a
# slow failing run still reaches its own FAIL diagnostics instead of being
# killed by CTest.
set_tests_properties(test_opcua_secured PROPERTIES
LABELS "integration"
SKIP_RETURN_CODE 77
TIMEOUT 300)
TIMEOUT 420)
@mfaferek93

Copy link
Copy Markdown
Collaborator Author

Folded into #492.

@mfaferek93 mfaferek93 closed this Jul 2, 2026
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