Skip to content

Comments

Add basic folder struct and initial gateway node#6

Merged
bburda merged 3 commits intomainfrom
feat/basic-folder-struct
Nov 18, 2025
Merged

Add basic folder struct and initial gateway node#6
bburda merged 3 commits intomainfrom
feat/basic-folder-struct

Conversation

@bburda
Copy link
Collaborator

@bburda bburda commented Nov 18, 2025

Pull Request

Description

  • 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

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Related issues

Related to #3

How has this been tested?

Describe the tests you ran to verify your changes.

Checklist

  • My code follows the project's coding style
  • I ran colcon build and the build succeeds without warnings
  • I ran colcon test and all tests pass locally
  • I added/updated tests where applicable
  • I updated documentation where applicable
  • My commit messages are clear and descriptive

Additional notes for reviewers

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
@bburda bburda requested a review from Copilot November 18, 2025 19:51
@bburda bburda changed the title Feat/basic folder struct Add basic folder struct and initial gateway node Nov 18, 2025
Copy link
Contributor

Copilot AI left a comment

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 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 /health and / 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.

@bburda bburda linked an issue Nov 18, 2025 that may be closed by this pull request
- 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
@bburda bburda merged commit 18ebd62 into main Nov 18, 2025
@bburda bburda deleted the feat/basic-folder-struct branch November 18, 2025 20:13
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)
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.

Add basic folder structure

1 participant