refactor: migrate peer-id to published torrust-peer-id 0.1.0#1887
Merged
josecelano merged 7 commits intoJun 8, 2026
Merged
Conversation
Document the Apache-2.0 license change for torrust-peer-id when migrating to torrust/torrust-bittorrent: drop the tracker-inherited AGPL-3.0 LICENSE, keep LICENSE-APACHE for upstream attribution, and inherit Apache-2.0 from the destination workspace. Add task T2b and acceptance criterion for the license change.
Replace bittorrent-peer-id local path dep with published torrust-peer-id 0.1.0.
- Update Cargo.toml deps in http-protocol, primitives, and udp-protocol
to depend on torrust-peer-id = "0.1.0" from crates.io (with zerocopy
feature retained for udp-protocol).
- Rename all Rust use statements: bittorrent_peer_id -> torrust_peer_id.
- Remove packages/primitives/src/peer_id.rs thin re-export module;
lib.rs now directly re-exports from torrust_peer_id.
- Delete the entire packages/peer-id/ directory.
- Remove peer-id row from AGENTS.md package catalog.
The crate was migrated to torrust/torrust-bittorrent as torrust-peer-id
0.1.0, published under Apache-2.0 (matching the upstream aquatic_peer_id
license).
Verification:
cargo check --workspace - pass
cargo test --tests --workspace
--all-targets --all-features - pass
cargo test --doc --workspace - pass
linter all - pass
cargo machete --with-metadata - pass
All 13 implementation tasks are DONE. Acceptance criteria, verification scenarios, and progress log updated with completion evidence. torrust-peer-id 0.1.0 is published on crates.io under Apache-2.0. T14 (EPIC torrust#1669 table update) remains as the final task.
Mark SI-19 (torrust#1884) as complete across the EPIC: - Remove bittorrent- prefix section from Package Inventory. - Update Desired Package State note [4] to 'Completed June 2026'. - Check SI-19 checkbox in Numbered Subissues. - Mark Peer-ID move row DONE in the Active Subissues table. - Mark T14 DONE and update last-updated-utc in the issue spec.
There was a problem hiding this comment.
Pull request overview
This PR migrates the workspace from the in-repo bittorrent-peer-id crate (path dependency) to the published torrust-peer-id crate v0.1.0 from crates.io, and removes the now-redundant in-workspace peer-id package.
Changes:
- Replace
bittorrent-peer-idpath dependencies withtorrust-peer-id = "0.1.0"(andzerocopyfeature where needed) across protocol/domain crates. - Update Rust imports/re-exports from
bittorrent_peer_id::*totorrust_peer_id::*, and simplifyprimitivesre-exports. - Remove the
packages/peer-id/crate and update repository documentation (issue spec + EPIC + package catalog) accordingly.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/udp-protocol/src/lib.rs | Switch re-export to torrust_peer_id::{PeerClient, PeerId}. |
| packages/udp-protocol/Cargo.toml | Replace peer-id path dep with crates.io torrust-peer-id (keeping zerocopy). |
| packages/primitives/src/peer_id.rs | Delete thin compatibility re-export module. |
| packages/primitives/src/lib.rs | Re-export PeerClient/PeerId from torrust_peer_id at crate root; remove peer_id module declaration. |
| packages/primitives/Cargo.toml | Replace peer-id path dep with crates.io torrust-peer-id. |
| packages/peer-id/src/peer_id.rs | Remove in-repo peer-id implementation (crate deleted). |
| packages/peer-id/src/peer_client.rs | Remove in-repo client identification implementation (crate deleted). |
| packages/peer-id/src/lib.rs | Remove in-repo peer-id crate root (crate deleted). |
| packages/peer-id/README.md | Remove in-repo peer-id crate README (crate deleted). |
| packages/peer-id/LICENSE-APACHE | Remove in-repo peer-id crate Apache license copy (crate deleted). |
| packages/peer-id/LICENSE | Remove in-repo peer-id crate AGPL license file (crate deleted). |
| packages/peer-id/Cargo.toml | Remove in-repo peer-id crate manifest (crate deleted). |
| packages/http-protocol/src/v1/responses/announce.rs | Update PeerId import to torrust_peer_id::PeerId (including tests). |
| packages/http-protocol/src/v1/requests/announce.rs | Update PeerId import and doc example to torrust_peer_id::PeerId (including tests). |
| packages/http-protocol/src/percent_encoding.rs | Update PeerId import and doc example to torrust_peer_id::PeerId (including tests). |
| packages/http-protocol/Cargo.toml | Replace peer-id path dep with crates.io torrust-peer-id. |
| docs/issues/open/1884-1669-19-move-bittorrent-peer-id-to-torrust-bittorrent.md | Mark tasks/acceptance criteria done; update timestamps and verification notes. |
| docs/issues/open/1669-overhaul-packages/EPIC.md | Mark SI-19 completed and note published crate + tracker migration. |
| Cargo.lock | Remove bittorrent-peer-id entry; add torrust-peer-id 0.1.0 entry and update dependent packages. |
| AGENTS.md | Remove peer-id package entry from workspace package catalog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
7
to
14
| pub mod announce; | ||
| pub mod mode; | ||
| pub mod number_of_bytes; | ||
| pub mod pagination; | ||
| pub mod peer; | ||
| pub mod peer_id; | ||
| pub mod policy; | ||
| pub mod scrape; | ||
| pub mod swarm_metadata; |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1887 +/- ##
===========================================
+ Coverage 81.17% 81.32% +0.15%
===========================================
Files 353 351 -2
Lines 26669 26509 -160
Branches 26669 26509 -160
===========================================
- Hits 21649 21559 -90
+ Misses 4723 4659 -64
+ Partials 297 291 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Address Copilot suggestion to maintain backwards compatibility when migrating
to torrust-peer-id. Downstream code that imports
torrust_tracker_primitives::peer_id::{PeerId, PeerClient} will continue to
work with a deprecation warning, providing a smoother migration path until a
planned major release removes this compatibility layer.
Related-to: PR torrust#1887
The packages/peer-id/ directory was deleted as part of the migration to the published torrust-peer-id crate, but the Containerfile still referenced the old path in three places: 1. COPY packages/peer-id/Cargo.toml 2. packages/peer-id/src in source copy section 3. packages/peer-id/src/lib.rs in license check Dropping these references fixes the Container (Docker) workflow failure. Related-to: PR torrust#1887
Member
Author
|
ACK f0f651f |
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.
Migrate the
bittorrent-peer-idpath dependency to the publishedtorrust-peer-id0.1.0 crate.Summary
bittorrent-peer-idpath deps inhttp-protocol,primitives, andudp-protocolwithtorrust-peer-id = "0.1.0"from crates.iouse bittorrent_peer_idstatements touse torrust_peer_idpackages/primitives/src/peer_id.rsthin re-export module;lib.rsnow directly re-exports fromtorrust_peer_idpackages/peer-id/directoryAGENTS.mdpackage catalogbittorrent-peer-idtotorrust/torrust-bittorrentastorrust-peer-id#1884 and EPIC Overhaul: packages #1669 tablesWhy
The
torrust-peer-idcrate was extracted totorrust/torrust-bittorrent, published under Apache-2.0 (matching the upstreamaquatic_peer_idlicense). It has zero workspace dependencies and was the first in thebittorrent-*extraction sequence (EPIC #1669).Verification
cargo check --workspace— passcargo test --tests --workspace --all-targets --all-features— passcargo test --doc --workspace— passlinter all— passcargo machete --with-metadata— passCloses #1884