Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ran successfully and the following crates were published:
- `torrust-tracker-contrib-bencode`
- `torrust-tracker-located-error`
- `torrust-tracker-primitives`
- `torrust-tracker-clock`
- `torrust-clock`
- `torrust-tracker-configuration`
- `torrust-tracker-torrent-repository`
- `torrust-tracker-test-helpers`
Expand Down
13 changes: 8 additions & 5 deletions .github/skills/dev/pr-reviews/fetch-review-threads/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ review thread IDs and enough context to decide whether each thread should stay o

Use one of these approaches:

1. Active pull request tools when they are available in the environment.
2. GitHub CLI GraphQL when you need a terminal-based fallback.

Prefer the active PR tools first because they provide thread metadata together with file paths,
resolution state, and comments.
1. GitHub CLI GraphQL — reliable for all PRs, including fork-based PRs (see note below).
2. Active pull request tools when they are available in the environment and the PR is not fork-based.

> **Fork-based PR limitation**: The VS Code `currentActivePullRequest` and `pullRequestInViewport`
> tools do **not** detect PRs opened from a fork (e.g. `contributor:branch` → `upstream/repo`).
> In this repository all contributor PRs are fork-based, so the GitHub CLI GraphQL approach
> is the reliable primary path. Use the VS Code tools only when you know the branch lives in
> the same repository as the target.

## What to Collect

Expand Down
11 changes: 8 additions & 3 deletions .github/skills/dev/pr-reviews/resolve-review-threads/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ concern is fixed or intentionally declined with a clear reason.

## Preferred Resolution Path

If PR tools are available, first gather thread IDs from the active pull request metadata.
Use GitHub CLI GraphQL to gather thread IDs and resolve threads directly from the terminal.
This is reliable for all PRs, including fork-based PRs.

- Use the active PR tools to identify unresolved `reviewThreads`.
- Resolve only threads where `isResolved == false` and the fix is already on the branch.
> **Fork-based PR limitation**: The VS Code `currentActivePullRequest` and `pullRequestInViewport`
> tools do **not** detect PRs opened from a fork (e.g. `contributor:branch` → `upstream/repo`).
> In this repository all contributor PRs are fork-based, so the GitHub CLI GraphQL approach
> is the reliable primary path. Do not rely on the VS Code active PR tools for thread IDs.

Resolve only threads where `isResolved == false` and the fix is already on the branch.

## GitHub CLI GraphQL Command

Expand Down
10 changes: 5 additions & 5 deletions .github/skills/dev/testing/write-unit-test/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ automatically selects `Working` in production and `Stopped` in tests:
```rust
/// Working version, for production.
#[cfg(not(test))]
pub(crate) type CurrentClock = torrust_tracker_clock::clock::Working;
pub(crate) type CurrentClock = torrust_clock::clock::Working;

/// Stopped version, for testing.
#[cfg(test)]
pub(crate) type CurrentClock = torrust_tracker_clock::clock::Stopped;
pub(crate) type CurrentClock = torrust_clock::clock::Stopped;
```

In production code, obtain the current time via the `Time` trait:

```rust
use torrust_tracker_clock::clock::Time as _;
use torrust_clock::clock::Time as _;

pub fn is_peer_expired(last_seen: std::time::Duration, ttl: u32) -> bool {
let now = CurrentClock::now(); // returns DurationSinceUnixEpoch (= std::time::Duration)
Expand All @@ -169,8 +169,8 @@ thread-local, so tests are isolated from each other by default.
mod tests {
use std::time::Duration;

use torrust_tracker_clock::clock::{stopped::Stopped as _, Time as _};
use torrust_tracker_clock::clock::Stopped;
use torrust_clock::clock::{stopped::Stopped as _, Time as _};
use torrust_clock::clock::Stopped;

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ All packages live under `packages/`. The workspace version is `3.0.0-develop`.
| `axum-http-tracker-server` | `torrust-tracker-axum-http-server` | `axum-*` | BitTorrent HTTP tracker server (BEP 3/23) |
| `axum-rest-tracker-api-server` | `torrust-tracker-axum-rest-api-server` | `axum-*` | Management REST API server |
| `axum-server` | `torrust-tracker-axum-server` | `axum-*` | Base Axum HTTP server infrastructure |
| `clock` | `torrust-tracker-clock` | utilities | Mockable time source for deterministic testing |
| `clock` | `torrust-clock` | utilities | Mockable time source for deterministic testing |
| `configuration` | `torrust-tracker-configuration` | domain | Config file parsing, environment variables |
| `events` | `torrust-tracker-events` | domain | Domain event definitions |
| `http-protocol` | `bittorrent-http-tracker-protocol` | `*-protocol` | HTTP tracker protocol (BEP 3/23) parsing |
Expand Down
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ torrust-tracker-axum-server = { version = "3.0.0-develop", path = "packages/axum
torrust-tracker-rest-api-client = { version = "3.0.0-develop", path = "packages/rest-tracker-api-client" }
torrust-tracker-rest-api-core = { version = "3.0.0-develop", path = "packages/rest-tracker-api-core" }
torrust-server-lib = { version = "3.0.0-develop", path = "packages/server-lib" }
torrust-tracker-clock = { version = "3.0.0-develop", path = "packages/clock" }
torrust-clock = { version = "3.0.0-develop", path = "packages/clock" }
torrust-tracker-configuration = { version = "3.0.0-develop", path = "packages/configuration" }
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "packages/swarm-coordination-registry" }
torrust-tracker-udp-server = { version = "3.0.0-develop", path = "packages/udp-tracker-server" }
Expand Down
7 changes: 3 additions & 4 deletions contrib/dev-tools/analysis/workspace-coupling/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,9 @@ fn write_observations(out: &mut String) {
writeln!(out).unwrap();
writeln!(out, "### Known thin dependencies (pre-existing)").unwrap();
writeln!(out).unwrap();
writeln!(out, "- `torrust-tracker-clock` → `torrust-tracker-primitives`: only").unwrap();
writeln!(out, " `DurationSinceUnixEpoch` imported. Addressed by SI-02.").unwrap();
writeln!(out, "- `torrust-tracker-configuration` → `torrust-tracker-clock`: only").unwrap();
writeln!(out, " `DEFAULT_TIMEOUT` imported. Addressed by SI-03.").unwrap();
writeln!(out, "None — previously known thin dependencies have been resolved:").unwrap();
writeln!(out, "- `torrust-clock` → `torrust-tracker-primitives` (resolved by SI-02)").unwrap();
writeln!(out, "- `torrust-tracker-configuration` → `torrust-clock` (resolved by SI-03)").unwrap();
writeln!(out).unwrap();
writeln!(out, "### New findings").unwrap();
writeln!(out).unwrap();
Expand Down
18 changes: 9 additions & 9 deletions docs/issues/open/1669-overhaul-packages/EPIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The workspace currently contains **27 packages** (including the root `torrust-tr

| Published on crates.io | Crate Name | Folder |
| ---------------------- | ------------------------ | ---------------- |
| No | `torrust-clock` | `clock` |
| No | `torrust-metrics` | `metrics` |
| No | `torrust-net-primitives` | `net-primitives` |
| No | `torrust-server-lib` | `server-lib` |
Expand All @@ -73,7 +74,6 @@ The workspace currently contains **27 packages** (including the root `torrust-tr
| No | `torrust-tracker-axum-rest-api-server` | `axum-rest-tracker-api-server` |
| No | `torrust-tracker-axum-server` | `axum-server` |
| No | `torrust-tracker-client` | `console/tracker-client` |
| Yes | `torrust-tracker-clock` | `clock` |
| Yes | `torrust-tracker-configuration` | `configuration` |
| Yes | `torrust-tracker-contrib-bencode` | `contrib/bencode` |
| No | `torrust-tracker-events` | `events` |
Expand Down Expand Up @@ -115,12 +115,12 @@ destination group with a "Renamed from …" note.

### `torrust-` prefix (non-`torrust-tracker-`)

| Published on crates.io | Crate Name | Folder | Change |
| ---------------------- | ------------------------ | ---------------- | -------------------------------------------- |
| Yes | `torrust-clock` | `clock` | Renamed from `torrust-tracker-clock` |
| Yes | `torrust-located-error` | `located-error` | Renamed from `torrust-tracker-located-error` |
| Yes | `torrust-net-primitives` | `net-primitives` | New package (created by SI-05) |
| No | `torrust-metrics` | `metrics` | — |
| Published on crates.io | Crate Name | Folder | Change |
| ---------------------- | ------------------------ | ---------------- | ---------------------------------------------------- |
| Yes | `torrust-clock` | `clock` | Renamed from `torrust-tracker-clock` ✓ (SI-09 #1821) |
| Yes | `torrust-located-error` | `located-error` | Renamed from `torrust-tracker-located-error` |
| Yes | `torrust-net-primitives` | `net-primitives` | New package (created by SI-05) |
| No | `torrust-metrics` | `metrics` | — |

### `torrust-tracker-` prefix

Expand Down Expand Up @@ -215,7 +215,7 @@ Status: TODO unless noted. `SI-XX` = recommended implementation sequence number.
- [x] SI-06 — [#1813](https://github.com/torrust/torrust-tracker/issues/1813) Resolve `bittorrent-tracker-core` ↔ `torrust-tracker-rest-api-client` layer violation _(Rule M; prerequisite for `bittorrent-tracker-core` extraction)_
- [x] SI-07 — [#1816](https://github.com/torrust/torrust-tracker/issues/1816) Align `torrust-` prefix: rename 7 tracker-specific packages to `torrust-tracker-` _(Rule U; no blockers)_
- [x] SI-08 — [#1819](https://github.com/torrust/torrust-tracker/issues/1819) Rename `torrust-tracker-metrics` to `torrust-metrics` _(Rule U; no blockers)_
- [ ] SI-09 — Rename `torrust-tracker-clock` to `torrust-clock` _(Rule P; no blockers)_
- [x] SI-09 — [#1821](https://github.com/torrust/torrust-tracker/issues/1821) Rename `torrust-tracker-clock` to `torrust-clock` _(Rule P; no blockers)_
- [ ] SI-10 — Rename `torrust-tracker-located-error` to `torrust-located-error` _(Rule P; no blockers)_
- [ ] SI-11 — Update all package READMEs _(documentation; after SI-07–SI-10; before SI-12)_
- [ ] SI-12 — Extract and rename `torrust-tracker-contrib-bencode` to `torrust-bencode` _(Rule E; no blockers within this EPIC)_
Expand All @@ -235,7 +235,7 @@ Details:
| SI-06 | [#1813](https://github.com/torrust/torrust-tracker/issues/1813) — Resolve `bittorrent-tracker-core` ↔ `torrust-tracker-rest-api-client` layer violation | [docs/issues/closed/1813-1669-06-resolve-bittorrent-tracker-core-rest-api-layer-violation.md](../../closed/1813-1669-06-resolve-bittorrent-tracker-core-rest-api-layer-violation.md) | DONE | Rule M; stale unused dev dep removed in PR #1804; unblocks `bittorrent-tracker-core` extraction |
| SI-07 | [#1816](https://github.com/torrust/torrust-tracker/issues/1816) — Align `torrust-` prefix: rename 7 tracker-specific packages to `torrust-tracker-` | [docs/issues/open/1816-1669-07-align-torrust-prefix-rename-tracker-specific-packages.md](../../open/1816-1669-07-align-torrust-prefix-rename-tracker-specific-packages.md) | DONE | Rule U; none of the 7 are published; pure workspace rename; no blockers |
| SI-08 | [#1819](https://github.com/torrust/torrust-tracker/issues/1819) — Rename `torrust-tracker-metrics` to `torrust-metrics` | [docs/issues/open/1819-1669-08-rename-torrust-tracker-metrics-to-torrust-metrics.md](../../open/1819-1669-08-rename-torrust-tracker-metrics-to-torrust-metrics.md) | DONE | Rule U; not yet published; no blockers; prerequisite for SI-14 |
| SI-09 | #TBD — Rename `torrust-tracker-clock` to `torrust-clock` | [docs/issues/drafts/1669-09-rename-torrust-tracker-clock-to-torrust-clock.md](../../drafts/1669-09-rename-torrust-tracker-clock-to-torrust-clock.md) | TODO | Rule P; published on crates.io; no blockers; prerequisite for SI-13 |
| SI-09 | [#1821](https://github.com/torrust/torrust-tracker/issues/1821) — Rename `torrust-tracker-clock` to `torrust-clock` | [docs/issues/open/1821-1669-09-rename-torrust-tracker-clock-to-torrust-clock.md](../../open/1821-1669-09-rename-torrust-tracker-clock-to-torrust-clock.md) | DONE | Rule P; published on crates.io; no blockers; prerequisite for SI-13 |
| SI-10 | #TBD — Rename `torrust-tracker-located-error` to `torrust-located-error` | [docs/issues/drafts/1669-10-rename-torrust-tracker-located-error-to-torrust-located-error.md](../../drafts/1669-10-rename-torrust-tracker-located-error-to-torrust-located-error.md) | TODO | Rule P; published on crates.io; no blockers |
| SI-11 | #TBD — Update all package READMEs | [docs/issues/drafts/1669-11-update-all-package-readmes.md](../../drafts/1669-11-update-all-package-readmes.md) | TODO | Documentation; requires SI-07–SI-10; before SI-12 |
| SI-12 | #TBD — Extract and rename `torrust-tracker-contrib-bencode` to `torrust-bencode` | [docs/issues/drafts/1669-12-extract-torrust-tracker-contrib-bencode-to-torrust-bencode.md](../../drafts/1669-12-extract-torrust-tracker-contrib-bencode-to-torrust-bencode.md) | TODO | Rule E; no workspace-dep blockers; Apache-2.0; one internal consumer |
Expand Down
Loading
Loading