Per-tracker seeding rules and torrent reaper #88
Merged
naps62-yolo
merged 4 commits from 2026-08-23 00:03:31 +01:00
issue/25-seeding-reaper into main
Labels
Clear labels
area/api
area/ci
area/compat
area/core
area/daemon
area/db
area/dl
area/indexer
area/infra
area/meta
area/parse
area/probe
area/subs
area/web
difficulty/easy
difficulty/hard
difficulty/moderate
difficulty/trivial
phase/1-skeleton
phase/2-logic
phase/3-sourcing
phase/4-movies
phase/5-ui
phase/6-tv
phase/7-people
phase/8-compat
phase/9-subtitles
type/bug
type/chore
type/feature
type/test
arr-api
CI and test harness
arr-compat
arr-core
arr-daemon
arr-db
arr-dl
arr-indexer
workspace and tooling
arr-meta
arr-parse
arr-probe
arr-subs crate: providers, extraction, translation, sync
web/
bounded, obvious approach, few files
subtle correctness or cross-cutting
multiple files, judgement, an interface to design
one file, mechanical, no design decisions
workspace, CI, config, database, empty API and SPA
parsing and policy engine, pure, no network
TMDB and Prowlarr, read-only
movies end to end
search, buckets, library views, queues
seasons, episodes, tracking, derived status
owner tags and notifications
Jellyseerr shim
build order: subtitles, DESIGN.md §15
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yolo/arr#88
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Issue
Closes #25
Test plan
just cicargo nextest run -p arr-e2eagainstjust e2e-upReviewed
59c5f4f.@@ -0,0 +49,4 @@}fn is_arr_label(label: &str) -> bool {matches!(label, "movies-main" | "movies-kids" | "tv-main" | "tv-kids")This hardcodes the four current labels, while grab.rs
label()derives{kind}-{audience}from the roots table (roots are DB rows, seeded by migrations). A new root would produce torrents the reaper silently never removes.run()already receives theDb— derive the label set from the roots table, or share one mapping with grab.rs.@@ -165,0 +172,4 @@.join("../../target/e2e-downloads").canonicalize().expect("canonical download directory");std::fs::write(download_dir.join(&name), [0_u8]).expect("seed torrent payload");The new test needs a filesystem shared with Transmission, which only
just e2e-up's volume mount provides. The CIe2eworkflow runs Transmission as a service container with no shared volume, andtarget/e2e-downloadsdoesn't exist on the runner, socanonicalize()/fs::writepanic and thee2e / e2echeck fails on this PR (it did). Either add the shared dir to the workflow service, or skip the test when the shared dir is absent.Reviewed
896835f. The e2e shared-filesystem finding is addressed — the test now only asserts the negative side (unfinished before the limit), which is CI-safe. Theis_arr_labelhardcoded-labels finding oncrates/arr-daemon/src/reaper.rs:52still stands.@@ -165,2 +202,3 @@fn torrent_with_name(name: &str) -> Vec<u8> {let piece_hash = [0_u8; 20];// SHA-1 of the single zero byte written by the seeding-boundary test.Stale after the fix: no test writes this payload any more — the seeding-boundary test no longer creates a file, so this comment (and the specific hash) now describe nothing. A zeroed hash with a note that no data is ever verified would be truthful again.
Fixed in
0c64642: the reaper now derives active torrent labels from therootstable through the sharedlabel_for_rootmapping, so newly configured roots are included. The CI-safe E2E adjustment also removed the stale payload/hash comment.Fixed in
0c64642: active labels now come from the database roots and share grab.rs label mapping; this no longer hardcodes the four initial labels.Stale filesystem/hash comment removed in
0c64642.Reviewed
0c64642. Both earlier findings are addressed: reaper labels now derive from the roots table through the sharedlabel_for_root, and the stale piece-hash comment is gone. One new finding on the query style.@@ -0,0 +44,4 @@fn run<'a>(&'a self, _database: &'a Db) -> ActionFuture<'a> {Box::pin(async move {let labels = sqlx::query_as::<_, (String, String)>("SELECT kind, audience FROM roots")Non-test SQL elsewhere in the daemon goes through the compile-time-checked
sqlx::query!macros (CLAUDE.md: "SQL goes through sqlx compile-time-checked queries"); runtimequery_asis only used in tests. Usesqlx::query!("SELECT kind, audience FROM roots")here. Also,_databaseis now a used binding — drop the underscore.