Skip to content

Comments

feat(faults): add global DELETE /api/v1/faults endpoint#228

Merged
mfaferek93 merged 7 commits intomainfrom
feat/226-global-delete-faults
Feb 19, 2026
Merged

feat(faults): add global DELETE /api/v1/faults endpoint#228
mfaferek93 merged 7 commits intomainfrom
feat/226-global-delete-faults

Conversation

@mfaferek93
Copy link
Collaborator

@mfaferek93 mfaferek93 commented Feb 19, 2026

Closes #226

Pull Request

Summary

Add DELETE /api/v1/faults to clear all faults system-wide regardless of entity ownership. Supports optional ?status= query parameter for filtering. Returns 204 No Content on success.

This is a ros2_medkit extension (not SOVD). Mirrors the existing GET /api/v1/faults convenience endpoint.


Issue


Type

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

Testing

  • 3 integration tests added: basic DELETE 204, ?status=all, invalid status 400
  • Manual: curl -X DELETE http://localhost:8080/api/v1/faults returns 204

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

@mfaferek93 mfaferek93 marked this pull request as ready for review February 19, 2026 17:59
Copilot AI review requested due to automatic review settings February 19, 2026 17:59
@mfaferek93 mfaferek93 self-assigned this Feb 19, 2026
Add DELETE /faults to clear all faults system-wide regardless of entity
ownership. Supports optional ?status= query parameter for filtering.
Returns 204 No Content on success.

Closes #226
@mfaferek93 mfaferek93 force-pushed the feat/226-global-delete-faults branch 2 times, most recently from a789ce4 to 075c729 Compare February 19, 2026 18:03
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 global fault-management REST extension to allow clearing faults system-wide (not scoped to a specific entity), aligning with the existing convenience GET /api/v1/faults endpoint.

Changes:

  • Registers DELETE /api/v1/faults and implements a handler that lists faults and clears them (optionally filtered by ?status=).
  • Adds integration tests covering success responses for the new DELETE route and invalid status handling.
  • Documents the new global DELETE endpoint in the REST API docs.

Reviewed changes

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

Show a summary per file
File Description
src/ros2_medkit_gateway/src/http/rest_server.cpp Registers the new global DELETE /faults route.
src/ros2_medkit_gateway/src/http/handlers/fault_handlers.cpp Implements global clear logic by listing faults and calling clear_fault() per code.
src/ros2_medkit_gateway/include/ros2_medkit_gateway/http/handlers/fault_handlers.hpp Exposes the new handler method and updates the endpoint list comment.
src/ros2_medkit_gateway/test/test_integration.test.py Adds integration coverage for the new DELETE endpoint (status code / invalid param).
docs/api/rest.rst Documents DELETE /api/v1/faults as an extension endpoint.

"pending and confirmed" instead of ambiguous "active faults"
(SOVD "active" means confirmed-only).
@mfaferek93 mfaferek93 force-pushed the feat/226-global-delete-faults branch from 075c729 to fefbbd0 Compare February 19, 2026 18:11
…0->204 in docs

- Pass include_muted=true to list_faults() in handle_clear_all_faults_global()
  so muted faults are also cleared by DELETE /faults
- Fix existing DELETE /{entity}/faults/{code} docs: 200 -> 204 to match impl
@mfaferek93 mfaferek93 force-pushed the feat/226-global-delete-faults branch from 92cf9f9 to 9fa0342 Compare February 19, 2026 18:51
@mfaferek93 mfaferek93 requested a review from bburda February 19, 2026 19:25
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.

Solid change - mirrors the existing GET /api/v1/faults nicely, reuses parse_fault_status_param, correctly returns 204. The docs fix (200->204) for the existing single-fault DELETE also aligns with SOVD spec.

3 inline comments below.

@mfaferek93 mfaferek93 requested a review from bburda February 19, 2026 20:15
@mfaferek93 mfaferek93 merged commit 347de02 into main Feb 19, 2026
6 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.

Add global DELETE /api/v1/faults endpoint (extension)

2 participants