-
Notifications
You must be signed in to change notification settings - Fork 90
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element Clone() now also clones the parent #1116
Conversation
Signed-off-by: Luca Della Vedova <luca@openrobotics.org>
Signed-off-by: Luca Della Vedova <luca@openrobotics.org>
Signed-off-by: Luca Della Vedova <luca@openrobotics.org>
Codecov Report
@@ Coverage Diff @@
## sdf12 #1116 +/- ##
=======================================
Coverage 91.28% 91.29%
=======================================
Files 80 80
Lines 13086 13089 +3
=======================================
+ Hits 11946 11949 +3
Misses 1140 1140
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, I would expect the code that called Also, it's not immediately clear to me how this fixes gazebosim/gz-sim#1561. Do you mind elaborating? |
Indeed, as I mentioned in the PR I am not quite aware if the current behavior is intended, I'm happy to close this PR if you think this change could cause issues in other areas since it's a pretty low level change.
It's been some time but if I remember correctly the issue was in two different areas (hence this PR):
Anyway I'll be closing this PR, at the end of the day the recommended approach in gazebosim/gz-sim#1561 (comment) works and sounds like it's the best way forward, from the silence in that issue it also sounds like we were the only ones using that specific workflow so it's probably fine not to go to great lengths and risk breaking other use cases for a quite obscure one. |
馃 Bug fix
Fixes gz-sim issue gazebosim/gz-sim#1561
Summary
Cloning elements didn't copy the element's parent, hence this information was lost after a
Clone()
operation. This caused a few issues in downstream packages that relied on reading an element's parent, which would work with the original element but wouldn't as soon as the element was cloned.Specifically this created some issues in Plugins at the gz-sim level.
I'm not sure whether it is intended that a cloned element has no parent, but if it's not this should fix it.
Note that
Copy()
has the same behavior of not copying the parent, but adding the same change there breaks a lot of downstream integration tests, so that's also something to keep in mindChecklist
codecheck
passed (See contributing)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.