Skip to content

Conversation

minggangw
Copy link
Member

@minggangw minggangw commented Jun 23, 2025

This PR introduces topic name validation and remapping for publisher and subscription endpoints.

  • Updated test cases in test/test-graph.js to verify topic remapping under a namespace.
  • Added a new C++ binding function in src/rcl_node_bindings.cpp to support topic remapping with proper memory management.
  • Enhanced the Node class in lib/node.js to validate and remap topic names before retrieving publisher/subscription info.

Fix: #1176

@minggangw minggangw requested a review from Copilot June 23, 2025 05:16
Copilot

This comment was marked as outdated.

@minggangw minggangw requested a review from Copilot June 23, 2025 05:29
Copy link

@Copilot 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 topic name validation and remapping for publisher and subscription endpoints.

  • Updated test cases in test/test-graph.js to verify topic remapping under a namespace.
  • Added a new C++ binding function in src/rcl_node_bindings.cpp to support topic remapping with proper memory management.
  • Enhanced the Node class in lib/node.js to validate and remap topic names before retrieving publisher/subscription info.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/test-graph.js Updated tests to incorporate namespace and remapping verification.
src/rcl_node_bindings.cpp Added RemapTopicName function with proper error handling and cleanup.
lib/node.js Modified Node methods to validate and remap topic names; added helper function.
Comments suppressed due to low confidence (1)

lib/node.js:1088

  • The documentation comment contradicts the implemented behavior where the topic is validated and remapped. Please update the comment to accurately reflect that the topic name is validated and remapped when noDemangle is false.
   *  The queried `topic` is not remapped.

@coveralls
Copy link

coveralls commented Jun 23, 2025

Coverage Status

coverage: 84.526% (-0.08%) from 84.603%
when pulling ec17f02 on minggangw:fix-1176
into ba7cdc0 on RobotWebTools:develop.

@minggangw minggangw merged commit b42699f into RobotWebTools:develop Jun 23, 2025
19 checks passed
minggangw added a commit that referenced this pull request Jun 23, 2025
This PR introduces topic name validation and remapping for publisher and subscription endpoints.  
- Updated test cases in test/test-graph.js to verify topic remapping under a namespace.  
- Added a new C++ binding function in src/rcl_node_bindings.cpp to support topic remapping with proper memory management.  
- Enhanced the Node class in lib/node.js to validate and remap topic names before retrieving publisher/subscription info.

Fix: #1176
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.

Validate and remap the topic name for publishers/subscriptions
2 participants