Add basic folder struct and initial gateway node#6
Merged
Conversation
Update all references across documentation, templates, and configuration files to use the new project name ros2_diag_tree for consistency.
- Add ros2_diag_tree_gateway package with basic HTTP server - Implement /health and / endpoints using cpp-httplib - Add GTest for health endpoint verification - Configure linting (exclude uncrustify, use clang-format) - Add clang-format to devcontainer
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new ros2_diag_tree_gateway package that provides an HTTP gateway for the ROS 2 diagnostics system, implementing a basic HTTP server with health check and informational endpoints. Additionally, it renames the project from "DiagTree" to "ros2_diag_tree" throughout the documentation.
- Adds HTTP server implementation using cpp-httplib with
/healthand/endpoints - Implements test coverage for the health endpoint using GTest
- Configures build system with clang-format linting and excludes uncrustify
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ros2_diag_tree_gateway/src/gateway_node.cpp | Main gateway node implementation with HTTP server and endpoint handlers |
| src/ros2_diag_tree_gateway/test/test_gateway_node.cpp | Test suite for gateway node with health endpoint verification |
| src/ros2_diag_tree_gateway/CMakeLists.txt | CMake build configuration including cpp-httplib dependency and test setup |
| src/ros2_diag_tree_gateway/package.xml | ROS 2 package manifest with dependencies |
| src/ros2_diag_tree_gateway/README.md | Package documentation with usage examples |
| .devcontainer/Dockerfile | Adds clang-format to development environment |
| README.md, SECURITY.md, CONTRIBUTING.md, etc. | Project rename from DiagTree to ros2_diag_tree |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add nlohmann/json library for proper JSON serialization - Replace manual string concatenation with type-safe JSON objects - Cache node name to avoid cross-thread access to ROS node methods - Remove logging from server thread to prevent thread-safety issues - Add VERSION constant to avoid hardcoded version strings - Improve test reliability with proper server startup polling - Update tests to parse and validate actual JSON structure
7 tasks
mfaferek93
added a commit
that referenced
this pull request
Jan 21, 2026
- Add inline symptom codes support in YAML config (codes: [...] syntax) - Refactor severity_to_string/severity_rank to shared types.hpp/cpp - Add correlation.cleanup_interval_sec parameter (default 5.0s) - Update TODO(#105) → TODO(#127) for pending_clusters cleanup - Add PlantUML sequence diagrams to fault-correlation tutorial Addresses review comments: - Implement missing inline codes parsing (#1) - Fix orphaned TODO reference (#2) - Consolidate duplicated severity functions (#3) - Parameterize magic number 5s (#4) - Add flow diagrams to docs (#6)
mfaferek93
added a commit
that referenced
this pull request
Jan 21, 2026
* feat(#105): add fault correlation engine for root-cause analysis Implement hierarchical and auto-cluster correlation modes to reduce fault noise by identifying root causes and grouping related faults. Key features: - Hierarchical mode: detect root cause → symptom relationships - Auto-cluster mode: group similar faults within time window - YAML-based configuration with pattern wildcards - Muted faults tracking and auto-clear on root cause resolution - Gateway API support with include_muted/include_clusters params New messages: MutedFaultInfo.msg, ClusterInfo.msg Extended: GetFaults.srv, ClearFault.srv, FaultEvent.msg * docs(#105): add correlation endpoints to Postman collection Add new requests demonstrating fault correlation query parameters: - GET Faults with Correlation Data (include_muted + include_clusters) - GET Faults with Muted Details Only - GET Faults with Cluster Details Only Update existing endpoint descriptions to document: - muted_count/cluster_count fields in GET /faults response - auto_cleared_codes in DELETE clear fault response - Faults folder description with correlation feature overview * docs(#105): add fault correlation tutorial Add comprehensive tutorial covering: - Hierarchical mode (root cause → symptom relationships) - Auto-cluster mode (grouping similar faults) - YAML configuration with patterns and rules - REST API query parameters for correlation data - Complete example configuration - Troubleshooting guide * style: fix clang-format and flake8 formatting issues * fix(#105): address thread safety and retroactive cluster muting - Fix data race in PatternMatcher::get_compiled() by adding mutex protection for the mutable compiled_cache_ member - Add retroactive_mute_codes field to ProcessFaultResult for tracking faults that should have been muted before cluster activation - Populate retroactive_mute_codes when cluster transitions from pending to active (reaches min_count threshold) - Add debug logging for retroactive muting in fault_manager_node - Add unit test AutoClusterRetroactiveMuting to verify behavior * fix(#105): add periodic cleanup timer for correlation engine Add 5-second timer to periodically call cleanup_expired() on the correlation engine. This prevents stale pending root causes and pending clusters from accumulating in memory when faults are reported infrequently. Add unit tests: - CleanupExpiredRemovesPendingRootCauses - CleanupExpiredRemovesPendingClusters * perf(#105): minor optimizations and documentation - Skip regex compilation for non-wildcard patterns (perf improvement) - Add validation error for min_count=0 in auto-cluster rules - Add TODO documenting known limitation: pending_clusters_ not cleaned up when fault is cleared before cluster reaches min_count * fix(#105): address code review feedback for fault correlation - Add inline symptom codes support in YAML config (codes: [...] syntax) - Refactor severity_to_string/severity_rank to shared types.hpp/cpp - Add correlation.cleanup_interval_sec parameter (default 5.0s) - Update TODO(#105) → TODO(#127) for pending_clusters cleanup - Add PlantUML sequence diagrams to fault-correlation tutorial Addresses review comments: - Implement missing inline codes parsing (#1) - Fix orphaned TODO reference (#2) - Consolidate duplicated severity functions (#3) - Parameterize magic number 5s (#4) - Add flow diagrams to docs (#6)
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
Description
Type of change
Related issues
Related to #3
How has this been tested?
Describe the tests you ran to verify your changes.
Checklist
colcon buildand the build succeeds without warningscolcon testand all tests pass locallyAdditional notes for reviewers