feat: add quality.yml CI workflow with sanitizers and decoupled clang-tidy#348
Merged
mfaferek93 merged 13 commits intomainfrom Apr 4, 2026
Merged
feat: add quality.yml CI workflow with sanitizers and decoupled clang-tidy#348mfaferek93 merged 13 commits intomainfrom
mfaferek93 merged 13 commits intomainfrom
Conversation
Clang-tidy and format linters move to quality.yml workflow.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a dedicated “Quality” CI workflow to run Jazzy-only formatting/linting, incremental clang-tidy, and sanitizer (ASan/UBSan + TSan) unit-test runs, while simplifying the existing CI workflow by removing Jazzy clang-tidy/lint steps.
Changes:
- Introduces
.github/workflows/quality.ymlwith parallel jobs for format-lint, clang-tidy (with ctcache), ASan+UBSan, and TSan. - Adds
ROS2MedkitSanitizers.cmakeand wires it into several packages to enable-DSANITIZER=...builds. - Removes Jazzy clang-tidy/lint coupling from
.github/workflows/ci.ymland adds a TSan suppressions file.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tsan_suppressions.txt |
Adds CI-referenced TSan suppressions for known ROS 2/DDS false positives. |
src/ros2_medkit_serialization/CMakeLists.txt |
Includes new sanitizer module for per-package sanitizer flag injection. |
src/ros2_medkit_gateway/CMakeLists.txt |
Includes new sanitizer module for gateway builds/tests. |
src/ros2_medkit_fault_reporter/CMakeLists.txt |
Includes new sanitizer module for sanitizer-enabled builds/tests. |
src/ros2_medkit_fault_manager/CMakeLists.txt |
Includes new sanitizer module for sanitizer-enabled builds/tests. |
src/ros2_medkit_discovery_plugins/ros2_medkit_linux_introspection/CMakeLists.txt |
Includes new sanitizer module for sanitizer-enabled builds/tests. |
src/ros2_medkit_diagnostic_bridge/CMakeLists.txt |
Includes new sanitizer module for sanitizer-enabled builds/tests. |
src/ros2_medkit_cmake/CMakeLists.txt |
Installs the new sanitizer CMake module. |
src/ros2_medkit_cmake/cmake/ROS2MedkitSanitizers.cmake |
Implements -DSANITIZER=... parsing/validation and applies sanitizer flags. |
src/ros2_medkit_cmake/cmake/ros2_medkit_cmake-extras.cmake |
Updates documentation comment to mention the sanitizer module. |
.github/workflows/quality.yml |
New quality workflow running format-lint, clang-tidy, ASan+UBSan, and TSan jobs. |
.github/workflows/ci.yml |
Removes clang-tidy from Jazzy build and deletes the Jazzy lint job; updates gating dependencies. |
…containers - PyPI package is 'ctcache', not 'clang-tidy-cache' - Use shell expansion for TSAN_OPTIONS suppressions path to resolve correctly inside GitHub Actions containers (github.workspace gives host path, not container path)
- ctcache is not on PyPI, install from git+https://github.com/... - Add httplib::* to TSan suppressions for known races in Server::stop() from system-packaged libcpp-httplib.so
- Install ctcache from GitHub (not on PyPI) - Add git safe.directory for clang-tidy container job - Fix ResourceChangeNotifier destructor race: add active caller counter so shutdown() waits for in-flight notify() calls to drain before destroying members (seq_cst ordering prevents TOCTOU) - Add TSan suppressions for third-party code only: cpp-httplib Server::stop() race, rclcpp mutex/deadlock during test teardown
- Replace active_notify_count_ spin-wait (caused TSan timeout) with lock-based approach: check shutdown flag under queue_mutex_ in notify() so the flag check and queue push are atomic - Create ctcache dir before run-clang-tidy (cache miss leaves it empty)
04f9d5b to
e101e27
Compare
mfaferek93
reviewed
Apr 3, 2026
ecdab29 to
19dcb24
Compare
- ctcache expects real clang-tidy path as argv[1], but run-clang-tidy passes args directly. Add ctcache-wrapper shell script that prepends /usr/bin/clang-tidy to the clang-tidy-cache invocation. - Replace memory_order_relaxed with seq_cst (default) for shutdown_flag_ loads in worker_loop(). Under TSan, relaxed loads may not observe cross-thread stores promptly, causing worker to miss shutdown signal.
19dcb24 to
9560087
Compare
Growing test count pushes some jobs close to their limits. Set all quality.yml jobs to 45m, ci.yml jazzy-test and coverage to 45m. Step-level 15m timeouts on test execution remain as safety nets.
- Fix command injection: use env var for changed files list instead of direct GitHub expression interpolation in bash - Add concurrency group to cancel stale quality workflow runs - Add ccache to format-lint job (was building from scratch every run) - Add permissions: contents: read - Pin ctcache to commit SHA for reproducibility - Remove dead compdb install, fix merge comment - Document ASan options, -O1 override, and TSan suppressions - Add include(ROS2MedkitSanitizers) to 4 missing packages: graph_provider, beacon_common, param_beacon, topic_beacon
colcon test does not pass --timeout to ctest (confirmed after trying --ctest-args, space-prefix, and CMAKE_CTEST_ARGUMENTS). Run ctest directly per package in sanitizer jobs with --timeout 180. Remove non-functional CMAKE_CTEST_ARGUMENTS from Sanitizers.cmake.
ament_add_gtest sets TIMEOUT 60 per-test property which ctest --timeout cannot override. Sed CTestTestfile.cmake after build to extend to 180s.
mfaferek93
approved these changes
Apr 4, 2026
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.
Pull Request
Summary
quality.ymlworkflow with 4 parallel Jazzy-only jobs: format-lint, incremental clang-tidy (with ctcache), ASan+UBSan, and TSanROS2MedkitSanitizers.cmakemodule for-DSANITIZER=asan,ubsan/-DSANITIZER=tsanIssue
Type
Testing
-fsanitize=address,undefinedflags confirmed in build outputnew_delete_type_mismatch=0to suppress known ROS 2/DDS allocator mismatchesChecklist