Skip to content

Add GET /apps/{app-id}/is-located-on endpoint#299

Merged
bburda merged 3 commits intoselfpatch:mainfrom
eclipse0922:fix/app-is-located-on-endpoint
Mar 21, 2026
Merged

Add GET /apps/{app-id}/is-located-on endpoint#299
bburda merged 3 commits intoselfpatch:mainfrom
eclipse0922:fix/app-is-located-on-endpoint

Conversation

@eclipse0922
Copy link
Contributor

@eclipse0922 eclipse0922 commented Mar 21, 2026

Pull Request

Summary

  • add GET /apps/{app-id}/is-located-on discovery route and handler
  • return the host component as a 0-or-1 items response, including x-medkit.missing=true when an unresolved host reference is encountered
  • add unit and integration coverage for success, empty result, invalid ID, unknown app, and endpoint registration

Issue

Link the related issue (required):


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

  • Built in the devcontainer with source /opt/ros/jazzy/setup.bash && colcon build --packages-up-to ros2_medkit_integration_tests --build-base build-dev195 --install-base install-dev195
  • Ran source /opt/ros/jazzy/setup.bash && source install-dev195/setup.bash && colcon test --packages-select ros2_medkit_gateway --build-base build-dev195 --install-base install-dev195
  • Ran colcon test-result --verbose --test-result-base build-dev195/ros2_medkit_gateway (2119 tests, 0 errors, 0 failures, 244 skipped)
  • Ran source /opt/ros/jazzy/setup.bash && source install-dev195/setup.bash && colcon test --packages-select ros2_medkit_integration_tests --build-base build-dev195 --install-base install-dev195 --ctest-args -R "test_health|test_hateoas" --output-on-failure
  • Ran colcon test-result --verbose --test-result-base build-dev195/ros2_medkit_integration_tests (27 tests, 0 errors, 0 failures, 0 skipped)

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

@bburda bburda requested review from bburda and Copilot and removed request for bburda March 21, 2026 16:50
@bburda bburda self-requested a review March 21, 2026 16:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new discovery relationship endpoint to the ROS 2 Medkit Gateway REST API: GET /apps/{app-id}/is-located-on, allowing clients to resolve an App’s host Component (the inverse of /components/{id}/hosts).

Changes:

  • Register GET /apps/{app-id}/is-located-on in RESTServer::setup_routes().
  • Implement DiscoveryHandlers::handle_app_is_located_on() to return a 0-or-1 items list with _links and x-medkit.total_count.
  • Add/extend unit + gateway HTTP tests for success, empty result, invalid ID, and unknown app cases.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/ros2_medkit_gateway/src/http/rest_server.cpp Registers the new /is-located-on route for apps.
src/ros2_medkit_gateway/src/http/handlers/discovery_handlers.cpp Implements the new handler logic and response envelope.
src/ros2_medkit_gateway/include/ros2_medkit_gateway/http/handlers/discovery_handlers.hpp Declares the new handler method.
src/ros2_medkit_gateway/test/test_discovery_handlers.cpp Adds unit tests for the new relationship endpoint and adjusts seeded manifest expectations.
src/ros2_medkit_gateway/test/test_gateway_node.cpp Adds an HTTP-level test and a manifest fixture for the new endpoint.

Copy link
Collaborator

@bburda bburda left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! LGTM!

@bburda bburda merged commit 81dc345 into selfpatch:main Mar 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement GET /apps/{app-id}/is-located-on endpoint

3 participants