Skip to content

Conversation

@mfaferek93
Copy link
Collaborator

@mfaferek93 mfaferek93 commented Nov 29, 2025

Pull Request

Summary

implement PUT /components/{component_id}/data/{topic_name} endpoint

  • Add publish_to_topic() method to DataAccessManager using ros2 topic pub --once
    • Implement PUT handler with input validation:
      • Required fields: type (message type), data (payload)
      • Message type format validation (package/msg/Type)
      • Component existence check
    • Add 6 integration tests for publish endpoint (REQ_INTEROP_020)
    • Update Postman collection with PUT examples
    • Standardize endpoint list format with HTTP method prefixes

Issue

Link the related issue (required):


Type

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

Testing

How was this tested / how should reviewers verify it?


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

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

This PR implements the PUT endpoint for publishing data to component topics via the ROS 2 Medkit Gateway. It allows external systems to publish messages to ROS 2 topics through the REST API, completing the bidirectional data access capability (REQ_INTEROP_020).

Key changes:

  • Added publish_to_topic() method to DataAccessManager that uses ros2 topic pub --once
  • Implemented PUT /components/{component_id}/data/{topic_name} handler with comprehensive input validation
  • Added 6 integration tests covering success and error scenarios
  • Updated endpoint lists with HTTP method prefixes for better clarity

Reviewed changes

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

Show a summary per file
File Description
src/ros2_medkit_gateway/src/data_access_manager.cpp Implements publish_to_topic() method using ROS 2 CLI wrapper to publish messages
src/ros2_medkit_gateway/include/ros2_medkit_gateway/data_access_manager.hpp Adds publish_to_topic() method declaration with documentation
src/ros2_medkit_gateway/src/rest_server.cpp Implements PUT endpoint handler with validation and error handling
src/ros2_medkit_gateway/include/ros2_medkit_gateway/rest_server.hpp Adds handle_component_topic_publish() method declaration
src/ros2_medkit_gateway/test/test_integration.test.py Adds 6 integration tests and updates endpoint list assertions with HTTP method prefixes
src/ros2_medkit_gateway/test/test_gateway_node.cpp Updates endpoint count and list format with HTTP method prefixes
postman/collections/ros2-medkit-gateway.postman_collection.json Adds two example PUT requests for publishing to topics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mfaferek93 mfaferek93 force-pushed the 29/PUT/components/component_id/data/topic_name branch from 26d7af8 to 3a88030 Compare November 30, 2025 12:25
@mfaferek93 mfaferek93 added enhancement New feature or request milestone-1 labels Nov 30, 2025
…} endpoint

  - Add publish_to_topic() method to DataAccessManager using ros2 topic pub --once
  - Implement PUT handler with input validation:
    - Required fields: type (message type), data (payload)
    - Message type format validation (package/msg/Type)
    - Component existence check
  - Add 6 integration tests for publish endpoint (REQ_INTEROP_020)
  - Update Postman collection with PUT examples
  - Standardize endpoint list format with HTTP method prefixes
@mfaferek93 mfaferek93 force-pushed the 29/PUT/components/component_id/data/topic_name branch from 3a88030 to 5dcf096 Compare November 30, 2025 12:33
@mfaferek93 mfaferek93 requested a review from bburda November 30, 2025 12:33
@mfaferek93 mfaferek93 merged commit bcdc45f into main Nov 30, 2025
3 checks passed
@mfaferek93 mfaferek93 deleted the 29/PUT/components/component_id/data/topic_name branch December 6, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request milestone-1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement PUT /components/{component_id}/data/{topic_name} endpoint to enable publishing data to component topics

2 participants