Repository navigation
Conversation
Build the HTTP layer into the ROS-free gateway core library. The core reuses httplib::httplib and handles ENABLE_SWAGGER_UI. The core compiles and is tested without ROS and without DDS setup. scripts/check_cores_without_ros serves gateway health over HTTP from the core.
…ersion RestConfig gains server_name, vendor_name and server_version, so a program that hosts the core names its own server on GET /, GET /version-info and in the OpenAPI documents. The defaults are the values the ROS 2 node reports, and the node sets nothing.
| endif() | ||
|
|
||
| if(NOT TARGET cpp_httplib_target) | ||
| if(TARGET httplib::httplib) |
There was a problem hiding this comment.
An existing httplib::httplib target is reused without a version check. medkit_find_cpp_httplib() deliberately rejects >= 0.20 because the handlers still use the multipart MultipartFormData/req.files API, so a plain-CMake build that already defines a newer httplib fails to compile. Apply the same < 0.20 check here, or fall back to the vendored header when httplib_VERSION is 0.20 or newer.
| export -f compile_check | ||
| echo "Core purity: ${#ROS_FREE_SOURCES[@]} sources, ${#ROS_FREE_HEADERS[@]} headers compiled without ROS." | ||
| failed=$(printf '%s\n' "${ROS_FREE_SOURCES[@]}" "${ROS_FREE_HEADERS[@]}" | | ||
| xargs -P "$(nproc)" -I{} bash -c 'compile_check {} || echo FAILED' | tee /dev/stderr | grep -c '^FAILED' || true) |
There was a problem hiding this comment.
The compile check passes without compiling anything if xargs itself fails. For example nproc is missing (macOS), so -P "" is rejected: no FAILED line is printed, grep -c prints 0 and || true hides the pipeline status. Check the xargs exit status separately from the count, or fail when the number of checked files does not match ${#ROS_FREE_SOURCES[@]} + ${#ROS_FREE_HEADERS[@]}.
The Swagger UI page title now takes the server name from the server identity, HTML-escaped, and keeps the API Documentation suffix.
…-core-8-build-split
Pull Request
Summary
The HTTP layer is built into
gateway_core. The core reuses an existinghttplib::httplibtarget and handlesENABLE_SWAGGER_UI. It compiles with the smaller precompiled header ofgateway_core, without rclcpp headers.scripts/check_cores_without_rosnow also builds the gateway core, starts the REST server over minimalGatewayServicesand reads/api/v1/health.Issue
Type
Testing
./scripts/test.sh unit --packages-select ros2_medkit_gateway./scripts/test.sh integ --packages-select ros2_medkit_integration_testssrc/ros2_medkit_gateway/scripts/check_core_purity.shscripts/check_cores_without_ros/run.shexits 0.Checklist