-
Notifications
You must be signed in to change notification settings - Fork 164
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
newly created package fails colcon test #675
Comments
So looking at the failures, they both revolve around the copyright. This makes some sense, as the copyright wasn't specified in the initial Unfortunately, we don't have all of the information required in order to properly fill in that copyright header. In order to do that, we need both the copyright header text and the copyright holder. If the user specifies At the end of the day, this is a tradeoff. If we want to be rigorous and ensure that we'll pass the tests, then we'd need to have a required flag for the license (which we already have), and a required flag for the copyright holder (which we would have to add). This would go further towards our goal of making all packages have some license, at the expense of making this utility more pedantic and more difficult to use. The other way you could argue this is that the license is something that we want the user to examine and make deliberate choices about, so having it fail the tests out-of-the-box is the way it should be. I'm on the fence about which way to go here. @ros2/team any opinions? |
What about just using the
In case no copyright holder is specified or it is not taken from the maintainer, I would just deactivate the test in the CMake (
I wouldn't mind if package creators are forced to choose a licence when publishing code online. This makes it much easier to reuse packages. But this makes it also a bit cumbersome for users that just want to create a package for personal use. In summary, I think that those values should either be determined automatically from the provided parameters, or the tests should be deactivated if required values cannot be determined. |
One way to address the copyright issue is to disable the copyright test by default (uncomment line 82 in the linked snippet), allowing the package author to enable it later just by commenting a single line in the CMakeLists.txt file. ros2cli/ros2pkg/ros2pkg/resource/ament_cmake/CMakeLists.txt.em Lines 80 to 82 in 37fea06
That would still keep the tool relatively easy to use. For "smart" default behavior, maybe the |
I noticed that even after disabling |
We could do that, but I think there are no instances in the core codebase where the maintainer name is the same as the copyright holder name. That is, the maintainer is generally a person, while the copyright holder is generally an organization. So while we could rely on this, it will probably be wrong (and will pass the tests, meaning that the developer may overlook changing it).
I would be onboard with that. It doesn't fail the tests out-of-the-box, but it is at least a marker that the developer should do something about it. |
@christianrauch This could be due to a left-over test result. Try again in a clean workspace (e.g. remove the +1 for disabling the test by default. We can still pester the user with comments in the code to encourage them to add a license/test. |
Bug report
Creating a new node with ros2 creates a package that fails colcon test.
Required Info:
Steps to reproduce issue
ros2 pkg create my_package --build-type ament_cmake --dependencies rclcpp --node-name my_node
colcon build
,colcon test
Expected behavior
A newly created package should follow ROS2 standards and not fail its own tests.
Actual behavior
colcon test
fails:The text was updated successfully, but these errors were encountered: