From 313235df728f5260278daa36009ad6e9d8cae046 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 16:46:36 +0200 Subject: [PATCH] Add rclc_parameter Quality Declaration (backport #144) (#181) * Add rclc_parameter Quality Declaration (#144) * Add rclc_parameter Quality Declaration Signed-off-by: Jan Staschulat * Update rclc_parameter/QUALITY_DECLARATION.md Co-authored-by: Jan Staschulat Signed-off-by: Jan Staschulat * added RCL_PUBLIC to function declarations in executor.h Signed-off-by: Jan Staschulat * updated printf format string to %lld Signed-off-by: Jan Staschulat * corrected printf format for 'unsigned long' Signed-off-by: Jan Staschulat * Modify building library flag in params Signed-off-by: Pablo Garrido * fix target_compile_definitions for visibility macro Signed-off-by: Jan Staschulat Signed-off-by: Jan Staschulat * ament_uncrustify Signed-off-by: Jan Staschulat Signed-off-by: Jan Staschulat Co-authored-by: Jan Staschulat (cherry picked from commit 6f9f9f4a97c844e681bbb8b222e44d8f969b9b39) * fixed dependency of rcl on galactic branch Signed-off-by: Jan Staschulat Co-authored-by: Pablo Garrido Co-authored-by: Jan Staschulat --- rclc/include/rclc/executor.h | 6 + rclc/test/rclc/test_executor.cpp | 4 +- rclc_parameter/CMakeLists.txt | 7 +- rclc_parameter/QUALITY_DECLARATION.md | 222 ++++++++++++++++++++++++++ 4 files changed, 236 insertions(+), 3 deletions(-) create mode 100644 rclc_parameter/QUALITY_DECLARATION.md diff --git a/rclc/include/rclc/executor.h b/rclc/include/rclc/executor.h index 2e8e6a1c..5402a72d 100644 --- a/rclc/include/rclc/executor.h +++ b/rclc/include/rclc/executor.h @@ -260,6 +260,7 @@ rclc_executor_add_subscription( * \return `RCL_RET_INVALID_ARGUMENT` if any parameter is a null pointer (NULL context is ignored) * \return `RCL_RET_ERROR` if any other error occured */ +RCLC_PUBLIC rcl_ret_t rclc_executor_add_subscription_with_context( rclc_executor_t * executor, @@ -504,6 +505,7 @@ rclc_executor_add_guard_condition( * \return `RCL_RET_INVALID_ARGUMENT` if any parameter is a null pointer * \return `RCL_RET_ERROR` if any other error occured */ +RCLC_PUBLIC rcl_ret_t rclc_executor_remove_subscription( rclc_executor_t * executor, @@ -531,6 +533,7 @@ rclc_executor_remove_subscription( * \return `RCL_RET_INVALID_ARGUMENT` if any parameter is a null pointer * \return `RCL_RET_ERROR` if any other error occured */ +RCLC_PUBLIC rcl_ret_t rclc_executor_remove_timer( rclc_executor_t * executor, @@ -558,6 +561,7 @@ rclc_executor_remove_timer( * \return `RCL_RET_INVALID_ARGUMENT` if any parameter is a null pointer * \return `RCL_RET_ERROR` if any other error occured */ +RCLC_PUBLIC rcl_ret_t rclc_executor_remove_client( rclc_executor_t * executor, @@ -585,6 +589,7 @@ rclc_executor_remove_client( * \return `RCL_RET_INVALID_ARGUMENT` if any parameter is a null pointer * \return `RCL_RET_ERROR` if any other error occured */ +RCLC_PUBLIC rcl_ret_t rclc_executor_remove_service( rclc_executor_t * executor, @@ -611,6 +616,7 @@ rclc_executor_remove_service( * \return `RCL_RET_INVALID_ARGUMENT` if any parameter is a null pointer * \return `RCL_RET_ERROR` if any other error occured */ +RCLC_PUBLIC rcl_ret_t rclc_executor_remove_guard_condition( rclc_executor_t * executor, diff --git a/rclc/test/rclc/test_executor.cpp b/rclc/test/rclc/test_executor.cpp index 44efa052..63ca3e11 100644 --- a/rclc/test/rclc/test_executor.cpp +++ b/rclc/test/rclc/test_executor.cpp @@ -1706,8 +1706,8 @@ TEST_F(TestDefaultExecutor, spin_period) { } // compute avarage time duration between calls to spin_period_callback uint64_t duration = test_case_evaluate_spin_period(); - printf("expected 'spin_period' : %ld ns\n", spin_period); - printf("actual (%d iterations) : %ld ns\n", TC_SPIN_PERIOD_MAX_INVOCATIONS, duration); + printf("expected 'spin_period' : %lu ns\n", spin_period); + printf("actual (%d iterations) : %lu ns\n", TC_SPIN_PERIOD_MAX_INVOCATIONS, duration); uint64_t delta = 5000000; // 5 ms interval EXPECT_LE(duration, spin_period + delta); diff --git a/rclc_parameter/CMakeLists.txt b/rclc_parameter/CMakeLists.txt index a39354c5..ed584029 100644 --- a/rclc_parameter/CMakeLists.txt +++ b/rclc_parameter/CMakeLists.txt @@ -65,13 +65,17 @@ ament_target_dependencies(${PROJECT_NAME} rosidl_runtime_c ) + + ################################################# # install ################################################# # Causes the visibility macros to use dllexport rather than dllimport, # which is appropriate when building the dll but not consuming it. target_compile_definitions(${PROJECT_NAME} - PRIVATE "RCLC_BUILDING_LIBRARY") + PUBLIC "RCLC_PARAMETER_BUILDING_LIBRARY") +# this alternative would also work +#add_definitions(-DRCLC_PARAMETER_BUILDING_LIBRARY) install( TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME} @@ -112,6 +116,7 @@ if(BUILD_TESTING) target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME}) ament_target_dependencies(${PROJECT_NAME}_test rclcpp + rclc rcl rcutils rosidl_generator_c diff --git a/rclc_parameter/QUALITY_DECLARATION.md b/rclc_parameter/QUALITY_DECLARATION.md new file mode 100644 index 00000000..1cb87b03 --- /dev/null +++ b/rclc_parameter/QUALITY_DECLARATION.md @@ -0,0 +1,222 @@ +This document is a declaration of software quality for the `rclc_parameter` package, based on the guidelines in [REP-2004](https://www.ros.org/reps/rep-2004.html). + +# `rclc_parameter` Quality Declaration + +The package `rclc_parameter` claims to be in the **Quality Level 2** category when it is used with a **Quality Level 2** middleware. + +Below are the rationales, notes, and caveats for this claim, organized by each requirement listed in the [Package Quality Categories in REP-2004](https://www.ros.org/reps/rep-2004.html). + +## Version Policy [1] + +### Version Scheme [1.i] + +`rclc_parameter` uses `semver` according to the recommendation for ROS Core packages in the [ROS 2 Developer Guide](https://docs.ros.org/en/rolling/Contributing/Developer-Guide.html#versioning). + +### Version Stability [1.ii] + +`rclc_parameter` is at a stable version, i.e. `>= 1.0.0`. +The current version can be found in its [package.xml](package.xml), and its change history can be found in its [CHANGELOG](CHANGELOG.rst). + +### Public API Declaration [1.iii] + +All symbols in the installed headers are considered part of the public API. + +All installed headers are in the [`include`](./include/rclc_parameter) directory of the package, headers in any other folders are not installed and considered private. + +### API Stability Policy [1.iv] + +`rclc_parameter` will not break public API within a released ROS distribution, i.e. no major releases once the ROS distribution is released. + +### ABI Stability Policy [1.v] + +`rclc_parameter` contains C code and therefore must be concerned with ABI stability and will maintain ABI stability within a ROS distribution. Because an ABI-break is considered as major version change, there will be no major releases once the ROS distribution is released. + +### API and ABI Stability Within a Released ROS Distribution [1.vi] + +`rclc_parameter` will not break API nor ABI within a released ROS distribution, i.e. no major releases once the ROS distribution is released. + +## Change Control Process [2] + +The stability of `rclc_parameter` is ensured through reviews, CI and tests. +The change control process can be found in [CONTRIBUTING](../CONTRIBUTING.md). + +All changes to `rclc_parameter` occur through pull requests that are required to pass all CI tests. +In case of failure, only maintainers can merge the pull request, and only when there is enough evidence that the failure is unrelated to the change. +Additionally, all pull requests must have at least one positive review from another contributor that did not author the pull request. + +### Change Requests [2.i] + +All changes will occur through a pull request. + +### Contributor Origin [2.ii] + +This package uses [Developer Certificate of Origin (DCO)](https://developercertificate.org/) as its confirmation of contributor origin policy since version 1.0.0. More information can be found in [CONTRIBUTING](../CONTRIBUTING.md). + +### Peer Review Policy [2.iii] + +All pull requests will be peer-reviewed by at least one other contributor who did not author the pull request. Approval is required before merging. + +### Continuous Integration [2.iv] + +All pull requests must pass CI to be considered for merging, unless maintainers consider that there is enough evidence that the failure is unrelated to the changes. +CI testing is automatically triggered by incoming pull requests. +Current results can be seen [../README.md](../README.md). + +### Documentation Policy [2.v] + +All pull requests must resolve related documentation changes before merging. + +## Documentation [3] + +### Feature Documentation [3.i] + +`rclc_parameter` features are documented in the package in the header files. + +### Public API Documentation [3.ii] + +`rclc_parameter` has embedded API documentation. + +### License [3.iii] + +The license for `rclc_parameter` is Apache 2.0, and a summary can be found in each source file. +A full copy of the license can be found [here](../LICENSE). + +### Copyright Statements [3.iv] + +The copyright holders each provide a statement of copyright in each source code file in `rclc_parameter`. + +## Testing [4] + +### Feature Testing [4.i] + +`rclc_parameter` provides tests which simulate typical usage, and they are located in the [`test` directory](test). +New features are required to have tests before being added as stated in [CONTRIBUTING](CONTRIBUTING.md). +Current results can be seen [../README.md](../README.md). + +Most features in `rclc_parameter` have corresponding tests which simulate typical usage, and they are located in the [`test`](./test) directory. +New features are required to have tests before being added. + +### Public API Testing [4.ii] + +Each part of the public API has tests, and new additions or changes to the public API require tests before being added. The tests aim to cover both typical usage and corner cases, but are quantified by contributing to code coverage. + +### Coverage [4.iii] + +The coverage report is available in the [../README.md](../README.md). + +`rclc_parameter` checks the coverage of every commit. Last coverage assessment can be seen in [Codecov](https://app.codecov.io/gh/ros2/rclc/commits). + +### Coverage [4.iv] + +Performance tests for `rclc_parameter` have not been implemented. + +### Linters and Static Analysis [4.v] + +`rclc_parameter` code style is enforced using [uncrustify](https://github.com/uncrustify/uncrustify). +Among the CI tests, there are tests that ensure that every pull request is compliant with the code style. +The latest CI results can be seen [../README.md](../README.md). + +`rclc_parameter` uses and passes all the standard linters and static analysis tools for a C99 package as described in the [ROS 2 Developer Guide](https://docs.ros.org/en/rolling/Contributing/Developer-Guide.html#linters-and-static-analysis). + +Results of the latest linter tests can be found in the [../README.md](../README.md) + +## Dependencies [5] + +Below are evaluations of each of `rclc_parameter`'s run-time and build-time dependencies that have been determined to influence the quality. + +It has several "buildtool" dependencies, which do not affect the resulting quality of the package, because they do not contribute to the public library API. +It also has several test dependencies, which do not affect the resulting quality of the package, because they are only used to build and run the test code. + +### Direct Runtime ROS Dependencies [5.i] + +#### `rcl` + +The `rcl` package provides the API of the common library to support implementation of language specific ROS Client Libraries. + +It is **Quality Level 1**, see its [Quality Declaration document](https://github.com/ros2/rcl/blob/master/rcl/QUALITY_DECLARATION.md). + +#### `rcutils` + +The `rcutils` package provides an API which contains common utilities and data structures needed when programming in C. + +It is **Quality Level 1**, see its [Quality Declaration document](https://github.com/ros2/rcutils/blob/master/QUALITY_DECLARATION.md). + +#### `rosidl_runtime_c` + +The `rosidl_runtime_c` package is a core-ros package and runtime ROSIDL functionality in C. + +It is **Quality Level 1**, see its [Quality Declaration document](https://github.com/ros2/rosidl/blob/master/rosidl_runtime_c/QUALITY_DECLARATION.md). + +#### `builtin_interfaces` + +The `builtin_interfaces` is a package containing message definitions for types defined in the OMG IDL Platform Specific Model. + +It is **Quality Level 1**, see its [Quality Declaration document](https://github.com/ros2/rcl_interfaces/blob/master/builtin_interfaces/QUALITY_DECLARATION.md). + +#### `rcl_interfaces` + +The `rcl_interfaces` contains the messages and services which ROS client libraries will use under the hood to communicate higher level concepts such as parameters. + +It is **Quality Level 1**, see its [Quality Declaration document](https://github.com/ros2/rcl_interfaces/blob/master/rcl_interfaces/QUALITY_DECLARATION.md). + +### Optional Direct Runtime ROS Dependencies [5.ii] + +`rclc_parameter` has no optional Direct Runtime ROS dependencies that need to be considered for this declaration. + +### Direct Runtime non-ROS Dependency [5.iii] + +`rclc_parameter` has no Direct Runtime non-ROS dependencies that need to be considered for this declaration. + +## Platform Support [6] + +`rclc_parameter` supports all of the tier 1 platforms as described in [REP-2000](https://www.ros.org/reps/rep-2000.html#support-tiers) for Galactic Release (i.e.: Linux amd64, Linux arm64 and Windows 10), and tests each change against all of them. + +## Security [7] + +### Vulnerability Disclosure Policy [7.i] + +This package conforms to the Vulnerability Disclosure Policy in [REP-2006](https://www.ros.org/reps/rep-2006.html). + +# Current status Summary + +The chart below compares the requirements in the REP-2004 with the current state of the `rclc_parameter` package. + +|Number| Requirement| Current state | +|--|--|--| +|1| **Version policy** |---| +|1.i|Version Policy available | ✓ | +|1.ii|Stable version |✓| +|1.iii|Declared public API|✓| +|1.iv|API stability policy|✓| +|1.v|ABI stability policy|✓| +|1.vi|API/ABI stable within ros distribution|✓| +|2| **Change control process** |---| +|2.i| All changes occur on change request | ✓| +|2.ii| Contributor origin (DCO, CLA, etc) | ✓| +|2.iii| Peer review policy | ✓ | +|2.iv| CI policy for change requests | ✓ | +|2.v| Documentation policy for change requests | ✓ | +|3| **Documentation** | --- | +|3.i| Per feature documentation | ✓ | +|3.ii| Per public API item documentation | ✓ | +|3.iii| Declared License(s) | ✓ | +|3.iv| Copyright in source files| ✓ | +|3.v.a| Quality declaration linked to README | ✓ | +|3.v.b| Centralized declaration available for peer review |✓| +|4| Testing | --- | +|4.i| Feature items tests | ✓ | +|4.ii| Public API tests | ✓ | +|4.iii.a| Using coverage | ✓ | +|4.iii.a| Coverage policy | ✓ | +|4.iv.a| Performance tests (if applicable) | x | +|4.iv.b| Performance tests policy| x | +|4.v.a| Code style enforcement (linters)| ✓ | +|4.v.b| Use of static analysis tools | ✓ | +|5| Dependencies | --- | +|5.i| Must not have ROS lower level dependencies | ✓ | +|5.ii| Optional ROS lower level dependencies| ✓ | +|5.iii| Justifies quality use of non-ROS dependencies |✓| +|6| Platform support | --- | +|6.i| Support targets Tier1 ROS platforms| ✓ | +|7| Security | --- | +|7.i| Vulnerability Disclosure Policy | ✓ |