Skip to content

refactor(clock): rename crate torrust-tracker-clock to torrust-clock#1822

Merged
josecelano merged 5 commits into
torrust:developfrom
josecelano:1821-rename-torrust-tracker-clock-to-torrust-clock
May 21, 2026
Merged

refactor(clock): rename crate torrust-tracker-clock to torrust-clock#1822
josecelano merged 5 commits into
torrust:developfrom
josecelano:1821-rename-torrust-tracker-clock-to-torrust-clock

Conversation

@josecelano
Copy link
Copy Markdown
Member

Closes #1821
Part of EPIC #1669 (SI-09)

Summary

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

Changes

  • packages/clock/Cargo.tomlname = "torrust-clock", updated description and keywords
  • Root Cargo.toml — workspace dependency key renamed from torrust-tracker-clock to torrust-clock
  • 12 dependent package Cargo.toml files — dependency key updated
  • All Rust source files — torrust_tracker_clock::torrust_clock:: (and string literals)
  • Prose updated: packages/clock/README.md, AGENTS.md, docs/release_process.md, skills
  • EPIC Overhaul: packages #1669 Package Inventory updated: torrust-clock moved to torrust- section, SI-09 marked DONE

Deferred

Crates.io publish / deprecation notice / yank and torrust-index migration are deferred to SI-13 (extract torrust-clock to standalone repo).

Verification

  • cargo build --workspace
  • cargo test --workspace
  • linter all
  • Pre-push hook (nightly fmt/check/doc + full test suite) ✓

… torrust-clock

- Move spec from drafts/ to open/ with issue number prefix 1821
- Update spec: issue number, branch, defer crates.io tasks to SI-13
- Update EPIC torrust#1669 SI-09 row with issue torrust#1821 link and open spec path
…ust#1821

Rename the `torrust-tracker-clock` crate to `torrust-clock` as specified
in issue torrust#1821 (sub-issue SI-09 of EPIC torrust#1669).

- Rename `name` in `packages/clock/Cargo.toml`
- Update root workspace dependency key
- Update all 12 dependent package `Cargo.toml` files
- Replace all `torrust_tracker_clock::` references in Rust source files
- Update prose in README, AGENTS.md, docs/release_process.md, skills

Crates.io publish/deprecation/yank steps are deferred to SI-13.

All CI checks pass: `cargo build --workspace`, `cargo test --workspace`,
`linter all`.
@josecelano josecelano self-assigned this May 21, 2026
@josecelano josecelano marked this pull request as ready for review May 21, 2026 16:39
@josecelano josecelano requested a review from a team as a code owner May 21, 2026 16:39
Copilot AI review requested due to automatic review settings May 21, 2026 16:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the Rust crate torrust-tracker-clock to torrust-clock across the workspace to reflect that the clock utility is tracker-agnostic and reusable by other Torrust projects (e.g. torrust-index), updating all code and docs accordingly.

Changes:

  • Renamed the clock crate in packages/clock/Cargo.toml and updated workspace/dependent Cargo.toml references.
  • Updated Rust import paths from torrust_tracker_clock::... to torrust_clock::... across the codebase (including tests).
  • Updated multiple documentation/spec files and skills to refer to the new crate name.

Reviewed changes

Copilot reviewed 138 out of 139 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/integration.rs Update integration test imports to torrust_clock.
src/lib.rs Update crate-level import to torrust_clock.
src/bootstrap/jobs/activity_metrics_updater.rs Update Time import path to torrust_clock.
src/bootstrap/app.rs Call torrust_clock::initialize_static().
src/app.rs Update Time import path to torrust_clock.
packages/udp-tracker-server/tests/integration.rs Update integration test imports to torrust_clock.
packages/udp-tracker-server/src/statistics/repository.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/statistics/metrics.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/statistics/event/listener.rs Switch Time import to torrust_clock.
packages/udp-tracker-server/src/statistics/event/handler/response_sent.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/statistics/event/handler/request_received.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/statistics/event/handler/request_banned.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/statistics/event/handler/request_accepted.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/statistics/event/handler/request_aborted.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/statistics/event/handler/mod.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/udp-tracker-server/src/statistics/event/handler/error.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-server/src/server/mod.rs Update static initialization to torrust_clock.
packages/udp-tracker-server/src/lib.rs Switch clock imports and test helper types to torrust_clock.
packages/udp-tracker-server/src/handlers/mod.rs Switch Time import to torrust_clock.
packages/udp-tracker-server/src/environment.rs Update static initialization to torrust_clock.
packages/udp-tracker-server/src/banning/event/listener.rs Switch Time import to torrust_clock.
packages/udp-tracker-server/src/banning/event/handler.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/udp-tracker-server/Cargo.toml Rename dependency key to torrust-clock.
packages/udp-tracker-core/src/statistics/repository.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/udp-tracker-core/src/statistics/metrics.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/udp-tracker-core/src/statistics/event/listener.rs Switch Time import to torrust_clock.
packages/udp-tracker-core/src/statistics/event/handler.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/udp-tracker-core/src/peer_builder.rs Switch Time import to torrust_clock.
packages/udp-tracker-core/src/lib.rs Switch clock import to torrust_clock.
packages/udp-tracker-core/Cargo.toml Rename dependency key to torrust-clock.
packages/tracker-core/tests/common/test_env.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/tests/common/fixtures.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/torrent/services.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/tracker-core/src/torrent/repository/in_memory.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/torrent/mod.rs Update doc example import to torrust_clock.
packages/tracker-core/src/torrent/manager.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock (including tests).
packages/tracker-core/src/test_helpers.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/statistics/repository.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/statistics/persisted/mod.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/statistics/metrics.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/statistics/event/listener.rs Switch Time import to torrust_clock.
packages/tracker-core/src/statistics/event/handler.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/peer_tests.rs Switch clock trait/type imports to torrust_clock.
packages/tracker-core/src/lib.rs Switch clock import to torrust_clock.
packages/tracker-core/src/databases/driver/sqlite/auth_key_store.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/databases/driver/postgres/auth_key_store.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/databases/driver/mysql/auth_key_store.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/tracker-core/src/authentication/key/peer_key.rs Switch DurationSinceUnixEpoch/conv imports to torrust_clock.
packages/tracker-core/src/authentication/key/mod.rs Switch DurationSinceUnixEpoch/Time imports and doc example to torrust_clock.
packages/tracker-core/src/authentication/handler.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock (including tests).
packages/tracker-core/src/announce_handler.rs Switch doc example/test imports to torrust_clock.
packages/tracker-core/Cargo.toml Rename dependency key to torrust-clock.
packages/torrent-repository-benchmarking/tests/repository/mod.rs Switch clock imports in tests to torrust_clock.
packages/torrent-repository-benchmarking/tests/integration.rs Update integration test imports to torrust_clock.
packages/torrent-repository-benchmarking/tests/entry/mod.rs Switch clock imports in tests to torrust_clock.
packages/torrent-repository-benchmarking/tests/common/torrent.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/tests/common/repo.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/skip_map_mutex_std.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/rw_lock_tokio.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/rw_lock_tokio_mutex_tokio.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/rw_lock_tokio_mutex_std.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/rw_lock_std.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/rw_lock_std_mutex_tokio.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/rw_lock_std_mutex_std.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/mod.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/repository/dash_map_mutex_std.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/lib.rs Switch clock import to torrust_clock.
packages/torrent-repository-benchmarking/src/entry/single.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/entry/rw_lock_parking_lot.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/entry/peer_list.rs Switch DurationSinceUnixEpoch imports to torrust_clock (including tests).
packages/torrent-repository-benchmarking/src/entry/mutex_tokio.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/entry/mutex_std.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/entry/mutex_parking_lot.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/src/entry/mod.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/torrent-repository-benchmarking/Cargo.toml Rename dependency key to torrust-clock.
packages/torrent-repository-benchmarking/benches/helpers/utils.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/swarm-coordination-registry/src/swarm/registry.rs Switch DurationSinceUnixEpoch/conv imports to torrust_clock (including tests).
packages/swarm-coordination-registry/src/swarm/coordinator.rs Switch DurationSinceUnixEpoch imports to torrust_clock (including tests).
packages/swarm-coordination-registry/src/statistics/repository.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/swarm-coordination-registry/src/statistics/metrics.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/swarm-coordination-registry/src/statistics/event/listener.rs Switch Time import to torrust_clock.
packages/swarm-coordination-registry/src/statistics/event/handler.rs Switch DurationSinceUnixEpoch and clock imports to torrust_clock (including tests).
packages/swarm-coordination-registry/src/statistics/activity_metrics_updater.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock.
packages/swarm-coordination-registry/src/lib.rs Switch clock imports (and tests) to torrust_clock.
packages/swarm-coordination-registry/Cargo.toml Rename dependency key to torrust-clock.
packages/primitives/src/peer.rs Switch DurationSinceUnixEpoch imports/docs to torrust_clock.
packages/primitives/src/lib.rs Update deprecated re-export docs/note to torrust_clock.
packages/primitives/Cargo.toml Rename dependency key to torrust-clock.
packages/metrics/src/sample.rs Switch DurationSinceUnixEpoch imports to torrust_clock (including tests).
packages/metrics/src/sample_collection.rs Switch DurationSinceUnixEpoch imports to torrust_clock (including tests).
packages/metrics/src/prometheus.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/metrics/src/metric/mod.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/metrics/src/metric/aggregate/sum.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/metrics/src/metric/aggregate/avg.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/metrics/src/metric_collection/serde.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/metrics/src/metric_collection/prometheus.rs Switch DurationSinceUnixEpoch imports to torrust_clock (including tests).
packages/metrics/src/metric_collection/mod.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/metrics/src/metric_collection/kind_collection.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/metrics/src/metric_collection/aggregate/sum.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/metrics/src/metric_collection/aggregate/avg.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/metrics/Cargo.toml Rename dependency key to torrust-clock.
packages/http-tracker-core/src/statistics/repository.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/http-tracker-core/src/statistics/metrics.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/http-tracker-core/src/statistics/event/listener.rs Switch Time import to torrust_clock.
packages/http-tracker-core/src/statistics/event/handler.rs Switch DurationSinceUnixEpoch/Time imports to torrust_clock (including tests).
packages/http-tracker-core/src/services/scrape.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/http-tracker-core/src/lib.rs Switch clock imports (and tests) to torrust_clock.
packages/http-tracker-core/Cargo.toml Rename dependency key to torrust-clock.
packages/http-tracker-core/benches/helpers/util.rs Switch DurationSinceUnixEpoch import to torrust_clock.
packages/http-protocol/src/v1/requests/announce.rs Switch Time import to torrust_clock.
packages/http-protocol/src/lib.rs Switch clock import to torrust_clock.
packages/http-protocol/Cargo.toml Rename dependency key to torrust-clock.
packages/clock/tests/integration.rs Update internal test CurrentClock type aliases to torrust_clock.
packages/clock/tests/clock/mod.rs Switch Time import to torrust_clock.
packages/clock/src/lib.rs Update doc comment mention to torrust-clock.
packages/clock/README.md Rename README title/linking to torrust-clock.
packages/clock/Cargo.toml Rename package name and update metadata.
packages/axum-rest-tracker-api-server/tests/integration.rs Update integration test imports to torrust_clock.
packages/axum-rest-tracker-api-server/src/v1/context/torrent/resources/torrent.rs Switch DurationSinceUnixEpoch import in tests to torrust_clock.
packages/axum-rest-tracker-api-server/src/v1/context/auth_key/resources.rs Switch conv/clock imports to torrust_clock (including tests).
packages/axum-rest-tracker-api-server/src/server.rs Update static initialization to torrust_clock.
packages/axum-rest-tracker-api-server/src/lib.rs Switch clock import to torrust_clock.
packages/axum-rest-tracker-api-server/src/environment.rs Update static initialization to torrust_clock.
packages/axum-rest-tracker-api-server/Cargo.toml Rename dependency key to torrust-clock.
packages/axum-http-tracker-server/tests/integration.rs Update integration test imports to torrust_clock.
packages/axum-http-tracker-server/src/server.rs Update static initialization to torrust_clock.
packages/axum-http-tracker-server/src/environment.rs Update static initialization to torrust_clock.
packages/axum-http-tracker-server/Cargo.toml Rename dependency key(s) to torrust-clock.
packages/axum-health-check-api-server/tests/integration.rs Update integration test imports to torrust_clock.
packages/axum-health-check-api-server/Cargo.toml Rename dependency key to torrust-clock.
docs/release_process.md Update published-crates list to torrust-clock.
docs/issues/open/1821-1669-09-rename-torrust-tracker-clock-to-torrust-clock.md Update issue spec metadata/content to reflect rename work.
docs/issues/open/1669-overhaul-packages/EPIC.md Update EPIC inventory/plan tables to include torrust-clock.
contrib/dev-tools/analysis/workspace-coupling/src/main.rs Update observation strings to use torrust-clock naming.
Cargo.toml Rename workspace dependency key to torrust-clock.
Cargo.lock Update lockfile entries for the renamed crate.
AGENTS.md Update package catalog row to the new crate name.
.github/skills/dev/testing/write-unit-test/SKILL.md Update skill examples to torrust_clock.
.github/skills/dev/git-workflow/release-new-version/SKILL.md Update release skill published-crates list to torrust-clock.
Comments suppressed due to low confidence (1)

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

  • This paragraph says publishing torrust-clock is deferred to SI-13, but elsewhere in this PR the docs now treat torrust-clock as a crate that gets published during releases (e.g. docs/release_process.md and the EPIC inventory marks it as published on crates.io). Please reconcile the documentation: either clarify that only the deprecation/yank of torrust-tracker-clock is deferred (while torrust-clock will be published on the next release), or update the other docs/EPIC to reflect that publishing is indeed deferred.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/issues/open/1669-overhaul-packages/EPIC.md Outdated
Comment thread contrib/dev-tools/analysis/workspace-coupling/src/main.rs Outdated
- EPIC Package Inventory: mark torrust-clock as unpublished (No)
  since the new crate name is not yet on crates.io; publishing
  is deferred to SI-13
- workspace-coupling: replace stale thin-dep bullets with a note
  that both were resolved (SI-02 and SI-03 respectively)
The VS Code `currentActivePullRequest` and `pullRequestInViewport` tools
do not detect fork-based PRs. Since all contributor PRs in this repository
are fork-based, clarify that GitHub CLI GraphQL is the primary path for
fetching and resolving review threads in both the fetch-review-threads and
resolve-review-threads skills.
@josecelano
Copy link
Copy Markdown
Member Author

ACK d956c7e

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.70%. Comparing base (4918ca6) to head (d956c7e).

Files with missing lines Patch % Lines
.../dev-tools/analysis/workspace-coupling/src/main.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1822   +/-   ##
========================================
  Coverage    77.70%   77.70%           
========================================
  Files          379      379           
  Lines        28605    28604    -1     
  Branches     28605    28604    -1     
========================================
  Hits         22227    22227           
- Misses        6066     6072    +6     
+ Partials       312      305    -7     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josecelano josecelano merged commit 4c6dee4 into torrust:develop May 21, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename torrust-tracker-clock to torrust-clock

2 participants