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

ign -> gz Header Migration : ign-common #348

Merged
merged 4 commits into from
May 3, 2022
Merged

Conversation

methylDragon
Copy link
Contributor

@github-actions github-actions bot added the 🌱 garden Ignition Garden label Apr 28, 2022
@osrf-triage osrf-triage added this to Inbox in Core development Apr 28, 2022
@chapulina chapulina added the ign to gz Renaming Ignition to Gazebo. label Apr 28, 2022
@chapulina chapulina moved this from Inbox to In review in Core development Apr 28, 2022
@methylDragon methylDragon marked this pull request as draft April 28, 2022 23:55
@methylDragon methylDragon marked this pull request as ready for review April 29, 2022 22:49
@methylDragon
Copy link
Contributor Author

This is pending the merge and nightly of ign-math

@methylDragon methylDragon force-pushed the header_migration branch 2 times, most recently from 9254bfa to 724125f Compare April 30, 2022 01:04
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

LGTM with green CI. My comments below can be addressed in follow-up PRs if that's easier.

av/include/ignition/common/HWEncoder.hh Outdated Show resolved Hide resolved
av/include/ignition/common/HWVideo.hh Outdated Show resolved Hide resolved
@@ -0,0 +1,2 @@
add_subdirectory(gz)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
Copy link
Contributor

Choose a reason for hiding this comment

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

geospatial is a new component from Garden, so we don't need to add ignition headers and can go straight to gz, because no downstream users should be using it yet anyway.

One caveat is that our libraries are already using it, so one strategy we could take would be to keep ignition/geospatial while we're updating all libraries, and then remove it afterwards.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be neater to remove it during the namespace (or maybe the source) migration? I'm not sure :o

Copy link
Contributor

Choose a reason for hiding this comment

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

I think any time after the header migration for all libraries should work, because none of the libraries should be using them anymore. So I'm fine either way. It's probably good to do it as a standalone PR for visibility. We just shouldn't forget to do it.

@@ -0,0 +1,196 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

We're deprecating all the *Plugin* files from ign-common on Garden, in favor of using the ign-plugin library. So I think we don't need to add gz counterparts to it.

I'd be ok doing this in a separate PR, we don't even have IGN_DEPRECATED notices on them anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's do this in a separate PR, so it can be tracked independently.

I'll track this in the issue here: #349
But I suspect I'll be focused on the other libraries.

@@ -15,98 +15,4 @@
*
*/

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the detail directories aren't part of the public API, I think we can just remove them.

If include/ignition/common/Plugin.hh isn't including include/ignition/common/detail/Plugin.hh, no one else is.

This is valid for all libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I double check if this means that I delete all detail redirection headers across all libraries?

Copy link
Member

Choose a reason for hiding this comment

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

Since the detail directories aren't part of the public API, I think we can just remove them.

If include/ignition/common/Plugin.hh isn't including include/ignition/common/detail/Plugin.hh, no one else is.

This is valid for all libraries.

I disagree. These are installed header files, so they are part of the public API, and they are included from the header files not in the detail folder, though often from the bottom of the file so it is easy to miss:

I think it would be best to keep the redirection headers for all the contents of the detail subfolders

Copy link
Contributor

Choose a reason for hiding this comment

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

These are installed header files, so they are part of the public API,

I understand that we've never explicitly declared our public API, and we should. But the reason that the detail directories exist is that they're not meant to be directly used by downstream. They're installed because of technicalities of the language which require those templates to be installed, but that's an implementation detail, not our API. And as such, we don't need to tick-tock them.

ROS QL1 packages explicitly call this out. I ticketed this issue so we document this properly for Gazebo:

I think it would be best to keep the redirection headers for all the contents of the detail subfolders

Having them there wouldn't break anything, but those should be dead files that no one is using. I'd say that keeping them there sends the wrong message that those are part of our public API and subject to tick-tock.

Copy link
Member

Choose a reason for hiding this comment

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

I'm getting a very different impression from your first and most recent comments. I think your points are reasonable, but the way they were initially phrased was a bit alarming to me.

Since the detail directories aren't part of the public API, I think we can just remove them.

I've gathered from your subsequent comment that the context is specifically about redirection headers in a detail subfolder, but on first glance it sounded to me like you were saying we can delete detail headers at any time from anywhere with no impact on API, which is absolutely not true. I now think you meant we don't need to tick-tock them, which is reasonable.

If include/ignition/common/Plugin.hh isn't including include/ignition/common/detail/Plugin.hh, no one else is.

Again, I now gather that this context is about redirection headers, not public headers in general, since gz/common/Plugin.hh does include gz/common/detail/Plugin.hh

This is valid for all libraries.

Nothing specific here but it added to my alarm! 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry I should have been clearer. Yes, what I meant is that we can remove the ignition/*/detail/*.hh headers that just include gz/*/detail/*.hh

Copy link
Member

Choose a reason for hiding this comment

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

I think downstream users are less likely to need the ignition/*/detail/* redirection headers. I would lean towards redirecting all headers for now until we've migrated headers for all the ignition libraries and then consider removing the detail redirects when we add the deprecation warnings to the primary redirection headers.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think downstream users are less likely to need the ignition//detail/ redirection headers

If they're including them directly, that's a mistake on their part.

I would lean towards redirecting all headers for now until we've migrated headers

I'm ok with that if it makes things easier. We already have a long list of things to go back to, and long PRs to review. If the script could be updated to skip the detail folders automatically I think that would make our lives easier...

Copy link
Contributor Author

@methylDragon methylDragon May 4, 2022

Choose a reason for hiding this comment

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

profiler/CMakeLists.txt Show resolved Hide resolved
*
*/

#include <gz/common/testing/AutoLogFixture.hh>
Copy link
Contributor

Choose a reason for hiding this comment

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

The testing component is also new on Garden, just like geospatial. So we don't need to provide ignition/testing headers.

@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #348 (4d4366b) into main (fa6cd64) will not change coverage.
The diff coverage is n/a.

❗ Current head 4d4366b differs from pull request most recent head fcf8f68. Consider uploading reports for the commit fcf8f68 to get more accurate results

@@           Coverage Diff           @@
##             main     #348   +/-   ##
=======================================
  Coverage   91.66%   91.66%           
=======================================
  Files           1        1           
  Lines          48       48           
=======================================
  Hits           44       44           
  Misses          4        4           

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 fa6cd64...fcf8f68. Read the comment docs.

Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
@methylDragon methylDragon merged commit 3aadb66 into main May 3, 2022
@methylDragon methylDragon deleted the header_migration branch May 3, 2022 05:05
Core development automation moved this from In review to Done May 3, 2022
@j-rivero j-rivero removed this from Done in Core development May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden ign to gz Renaming Ignition to Gazebo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants