Migrate from bittorrent-primitives to torrust-info-hash#1891
Merged
josecelano merged 2 commits intoJun 9, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the workspace off the deprecated bittorrent-primitives crate and onto the standalone torrust-info-hash crate for the InfoHash type, updating all affected packages, tests, and documentation references accordingly.
Changes:
- Replaced
bittorrent-primitivesdependencies withtorrust-info-hash = "=0.2.0"across the workspace. - Updated Rust imports / fully-qualified paths (including
ConversionErrorand fixtures) to usetorrust_info_hash. - Updated workspace documentation (EPIC + new issue spec) and refreshed
Cargo.lock.
Reviewed changes
Copilot reviewed 106 out of 107 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/servers/api/contract/stats/mod.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/udp-tracker-core/src/services/scrape.rs | Switch InfoHash import to new crate. |
| packages/udp-tracker-core/src/services/announce.rs | Switch InfoHash import to new crate. |
| packages/udp-tracker-core/src/lib.rs | Switch test-only InfoHash import to new crate. |
| packages/udp-tracker-core/src/event.rs | Switch InfoHash import to new crate. |
| packages/udp-tracker-core/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/udp-server/tests/server/contract.rs | Update fully-qualified InfoHash types to torrust_info_hash. |
| packages/udp-server/tests/common/fixtures.rs | Switch fixture import to torrust_info_hash::InfoHash. |
| packages/udp-server/src/lib.rs | Update rustdoc link target for InfoHash. |
| packages/udp-server/src/handlers/announce.rs | Switch imports and test conversion to torrust_info_hash. |
| packages/udp-server/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/tracker-core/tests/common/test_env.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/tracker-core/tests/common/fixtures.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/tracker-core/src/whitelist/repository/persisted.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/whitelist/repository/in_memory.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/whitelist/manager.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/whitelist/authorization.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/torrent/services.rs | Switch imports in module + tests to new crate. |
| packages/tracker-core/src/torrent/repository/in_memory.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/torrent/manager.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/tracker-core/src/test_helpers.rs | Switch test helper import to torrust_info_hash::InfoHash. |
| packages/tracker-core/src/statistics/persisted/downloads.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/scrape_handler.rs | Update rustdoc examples + imports/tests to new crate. |
| packages/tracker-core/src/lib.rs | Switch test imports to torrust_info_hash::InfoHash. |
| packages/tracker-core/src/error.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/databases/traits/whitelist.rs | Switch trait-level InfoHash import to new crate. |
| packages/tracker-core/src/databases/traits/torrent_metrics.rs | Switch trait-level InfoHash import to new crate. |
| packages/tracker-core/src/databases/driver/sqlite/whitelist_store.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/databases/driver/sqlite/torrent_metrics_store.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/databases/driver/postgres/whitelist_store.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/databases/driver/postgres/torrent_metrics_store.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/databases/driver/mysql/whitelist_store.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/databases/driver/mysql/torrent_metrics_store.rs | Switch InfoHash import to new crate. |
| packages/tracker-core/src/announce_handler.rs | Update rustdoc example + import to torrust_info_hash. |
| packages/tracker-core/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/tracker-client/src/http/client/requests/scrape.rs | Switch InfoHash import to new crate. |
| packages/tracker-client/src/http/client/requests/announce.rs | Switch InfoHash import to new crate. |
| packages/tracker-client/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/torrent-repository-benchmarking/tests/repository/mod.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/torrent-repository-benchmarking/tests/common/repo.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/torrent-repository-benchmarking/src/repository/skip_map_mutex_std.rs | Switch InfoHash import to new crate. |
| packages/torrent-repository-benchmarking/src/repository/rw_lock_tokio.rs | Switch InfoHash import; update guard return type path. |
| packages/torrent-repository-benchmarking/src/repository/rw_lock_tokio_mutex_tokio.rs | Switch InfoHash import to new crate. |
| packages/torrent-repository-benchmarking/src/repository/rw_lock_tokio_mutex_std.rs | Switch InfoHash import to new crate. |
| packages/torrent-repository-benchmarking/src/repository/rw_lock_std.rs | Switch InfoHash import; update guard return type path. |
| packages/torrent-repository-benchmarking/src/repository/rw_lock_std_mutex_tokio.rs | Switch InfoHash import to new crate. |
| packages/torrent-repository-benchmarking/src/repository/rw_lock_std_mutex_std.rs | Switch InfoHash import to new crate. |
| packages/torrent-repository-benchmarking/src/repository/mod.rs | Switch InfoHash import to new crate. |
| packages/torrent-repository-benchmarking/src/repository/dash_map_mutex_std.rs | Switch InfoHash import to new crate. |
| packages/torrent-repository-benchmarking/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/torrent-repository-benchmarking/benches/helpers/utils.rs | Switch bench helper import to new crate. |
| packages/torrent-repository-benchmarking/benches/helpers/sync.rs | Switch bench helper import to new crate. |
| packages/torrent-repository-benchmarking/benches/helpers/asyn.rs | Switch bench helper import to new crate. |
| packages/swarm-coordination-registry/src/swarm/registry.rs | Switch imports + fixture path; adjust seeded fixture call. |
| packages/swarm-coordination-registry/src/swarm/coordinator.rs | Switch InfoHash import to new crate. |
| packages/swarm-coordination-registry/src/lib.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/swarm-coordination-registry/src/event.rs | Switch InfoHash import to new crate. |
| packages/swarm-coordination-registry/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/primitives/src/scrape.rs | Switch imports/tests to torrust_info_hash::InfoHash. |
| packages/primitives/src/lib.rs | Switch internal InfoHash import used in public type aliases. |
| packages/primitives/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/persistence-benchmark/src/bin/persistence_benchmark/driver_bench/sampling.rs | Switch InfoHash import to new crate. |
| packages/persistence-benchmark/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/http-tracker-core/src/services/scrape.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/http-tracker-core/src/services/announce.rs | Switch InfoHash import to new crate. |
| packages/http-tracker-core/src/lib.rs | Switch test import to torrust_info_hash::InfoHash. |
| packages/http-tracker-core/src/event.rs | Switch InfoHash import to new crate. |
| packages/http-tracker-core/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/http-tracker-core/benches/helpers/util.rs | Switch bench helper import to new crate. |
| packages/http-protocol/src/v1/responses/scrape.rs | Switch imports, examples, and tests to new crate. |
| packages/http-protocol/src/v1/requests/scrape.rs | Switch InfoHash import and ConversionError path to new crate. |
| packages/http-protocol/src/v1/requests/announce.rs | Switch InfoHash import and ConversionError path to new crate. |
| packages/http-protocol/src/percent_encoding.rs | Switch InfoHash import and ConversionError type path to new crate. |
| packages/http-protocol/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/axum-rest-api-server/tests/server/v1/contract/context/whitelist.rs | Switch contract test import to new crate. |
| packages/axum-rest-api-server/tests/server/v1/contract/context/torrent.rs | Switch contract test import to new crate. |
| packages/axum-rest-api-server/tests/server/v1/contract/context/stats.rs | Switch contract test import to new crate. |
| packages/axum-rest-api-server/src/v1/context/whitelist/handlers.rs | Switch handler import to new crate. |
| packages/axum-rest-api-server/src/v1/context/torrent/resources/torrent.rs | Switch test import to new crate. |
| packages/axum-rest-api-server/src/v1/context/torrent/handlers.rs | Switch handler import to new crate. |
| packages/axum-rest-api-server/src/environment.rs | Switch InfoHash import to new crate. |
| packages/axum-rest-api-server/Cargo.toml | Replace dependency with torrust-info-hash. |
| packages/axum-http-server/tests/server/v1/contract.rs | Switch contract test imports to new crate. |
| packages/axum-http-server/tests/server/requests/scrape.rs | Switch request test import to new crate. |
| packages/axum-http-server/tests/server/requests/announce.rs | Switch request test import to new crate. |
| packages/axum-http-server/tests/common/fixtures.rs | Switch test fixtures import to new crate. |
| packages/axum-http-server/src/v1/handlers/scrape.rs | Switch test import to new crate. |
| packages/axum-http-server/src/v1/extractors/scrape_request.rs | Switch test import to new crate. |
| packages/axum-http-server/src/v1/extractors/announce_request.rs | Switch test import to new crate. |
| packages/axum-http-server/src/lib.rs | Switch test helper import to new crate. |
| packages/axum-http-server/src/environment.rs | Switch InfoHash import to new crate. |
| packages/axum-http-server/Cargo.toml | Replace dependency with torrust-info-hash. |
| docs/issues/open/1889-1669-21-migrate-from-bittorrent-primitives-to-torrust-info-hash.md | Add new issue spec documenting migration work. |
| docs/issues/open/1669-overhaul-packages/EPIC.md | Link SI-21 sub-issue and update EPIC notes/table. |
| console/tracker-client/src/console/clients/unified/udp.rs | Switch InfoHash import alias to new crate. |
| console/tracker-client/src/console/clients/unified/http.rs | Switch InfoHash import to new crate. |
| console/tracker-client/src/console/clients/unified/check.rs | Switch InfoHash import alias to new crate. |
| console/tracker-client/src/console/clients/udp/checker.rs | Switch InfoHash import alias to new crate. |
| console/tracker-client/src/console/clients/udp/app.rs | Switch InfoHash import alias to new crate. |
| console/tracker-client/src/console/clients/http/app.rs | Switch InfoHash import to new crate. |
| console/tracker-client/src/console/clients/checker/monitor/udp.rs | Switch InfoHash import alias to new crate. |
| console/tracker-client/src/console/clients/checker/checks/udp.rs | Switch InfoHash import alias to new crate. |
| console/tracker-client/src/console/clients/checker/checks/http.rs | Switch InfoHash import to new crate. |
| console/tracker-client/src/console/clients/checker/app.rs | Switch InfoHash import alias to new crate. |
| console/tracker-client/Cargo.toml | Replace dependency with torrust-info-hash. |
| Cargo.toml | Replace dev-dependency with torrust-info-hash. |
| Cargo.lock | Remove bittorrent-primitives; add/lock torrust-info-hash 0.2.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1891 +/- ##
===========================================
+ Coverage 81.29% 81.35% +0.06%
===========================================
Files 351 351
Lines 26509 26505 -4
Branches 26509 26505 -4
===========================================
+ Hits 21551 21564 +13
+ Misses 4663 4645 -18
- Partials 295 296 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
ACK b5a0d3f |
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.
Summary
Replaces the
bittorrent-primitivescrate dependency with the newtorrust-info-hashcrate (v0.2.0) across the entire workspace. TheInfoHashtype was migrated fromtorrust/bittorrent-primitivestotorrust/torrust-bittorrent(see torrust/torrust-bittorrent#87 / torrust/torrust-bittorrent#88) and published astorrust-info-hash0.2.0 on crates.io.Changes
bittorrent-primitives = "0.2.0"withtorrust-info-hash = "=0.2.0"in all 14Cargo.tomlfilesuse bittorrent_primitives::info_hash::InfoHashtouse torrust_info_hash::InfoHashinfo_hash::ConversionErrorreferencesgen_seeded_infohash) and doc commentsbittorrent-primitivestotorrust-info-hash#1889Verification
cargo check --workspace: passescargo machete: passes (no unused deps)linter all: passescargo test --workspace(nextest): 2520/2520 passedbittorrent-primitives/bittorrent_primitivesreferences (except expected comment inudp-protocol/src/common.rs)Closes #1889
Related to #1669