refactor(http-protocol): decouple from tracker-core#1833
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the forbidden dependency edge from the HTTP protocol crate to torrust-tracker-core by moving tracker-core → HTTP failure-reason mapping into higher layers (http-tracker-core) and updating the axum handlers/tests to rely on boundary conversions.
Changes:
- Removed
torrust-tracker-coredependency and core-errorFrom<...>conversions frompackages/http-protocol. - Added
From<HttpAnnounceError>/From<HttpScrapeError>→ protocolresponses::error::Errorconversions inhttp-tracker-core. - Updated axum HTTP handlers + tests and refreshed the SI-12/EPIC tracking docs to reflect completion.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/http-tracker-core/src/services/announce.rs | Adds boundary conversion from HttpAnnounceError into protocol error response. |
| packages/http-tracker-core/src/services/scrape.rs | Adds boundary conversion from HttpScrapeError into protocol error response. |
| packages/http-protocol/src/v1/responses/error.rs | Removes torrust_tracker_core error conversion impls from protocol layer. |
| packages/http-protocol/Cargo.toml | Drops the torrust-tracker-core dependency. |
| packages/axum-http-server/src/v1/handlers/announce.rs | Uses boundary conversion (Error::from(err)) instead of to_string() mapping. |
| packages/axum-http-server/src/v1/handlers/scrape.rs | Uses boundary conversion (Error::from(err)) instead of to_string() mapping. |
| packages/axum-http-server/tests/server/asserts.rs | Updates expected failure-reason fragments for authentication errors. |
| docs/issues/open/1830-1669-12-decouple-http-protocol-from-tracker-core.md | Marks SI-12 tasks/acceptance criteria as DONE and updates verification notes. |
| docs/issues/open/1669-overhaul-packages/EPIC.md | Updates EPIC dependency narrative and marks #1830 as complete. |
| Cargo.lock | Removes the protocol crate’s lockfile reference to torrust-tracker-core. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1833 +/- ##
===========================================
+ Coverage 77.76% 77.80% +0.04%
===========================================
Files 379 380 +1
Lines 28608 28592 -16
Branches 28608 28592 -16
===========================================
Hits 22246 22246
+ Misses 6050 6033 -17
- Partials 312 313 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
ACK 19b0ce1 |
Summary
Validation
Notes
Closes #1830