Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Move logic to http-protocol and primitives packages #1180

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Jan 11, 2025

Refactor: Move HTTP tracker logic to http-protocol package and core tracker types to primitives package. This will:

  • Allow sharing that code with other projects.
  • Allow re-enabling doc tests disabled here.
  • Decouple generic reusable logic from Axum framework.
  • Improve compilation times.

@josecelano josecelano self-assigned this Jan 11, 2025
@josecelano josecelano added Code Cleanup / Refactoring Tidying and Making Neat - Developer - Torrust Improvement Experience labels Jan 11, 2025
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.22%. Comparing base (f508ef7) to head (c2d134e).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
src/servers/http/v1/handlers/scrape.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1180      +/-   ##
===========================================
- Coverage    76.37%   76.22%   -0.16%     
===========================================
  Files          177      178       +1     
  Lines        11906    11898       -8     
  Branches     11906    11898       -8     
===========================================
- Hits          9093     9069      -24     
- Misses        2648     2658      +10     
- Partials       165      171       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano changed the title Refactor: Move logic to http-protocol package Refactor: Move logic to http-protocol and primitives packages Jan 11, 2025
@josecelano josecelano linked an issue Jan 11, 2025 that may be closed by this pull request
… primitives packages

- Generic logic for http tracker has bben moved to http-protocol package (bittorrent-http-protocol crate).
- Generic tracker types like AnnounceData and ScrapeData have been moved
  to the primitives package (torrust-tracker-primitives crate).

This has also a desiderable side effect: generic re-usable domain logic
has been decoupled from Axum framework.
@josecelano josecelano force-pushed the 1140-extract-more-logic-to-the-http-protocol-package branch from 9142063 to a7ceb0f Compare January 11, 2025 21:01
Some doc tests were slow becuase they required to compile the main
library. The code used from the main library was moved to workspace
pacakages and there is no dependency with the main tracker lib.

See torrust#1097
@josecelano josecelano marked this pull request as ready for review January 11, 2025 21:11
@josecelano josecelano requested a review from da2ce7 January 11, 2025 21:11
@josecelano
Copy link
Member Author

ACK c2d134e

@josecelano josecelano merged commit b403382 into torrust:develop Jan 11, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Developer - Torrust Improvement Experience Code Cleanup / Refactoring Tidying and Making Neat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move logic to http-protocol and primitives packages
1 participant