feat(rest-api-protocol): migrate health_check context to contract-first architecture#1946
Merged
josecelano merged 3 commits intoJun 25, 2026
Conversation
…st architecture Move Status and Report DTOs from axum-rest-api-server to rest-api-protocol. The health_check context now follows the contract-first architecture pattern: protocol DTOs live in the protocol crate, and the Axum handler imports from there. - Create rest-api-protocol/src/v1/resources/health_check.rs - Export new module from rest-api-protocol resources mod.rs - Remove local resources.rs from axum-rest-api-server health_check - Update handler and test imports to use protocol crate
There was a problem hiding this comment.
Pull request overview
Migrates the REST API v1 health_check context to the contract-first architecture by moving its DTOs into rest-api-protocol, updating the Axum server to consume those protocol DTOs, and adjusting the integration test and EPIC/spec documentation accordingly.
Changes:
- Added
v1::resources::health_checkDTOs (Status,Report) totorrust-tracker-rest-api-protocoland exported the module. - Updated
axum-rest-api-serverhealth_check handler to return protocol DTOs; removed the server-local DTO module. - Updated the REST API integration test and issue-spec/EPIC progress docs to reflect the migration.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/rest-api-protocol/src/v1/resources/mod.rs | Exposes the new health_check protocol resource module. |
| packages/rest-api-protocol/src/v1/resources/health_check.rs | Introduces contract DTOs for the /api/health_check endpoint. |
| packages/axum-rest-api-server/tests/server/v1/contract/context/health_check.rs | Switches test DTO imports to the protocol crate. |
| packages/axum-rest-api-server/src/v1/context/health_check/resources.rs | Removes server-local health_check DTOs (now owned by protocol crate). |
| packages/axum-rest-api-server/src/v1/context/health_check/mod.rs | Updates endpoint docs to reference protocol resources. |
| packages/axum-rest-api-server/src/v1/context/health_check/handlers.rs | Updates handler to use protocol DTOs. |
| docs/issues/open/1939-1938-si-1-migrate-health-check-context.md | Updates SI-1 progress, but needs status/value alignment fixes (see PR comments). |
| docs/issues/open/1938-rest-api-contract-first-migration/EPIC.md | Updates EPIC status/progress to reflect SI-1 completion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sed modules - Rename v1/resources/ to v1/context/ with per-context subdirectories - Each context has a resources/ subdirectory for DTO files - Rename health_check/resources/health_check.rs to report.rs - Update all Rust imports across the workspace - Update EPIC and sub-issue specs to document the convention
- Fix module-level doc comment from `stats` to `health_check` - Fix invalid JSON example (trailing comma, indentation) - Fix implementation plan status values: `Completed` -> `DONE` - Correct T5/T6 task descriptions
Member
Author
|
ACK 0591cf2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements SI-1: Migrate
health_checkcontext to contract-first architecture (sub-issue of #1938).Changes
rest-api-protocol: Addedv1::resources::health_checkmodule withStatusandReportDTOs, exported fromresources/mod.rs.axum-rest-api-server: Removed localresources.rsfromhealth_checkcontext. Handler now imports protocol DTOs fromtorrust_tracker_rest_api_protocol.docs/issues/open/1939-1938-si-1-migrate-health-check-context.mdprogress.Verification