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

Make exception for plugins when checking for name uniqueness #721

Merged
merged 3 commits into from
Sep 30, 2021

Conversation

azeey
Copy link
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

@codecov-commenter
Copy link

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
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

@@ -532,6 +560,11 @@ namespace sdf
/// \return A pointer to the named element if found, nullptr otherwise.
public: ElementPtr GetElementImpl(const std::string &_name) const;

/// \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
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
Collaborator Author

Choose a reason for hiding this comment

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

@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 added 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 <[email protected]>
azeey added 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 <[email protected]>
@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.

4 participants