Skip to content

Rename torrust-tracker-clock to torrust-clock #1821

@josecelano

Description

@josecelano

Goal

Rename the Cargo crate torrust-tracker-clock to torrust-clock to reflect that it is a generic, tracker-independent utility that can be used in any Rust project (e.g., torrust-index).

Background

The clock package (packages/clock) provides a mockable time abstraction for deterministic testing. It contains no tracker-specific logic and its usefulness extends beyond this repository — for example, torrust-index already contains copied clock code.

The torrust-tracker- prefix implies a tracker-only scope that does not reflect the crate's actual purpose. The rename:

  • Makes the crate identity match its scope.
  • Signals to downstream users that it is reusable outside the tracker.
  • Prepares it for potential extraction to a standalone repository in a future cycle (see SI-13).

Note: Publishing torrust-clock on crates.io and handling the old name (torrust-tracker-clock) is deferred to SI-13 (extract torrust-clock to standalone repository). At that point torrust-index will also be updated to depend on torrust-clock directly.

This issue is a subissue of EPIC #1669 (Overhaul: Packages) — SI-09.

Scope

In Scope

  • Rename the name field in packages/clock/Cargo.toml.
  • Update all Cargo.toml files in the workspace that reference torrust-tracker-clock.
  • Update all Rust source files using torrust_tracker_clock:: to torrust_clock::.
  • Update prose in packages/AGENTS.md, AGENTS.md, docs/packages.md, and packages/clock/README.md.
  • Verify the workspace builds and all tests pass.
  • Update EPIC Overhaul: packages #1669 Package Inventory and Desired Package State tables.

Out of Scope

  • Publishing torrust-clock on crates.io — deferred to SI-13.
  • Deprecating/yanking torrust-tracker-clock on crates.io — deferred to SI-13.
  • Updating torrust-index to use torrust-clock — deferred to SI-13.
  • Moving the crate to a separate repository — see SI-13.
  • Changes to the crate's API or behaviour.

Implementation Plan

ID Task
T1 Rename name in packages/clock/Cargo.toml
T2 Update root Cargo.toml workspace dependency key
T3 Update all 10 dependent package Cargo.toml files
T4 Update Rust source use / path references (torrust_tracker_clock::torrust_clock::)
T5 Update prose in packages/AGENTS.md, AGENTS.md, docs/packages.md, packages/clock/README.md
T6 Run cargo build --workspace and cargo test --workspace
T7 Run linter all
T8 Update EPIC #1669 Package Inventory and Desired Package State tables

Dependent packages for T3 (10 files):

  • packages/axum-health-check-api-server/Cargo.toml
  • packages/axum-http-tracker-server/Cargo.toml
  • packages/axum-rest-tracker-api-server/Cargo.toml
  • packages/http-protocol/Cargo.toml
  • packages/http-tracker-core/Cargo.toml
  • packages/swarm-coordination-registry/Cargo.toml
  • packages/tracker-core/Cargo.toml
  • packages/torrent-repository-benchmarking/Cargo.toml
  • packages/udp-tracker-core/Cargo.toml
  • packages/udp-tracker-server/Cargo.toml

Acceptance Criteria

  • packages/clock/Cargo.toml declares name = "torrust-clock".
  • No Cargo.toml file in the workspace references torrust-tracker-clock.
  • No Rust source file in the workspace uses torrust_tracker_clock::.
  • cargo build --workspace succeeds with zero errors.
  • cargo test --workspace passes with zero failures.
  • linter all exits with code 0.
  • packages/AGENTS.md, AGENTS.md, docs/packages.md, and packages/clock/README.md reflect the new crate name.
  • EPIC Overhaul: packages #1669 Desired Package State table lists torrust-clock.

Local Spec

docs/issues/open/1821-1669-09-rename-torrust-tracker-clock-to-torrust-clock.md

Related to #1669

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions