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

ParserConfig: add ToElementUseIncludeTag policy #887

Merged
merged 4 commits into from
Mar 23, 2022

Conversation

scpeters
Copy link
Member

🦟 Bug fix

Part of #881 and should be reviewed before the 12.4.0 release.

Summary

This adds a new policy to the ParserConfig class to replace
the boolean parameter in the Model, Root, and World
ToElement methods that specifies whether include tags should
be used or the complete model. ParserConfig objects are then
passed to the ToElement methods instead of the bool,
allowing the ParserConfig to be used in additional
sdf::initFile API calls. This changes only unreleased
parts of the API, which is permitted.

I don't love the SetToElementUseIncludeTag and ToElementUseIncludeTag method names, but it's the best I could think of on short notice. Suggestions are welcome.

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 and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

This adds a new policy to the ParserConfig class to replace
the boolean parameter in the Model, Root, and World
ToElement methods that specifies whether include tags should
be used or the complete model. ParserConfig objects are then
passed to the ToElement methods instead of the bool,
allowing the ParserConfig to be used in additional
sdf::initFile API calls. This changes only unreleased
parts of the API, which is permitted.

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters requested a review from azeey as a code owner March 19, 2022 11:27
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Mar 19, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2022

Codecov Report

Merging #887 (b0adcd2) into sdf12 (8733d08) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head b0adcd2 differs from pull request most recent head 91f01cc. Consider uploading reports for the commit 91f01cc to get more accurate results

@@           Coverage Diff           @@
##            sdf12     #887   +/-   ##
=======================================
  Coverage   88.16%   88.16%           
=======================================
  Files         100      100           
  Lines       14629    14634    +5     
=======================================
+ Hits        12897    12902    +5     
  Misses       1732     1732           
Impacted Files Coverage Δ
src/Model.cc 92.72% <100.00%> (ø)
src/ParserConfig.cc 100.00% <100.00%> (ø)
src/Root.cc 95.12% <100.00%> (ø)
src/World.cc 95.02% <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 8733d08...91f01cc. Read the comment docs.

Signed-off-by: Steve Peters <[email protected]>
@scpeters scpeters merged commit 0eea69f into gazebosim:sdf12 Mar 23, 2022
@scpeters scpeters deleted the parser_config_to_element branch March 23, 2022 06:23
@nkoenig
Copy link
Contributor

nkoenig commented Mar 25, 2022

@scpeters the use of ParserConfig seems a bit odd here. The ToElement functions are not 'parsing' and the other functions in the ParserConfig class don't seem relevant to the ToElement function.

I can create a new class that is tailored for ToElement conversion.

@azeey
Copy link
Collaborator

azeey commented Mar 25, 2022

@scpeters and I were just talking about this yesterday. I had mentioned to him that there was precedent for using PaserConfig as a general data structure for configuring the libsdformat library. Looking at the functions closely, I don't think I was correct. It looks like everything there (except to UseIncludeTag) is pertinent the internal parsing logic, so creating a new class for configuring outputs makes sense.

@scpeters
Copy link
Member Author

that sounds fine to me

@osrf-triage
Copy link

This pull request has been mentioned on Gazebo Community. There might be relevant details there:

https://community.gazebosim.org/t/new-ignition-releases-2022-04-13-fortress-edifice/1367/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants