-
Notifications
You must be signed in to change notification settings - Fork 2
fix(discovery): #146 prevent duplicate components for root namespace… #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 pull request fixes a bug where root namespace nodes publishing topics with matching prefixes incorrectly created duplicate topic-based components during discovery. The fix prevents nodes like /fault_manager from appearing both as a node-based app and as a duplicate topic-based component when publishing topics like /fault_manager/events.
Changes:
- Modified
get_node_namespaces()to include root namespace node names in the namespace set, preventing topic-based discovery from creating duplicate components - Added unit test to verify root namespace nodes don't create duplicate topic-based components
- Added integration test with a demo node to validate the fix in a real-world scenario
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/ros2_medkit_gateway/src/discovery/runtime_discovery.cpp | Core fix: adds root namespace node names to the namespace set to prevent duplicate component creation |
| src/ros2_medkit_gateway/test/test_discovery_manager.cpp | Unit test verifying the fix by creating a publisher matching the node name and checking no duplicate is created |
| src/ros2_medkit_gateway/test/test_discovery_heuristic_apps.test.py | Integration test adding a root namespace demo node and verifying no duplicates exist in the API responses |
src/ros2_medkit_gateway/test/test_discovery_heuristic_apps.test.py
Outdated
Show resolved
Hide resolved
a2cffa6 to
170fb65
Compare
src/ros2_medkit_gateway/test/test_discovery_heuristic_apps.test.py
Outdated
Show resolved
Hide resolved
170fb65 to
0439360
Compare
…nodes Nodes in root namespace (e.g., /fault_manager) publishing topics with matching prefix (e.g., /fault_manager/events) were incorrectly creating both a node-based app and a duplicate topic-based component. Add node names to namespace set in get_node_namespaces() for root namespace nodes, so discover_topic_components() skips creating redundant topic-based components.
0439360 to
2c30d9b
Compare
Pull Request
Summary
prevent duplicate components for root namespace nodes
Nodes in root namespace (e.g., /fault_manager) publishing topics with
matching prefix (e.g., /fault_manager/events) were incorrectly creating
both a node-based app and a duplicate topic-based component.
Add node names to namespace set in get_node_namespaces() for root
namespace nodes, so discover_topic_components() skips creating
redundant topic-based components.
Issue
Link the related issue (required):
Type
Testing
How was this tested / how should reviewers verify it?
Checklist