Skip to content

SI-16: Migrate contrib/bencode to torrust/torrust-bittorrent as torrust-bencode #1881

Closed

Description

@josecelano

Goal

Rename the crate torrust-tracker-contrib-bencode to torrust-bencode, and migrate it from
the tracker workspace (contrib/bencode) back into torrust/torrust-bittorrent
(packages/bencode) replacing the legacy copy there.

Background

The contrib/bencode package is a pure bencode encode/decode library with no tracker-specific
logic:

  • No tracker dependencies: its only runtime dependency is thiserror.
  • Separate license: Apache-2.0 (tracker is AGPL-3.0-only).
  • Already published on crates.io as torrust-tracker-contrib-bencode.
  • Only one internal consumer: packages/http-protocol — after extraction the dependency
    becomes a normal crates.io dep.
  • contrib/ is the wrong home: signals transient community code; this crate is ready to graduate.
  • Destination confirmed in EPIC Overhaul: Packages #1669: torrust/torrust-bittorrent → packages/bencode, replacing the older lineage there.

Scope

In Scope

  • Rename crate name in contrib/bencode/Cargo.toml to torrust-bencode.
  • Update repository URL to point to torrust/torrust-bittorrent.
  • Copy crate source (clean copy, no cross-repo history transplant) to packages/bencode in torrust/torrust-bittorrent, replacing the legacy copy.
  • Ensure CI passes in the destination repository.
  • Publish torrust-bencode from the destination repository (keeping the same version as the current torrust-tracker-contrib-bencode release).
  • Update packages/http-protocol/Cargo.toml: replace path dep with published torrust-bencode.
  • Remove contrib/bencode/ from the tracker workspace (members + workspace dep entry).
  • Delete contrib/bencode/ directory from the tracker repo.
  • Update packages/AGENTS.md, AGENTS.md Package Catalog, and docs/packages.md.
  • Handle old crates.io name torrust-tracker-contrib-bencode: yank all versions with a pointer to torrust-bencode.
  • Update EPIC Overhaul: Packages #1669 Active Subissues table.

Out of Scope

  • Changes to the crate's API or behaviour.
  • Updating other downstream repositories (e.g. torrust-index).
  • Extracting other bittorrent-* or contrib/ crates.

Implementation Plan

ID Task
T1 Rename name in contrib/bencode/Cargo.toml to torrust-bencode
T2 Update repository URL and crate metadata to point to torrust/torrust-bittorrent
T3 Confirm destination workspace migration path (packages/bencode target)
T4 Copy crate source into torrust/torrust-bittorrent as a clean copy
T5 Adjust CI in destination repository as needed
T6 Publish torrust-bencode from destination repository
T7 Update packages/http-protocol/Cargo.toml: replace path dep with published torrust-bencode
T8 Remove contrib/bencode/ from tracker workspace (members + workspace dep in Cargo.toml)
T9 Delete contrib/bencode/ directory from the tracker repo
T10 Update packages/AGENTS.md, AGENTS.md, docs/packages.md, and README references
T11 Run cargo build --workspace, cargo test --workspace, linter all
T12 Yank torrust-tracker-contrib-bencode on crates.io with notice pointing to torrust-bencode
T13 Update EPIC #1669 Package Inventory and Desired Package State tables

References

Activity

  1. self-assigned this
    on Jun 5, 2026
  2. added 3 commits that reference this issue on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions