Skip to content
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

Sanitize temporary node name used in rdf_loader #2386

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tokoro10g
Copy link

Description

Names of parameters do not have naming rules yet, whereas those for nodes do.
Therefore the temporary node name containing the parameter name must be sanitized.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 50.34%. Comparing base (0e1e376) to head (8fa3c41).
Report is 52 commits behind head on main.

❗ Current head 8fa3c41 differs from pull request most recent head f09bff4. Consider uploading reports for the commit f09bff4 to get more accurate results

Files Patch % Lines
...g/rdf_loader/src/synchronized_string_parameter.cpp 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2386      +/-   ##
==========================================
- Coverage   50.99%   50.34%   -0.65%     
==========================================
  Files         387      385       -2     
  Lines       32308    31801     -507     
==========================================
- Hits        16473    16007     -466     
+ Misses      15835    15794      -41     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@henningkayser
Copy link
Member

I'm not following. What's wrong with the node name in rdf_loader in particular? The code doesn't look like it's producing invalid names to me.

@henningkayser henningkayser added the question Further information is requested label Oct 10, 2023
@henningkayser henningkayser self-requested a review October 10, 2023 14:34
@tokoro10g
Copy link
Author

@henningkayser
Thanks for your attention to this PR!! I could have explained it more clearly...

For example, abc.def containing . is a valid name for a parameter,
https://github.com/ros2/rclcpp/blob/7f7ffcf6ed1143b4d4a9e0cf248e190731b2e5f8/rclcpp/include/rclcpp/node.hpp#L502-L504
but not for a node:
https://github.com/ros2/rmw/blob/83445be486deae8c78d275e092eafb4bf380bd49/rmw/src/validate_node_name.c#L55-L71

In the current code, such a parameter name is directly used in the node name, and the node cannot be started because of this.

@henningkayser
Copy link
Member

@henningkayser Thanks for your attention to this PR!! I could have explained it more clearly...

For example, abc.def containing . is a valid name for a parameter, https://github.com/ros2/rclcpp/blob/7f7ffcf6ed1143b4d4a9e0cf248e190731b2e5f8/rclcpp/include/rclcpp/node.hpp#L502-L504 but not for a node: https://github.com/ros2/rmw/blob/83445be486deae8c78d275e092eafb4bf380bd49/rmw/src/validate_node_name.c#L55-L71

In the current code, such a parameter name is directly used in the node name, and the node cannot be started because of this.

thanks for the pointers. What part of the node name in particular has an invalid character? Is it name_?

@tokoro10g
Copy link
Author

@henningkayser Yes, exactly.

@tokoro10g
Copy link
Author

@henningkayser Hi! I really appreciate your review!
Please let me know if you have any further questions or suggestions on this change!

@tokoro10g
Copy link
Author

@henningkayser Friendly ping! cc: @DLu

@DLu
Copy link
Contributor

DLu commented Jan 4, 2024

Is there no more-central resource for santizing names? It seems odd to have to do the same thing in each package.

@tokoro10g
Copy link
Author

@DLu
Thanks for the kind reply!

It seems odd to have to do the same thing in each package.

Agreed, and there are none as far as I could find.
If we are to add the sanitization function in, let's say for example, rmw, it means that we need to change the API.
The ROS2 versioning policy is strict on such changes, and we might need to wait for a major release.

I do not think that this simple fix is worth waiting for years. While this specific usage of the node name is rare, it should be reasonable to have it fixed now and get replaced by the "more-central resource" afterwards.
What do you say?

Copy link

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions bot added stale Inactive issues and PRs are marked as stale and may be closed automatically. and removed stale Inactive issues and PRs are marked as stale and may be closed automatically. labels Mar 20, 2024
Copy link

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions bot added the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Nov 29, 2024
Copy link

mergify bot commented Nov 29, 2024

This pull request is in conflict. Could you fix it @tokoro10g?

@github-actions github-actions bot removed the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants