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
15 changes: 15 additions & 0 deletions .github/skills/dev/git-workflow/run-pre-push-checks/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ manually before each push.
> **⏱️ Expected runtime: ~5 minutes** on a modern developer machine with warm caches.
> AI agents should set a command timeout of **at least 15 minutes** before invoking
> `./contrib/dev-tools/git/hooks/pre-push.sh`.
>
> **For AI agents — `git push` is a long-running command:**
> When the pre-push hook is installed, `git push` runs the full check suite (~5 minutes)
> before sending objects to the remote. Do **not** poll, retry, or issue a second `git push`
> while the first is still running. Wait for the IDE terminal-completion notification
> (exit code + output) before taking any follow-up action.
>
> To avoid parsing shared terminal history (which other commands or the user may have
> populated), redirect the output to a dedicated file and read that file for results:
>
> ```bash
> git push <remote> <branch> > .tmp/push-output.txt 2>&1; echo "Exit: $?" >> .tmp/push-output.txt
> ```
>
> The `.tmp/` directory is git-ignored. Clean stale files periodically.

Run the pre-push script. **It must exit with code `0` before every push.**

Expand Down
3 changes: 1 addition & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions docs/issues/open/1669-overhaul-packages/EPIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Status: TODO unless noted. `SI-XX` = recommended implementation sequence number.
- [ ] SI-01 — Establish baseline: dependency graph + README audit _(analysis; no blockers; informs all other subissues)_
- [x] SI-02 — Move `DurationSinceUnixEpoch` from `torrust-tracker-primitives` to `torrust-tracker-clock` _(Rule M; no hard blockers)_
- [ ] SI-03 — Define per-package default timeout constants and remove `DEFAULT_TIMEOUT` from `torrust-tracker-configuration` _(Rule M; no blockers)_
- [ ] SI-04 — Move `AnnouncePolicy` from `torrust-tracker-configuration` to `torrust-tracker-primitives` _(Rule M; no blockers)_
- [ ] SI-04 — [#1795](https://github.com/torrust/torrust-tracker/issues/1795) Move `AnnouncePolicy` from `torrust-tracker-configuration` to `torrust-tracker-primitives` _(Rule M; no blockers)_
- [ ] SI-05 — Create `torrust-net-primitives` and move `ServiceBinding` from `torrust-tracker-primitives` _(Rule M + new package; no blockers)_
- [ ] SI-06 — Resolve `bittorrent-tracker-core` ↔ `torrust-rest-tracker-api-client` layer violation _(Rule M; prerequisite for `bittorrent-tracker-core` extraction)_
- [ ] SI-07 — Align `torrust-` prefix: rename 7 tracker-specific packages to `torrust-tracker-` _(Rule U; no blockers)_
Expand All @@ -227,7 +227,7 @@ Details:
| SI-01 | #TBD — Establish baseline: dependency graph + README audit | [docs/issues/drafts/1669-01-establish-baseline-analysis.md](../../drafts/1669-01-establish-baseline-analysis.md) | TODO | No blockers; informs extraction decisions |
| SI-02 | [#1790](https://github.com/torrust/torrust-tracker/issues/1790) — Move `DurationSinceUnixEpoch` from `torrust-tracker-primitives` to `torrust-tracker-clock` | [docs/issues/open/1790-move-duration-since-unix-epoch-to-torrust-tracker-clock.md](../../open/1790-move-duration-since-unix-epoch-to-torrust-tracker-clock.md) | DONE | Rule M; no hard blockers; prerequisite for SI-13 |
| SI-03 | [#1793](https://github.com/torrust/torrust-tracker/issues/1793) — Define per-package default timeout constants and remove `DEFAULT_TIMEOUT` from `torrust-tracker-configuration` | [docs/issues/open/1793-1669-03-define-per-package-default-timeout-constants.md](../../open/1793-1669-03-define-per-package-default-timeout-constants.md) | TODO | Rule M; no blockers; SI-09 no longer depends on this |
| SI-04 | #TBD — Move `AnnouncePolicy` from `torrust-tracker-configuration` to `torrust-tracker-primitives` | [docs/issues/drafts/1669-04-move-announce-policy-to-torrust-tracker-primitives.md](../../drafts/1669-04-move-announce-policy-to-torrust-tracker-primitives.md) | TODO | Rule M; fixes inverted dep (primitives → configuration); no blockers |
| SI-04 | [#1795](https://github.com/torrust/torrust-tracker/issues/1795) — Move `AnnouncePolicy` from `torrust-tracker-configuration` to `torrust-tracker-primitives` | [docs/issues/open/1795-1669-04-move-announce-policy-to-torrust-tracker-primitives.md](../../open/1795-1669-04-move-announce-policy-to-torrust-tracker-primitives.md) | TODO | Rule M; fixes inverted dep (primitives → configuration); no blockers |
| SI-05 | #TBD — Create `torrust-net-primitives` and move `ServiceBinding` from `torrust-tracker-primitives` | [docs/issues/drafts/1669-05-create-torrust-net-primitives-and-move-service-binding.md](../../drafts/1669-05-create-torrust-net-primitives-and-move-service-binding.md) | TODO | Rule M + new package; generic networking type; breaks server-lib → tracker-primitives dep |
| SI-06 | #TBD — Resolve `bittorrent-tracker-core` ↔ `torrust-rest-tracker-api-client` layer violation | [docs/issues/drafts/1669-06-resolve-bittorrent-tracker-core-rest-api-layer-violation.md](../../drafts/1669-06-resolve-bittorrent-tracker-core-rest-api-layer-violation.md) | TODO | Rule M; stale unused dev dep — one-line `Cargo.toml` deletion; unblocks `bittorrent-tracker-core` extraction |
| SI-07 | #TBD — Align `torrust-` prefix: rename 7 tracker-specific packages to `torrust-tracker-` | [docs/issues/drafts/1669-07-align-torrust-prefix-rename-tracker-specific-packages.md](../../drafts/1669-07-align-torrust-prefix-rename-tracker-specific-packages.md) | TODO | Rule U; none of the 7 are published; pure workspace rename; no blockers |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
doc-type: issue
issue-type: task
status: draft
status: open
priority: p2
github-issue: null
spec-path: docs/issues/drafts/1669-04-move-announce-policy-to-torrust-tracker-primitives.md
branch: null
related-pr: null
github-issue: 1795
spec-path: docs/issues/open/1795-1669-04-move-announce-policy-to-torrust-tracker-primitives.md
branch: 1669-04-move-announce-policy-to-torrust-tracker-primitives
related-pr: 1796
last-updated-utc: 2026-05-18 00:00
semantic-links:
skill-links:
Expand All @@ -16,12 +16,13 @@ semantic-links:
- packages/primitives/src/lib.rs
- packages/primitives/Cargo.toml
- docs/issues/open/1669-overhaul-packages/EPIC.md
- https://github.com/torrust/torrust-tracker/issues/1795
- docs/issues/open/1669-overhaul-packages/workspace-coupling-report.md
---

<!-- skill-link: create-issue -->

# Issue #[To be assigned] - Move `AnnouncePolicy` from `torrust-tracker-configuration` to `torrust-tracker-primitives`
# Issue #1795 - Move `AnnouncePolicy` from `torrust-tracker-configuration` to `torrust-tracker-primitives`

## Goal

Expand Down Expand Up @@ -80,25 +81,25 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.

| ID | Status | Task | Notes / Expected Output |
| --- | ------ | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| T1 | TODO | Locate all definition and usage sites of `AnnouncePolicy` across the workspace | `grep -r "AnnouncePolicy" . --include="*.rs"` — build a full consumer list |
| T2 | TODO | Move `AnnouncePolicy` definition to `packages/primitives/src/` (e.g. `primitives/src/announce_policy.rs`) | Public module exported from `packages/primitives/src/lib.rs` |
| T3 | TODO | Remove `AnnouncePolicy` from `packages/configuration/src/` | Definition gone; re-export or direct dep on `torrust-tracker-primitives` added to configuration |
| T4 | TODO | Add `torrust-tracker-primitives` as a dep of `packages/configuration/Cargo.toml` if not already present | `torrust-tracker-primitives` in `[dependencies]` |
| T5 | TODO | Remove `torrust-tracker-configuration` dep from `packages/primitives/Cargo.toml` if `AnnouncePolicy` was its sole reason | `cargo machete` reports no unused dep |
| T6 | TODO | Update all workspace files that import `AnnouncePolicy` from `torrust_tracker_configuration` to use `torrust_tracker_primitives` | One-line change per file |
| T7 | TODO | Run `cargo build --workspace` and `cargo test --workspace` | Clean build; all tests pass |
| T8 | TODO | Run `linter all` | Exit code `0` |
| T1 | DONE | Locate all definition and usage sites of `AnnouncePolicy` across the workspace | `grep -r "AnnouncePolicy" . --include="*.rs"` — build a full consumer list |
| T2 | DONE | Move `AnnouncePolicy` definition to `packages/primitives/src/` (e.g. `primitives/src/announce_policy.rs`) | Public module exported from `packages/primitives/src/lib.rs` |
| T3 | DONE | Remove `AnnouncePolicy` from `packages/configuration/src/` | Definition gone; re-export or direct dep on `torrust-tracker-primitives` added to configuration |
| T4 | DONE | Add `torrust-tracker-primitives` as a dep of `packages/configuration/Cargo.toml` if not already present | `torrust-tracker-primitives` in `[dependencies]` |
| T5 | DONE | Remove `torrust-tracker-configuration` dep from `packages/primitives/Cargo.toml` if `AnnouncePolicy` was its sole reason | `cargo machete` reports no unused dep |
| T6 | DONE | Update all workspace files that import `AnnouncePolicy` from `torrust_tracker_configuration` to use `torrust_tracker_primitives` | One-line change per file |
| T7 | DONE | Run `cargo build --workspace` and `cargo test --workspace` | Clean build; all tests pass |
| T8 | DONE | Run `linter all` | Exit code `0` |

## Progress Tracking

### Workflow Checkpoints

- [ ] Spec drafted in `docs/issues/drafts/`
- [ ] Spec reviewed and approved by user/maintainer
- [ ] GitHub issue created and issue number added to this spec
- [ ] Spec moved to `docs/issues/open/` with issue number prefix
- [ ] Implementation completed
- [ ] Automatic verification completed (`linter all`, `cargo test --workspace`)
- [x] Spec drafted in `docs/issues/drafts/`
- [x] Spec reviewed and approved by user/maintainer
- [x] GitHub issue created and issue number added to this spec
- [x] Spec moved to `docs/issues/open/` with issue number prefix
- [x] Implementation completed
- [x] Automatic verification completed (`linter all`, `cargo test --workspace`)
- [ ] Manual verification scenarios executed and recorded
- [ ] Acceptance criteria reviewed after implementation and updated with evidence
- [ ] EPIC #1669 Active Subissues table updated to `DONE`
Expand All @@ -108,17 +109,20 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.

- 2026-05-18 00:00 UTC - josecelano - Spec drafted as subissue of EPIC #1669, addressing F-03
from the coupling analysis report.
- 2026-05-19 UTC - josecelano - Implementation completed: moved `AnnouncePolicy` to
`primitives/src/announce.rs`, removed inverted dep, added deprecated re-export in
`configuration`, updated all workspace consumers. All checks pass.

## Acceptance Criteria

- [ ] `packages/primitives/src/` defines `AnnouncePolicy` and exports it publicly.
- [ ] `packages/primitives/Cargo.toml` does not list `torrust-tracker-configuration` as a dependency.
- [ ] `packages/configuration/src/` no longer defines `AnnouncePolicy`; it imports from `torrust-tracker-primitives`.
- [ ] No workspace file imports `AnnouncePolicy` from `torrust_tracker_configuration`
- [x] `packages/primitives/src/` defines `AnnouncePolicy` and exports it publicly.
- [x] `packages/primitives/Cargo.toml` does not list `torrust-tracker-configuration` as a dependency.
- [x] `packages/configuration/src/` no longer defines `AnnouncePolicy`; it imports from `torrust-tracker-primitives`.
- [x] No workspace file imports `AnnouncePolicy` from `torrust_tracker_configuration`
(all migrated to `torrust_tracker_primitives` or re-exported through it).
- [ ] `cargo build --workspace` succeeds with zero errors.
- [ ] `cargo test --workspace` passes with zero failures.
- [ ] `linter all` exits with code `0`.
- [x] `cargo build --workspace` succeeds with zero errors.
- [x] `cargo test --workspace` passes with zero failures.
- [x] `linter all` exits with code `0`.

## Verification Plan

Expand All @@ -134,8 +138,8 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.

Status values: `TODO`, `IN_PROGRESS`, `DONE`, `FAILED`, `BLOCKED`.

| ID | Scenario | Command / Steps | Expected Result | Status | Evidence |
| --- | ------------------------------------------------------------ | ---------------------------------------------------------------------------- | ----------------------- | ------ | -------- |
| M1 | No workspace import of `AnnouncePolicy` from `configuration` | `grep -r "torrust_tracker_configuration::AnnouncePolicy" . --include="*.rs"` | Zero matches | TODO | |
| M2 | `primitives` exports `AnnouncePolicy` | `grep "AnnouncePolicy" packages/primitives/src/lib.rs` | `pub` declaration found | TODO | |
| M3 | `primitives` dep list does not include `configuration` | `grep "torrust-tracker-configuration" packages/primitives/Cargo.toml` | Zero matches | TODO | |
| ID | Scenario | Command / Steps | Expected Result | Status | Evidence |
| --- | ------------------------------------------------------------ | ---------------------------------------------------------------------------- | ----------------------- | ------ | ------------------------------------------------------------------ |
| M1 | No workspace import of `AnnouncePolicy` from `configuration` | `grep -r "torrust_tracker_configuration::AnnouncePolicy" . --include="*.rs"` | Zero matches | DONE | `grep` returned zero matches |
| M2 | `primitives` exports `AnnouncePolicy` | `grep "AnnouncePolicy" packages/primitives/src/lib.rs` | `pub` declaration found | DONE | `pub use announce::{AnnounceData, AnnounceEvent, AnnouncePolicy};` |
| M3 | `primitives` dep list does not include `configuration` | `grep "torrust-tracker-configuration" packages/primitives/Cargo.toml` | Zero matches | DONE | `grep` returned zero matches |
1 change: 1 addition & 0 deletions packages/configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ serde_with = "3"
thiserror = "2"
toml = "0"
torrust-tracker-located-error = { version = "3.0.0-develop", path = "../located-error" }
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
tracing = "0"
tracing-subscriber = { version = "0", features = [ "json" ] }
url = "2"
Expand Down
Loading
Loading