Skip to content

Make exception for plugins when checking for name uniqueness#721

Merged
azeey merged 3 commits intogazebosim:mainfrom
azeey:no_warn_plugin
Sep 30, 2021
Merged

Make exception for plugins when checking for name uniqueness#721
azeey merged 3 commits intogazebosim:mainfrom
azeey:no_warn_plugin

Conversation

@azeey
Copy link
Copy Markdown
Collaborator

@azeey azeey commented Sep 29, 2021

🦟 Bug fix

Fixes #712
Fixes #294

Summary

As discussed in #712, #294 and possibly other issues, the name attribute of <plugin> is used by downstream applications like ign-gazebo to specify the class name within the plugin, so name collisions can occur frequently. This PR adds an exception for the <plugin> so that no warning is emitted when a plugin name matches the names of other entities.

I've added overloads to functions in sdf::Element so that this PR can be backported to sdf9.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #721 (ad9b6fd) into main (cbb2b22) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head ad9b6fd differs from pull request most recent head 220275a. Consider uploading reports for the commit 220275a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #721      +/-   ##
==========================================
+ Coverage   88.20%   88.21%   +0.01%     
==========================================
  Files          76       76              
  Lines       11417    11430      +13     
==========================================
+ Hits        10070    10083      +13     
  Misses       1347     1347              
Impacted Files Coverage Δ
include/sdf/Element.hh 100.00% <ø> (ø)
src/Element.cc 96.86% <100.00%> (+0.04%) ⬆️
src/Model.cc 89.52% <100.00%> (+0.10%) ⬆️
src/World.cc 92.73% <100.00%> (+0.07%) ⬆️
src/parser.cc 86.03% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cbb2b22...220275a. Read the comment docs.

@chapulina chapulina added beta Targeting beta release of upcoming collection bug Something isn't working labels Sep 29, 2021
Copy link
Copy Markdown
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one minor nit about wording of documentation

looks good otherwise

Comment thread include/sdf/Element.hh Outdated

/// \brief List of elements to which exceptions are made when checking for
/// name uniqueness.
/// \return List of element types that are allowed to name collisions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a verb? "allowed to have name collisions"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addisu Z. Taddese added 2 commits September 29, 2021 19:54
@azeey azeey merged commit 1ffcca5 into gazebosim:main Sep 30, 2021
@azeey azeey deleted the no_warn_plugin branch September 30, 2021 04:14
azeey pushed a commit to azeey/sdformat that referenced this pull request Oct 15, 2021
…im#721)

Adds an exception for the <plugin> element so that no warning is emitted when a plugin name matches the names of other entities.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
azeey pushed a commit that referenced this pull request Oct 27, 2021
…ame uniqueness (#733)

* Backport test utilities from sdf10
* Backport Console redirect functionality
* Make exception for plugins when checking for name uniqueness (#721)
* Replace unavailable error printing API

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey mentioned this pull request Dec 16, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta Targeting beta release of upcoming collection bug Something isn't working 🏯 fortress Ignition Fortress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants