Skip to content

Conversation

@mfaferek93
Copy link
Collaborator

@mfaferek93 mfaferek93 commented Jan 3, 2026

Pull Request

Summary

add GET /api/v1/faults endpoint for system-wide fault retrieval

Add convenience API endpoint that returns all faults across the system
without requiring iteration over individual components. Supports status
filtering via query parameter (?status=pending|confirmed|cleared|all).


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

…ult retrieval

  Add convenience API endpoint that returns all faults across the system
  without requiring iteration over individual components. Supports status
  filtering via query parameter (?status=pending|confirmed|cleared|all).
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 adds a new convenience endpoint GET /api/v1/faults that retrieves all faults across the entire system without requiring iteration over individual components. The endpoint supports optional status filtering via query parameter (?status=pending|confirmed|cleared|all).

Key changes:

  • Added system-wide fault retrieval endpoint for dashboard/monitoring use cases
  • Implemented status filtering with default behavior (pending + confirmed, excluding cleared)
  • Added integration tests validating the endpoint's basic functionality and status filtering

Reviewed changes

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

File Description
src/ros2_medkit_gateway/include/ros2_medkit_gateway/rest_server.hpp Declared new handle_list_all_faults handler method
src/ros2_medkit_gateway/src/rest_server.cpp Implemented GET /api/v1/faults endpoint with status filtering, added route registration, and updated root endpoint documentation
src/ros2_medkit_gateway/test/test_integration.test.py Added integration tests for global fault listing and status filtering, updated root endpoint test to verify new endpoint is advertised

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 5 out of 5 changed files in this pull request and generated 4 comments.

@mfaferek93 mfaferek93 changed the base branch from 94/topicBasedComponentDiscovery to main January 3, 2026 19:59
Address code review feedback:
- Extract FaultStatusFilter struct and parse_fault_status_param() helper
  to eliminate code duplication between fault listing functions
- Return 400 Bad Request for invalid status parameter values
- Add tests for invalid status handling (test_61, test_62)
- Extend test_60 to cover all valid status values
- Document Faults Endpoints section in README.md
- Add system-wide faults requests to Postman collection
@mfaferek93 mfaferek93 changed the base branch from main to 94/topicBasedComponentDiscovery January 3, 2026 20:15
@mfaferek93 mfaferek93 requested a review from bburda January 3, 2026 20:16
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.

2 participants