135 Commits
Author SHA1 Message Date
trex Bot cc2d75c777 fix: resolve the seven bugs pinned by the test audit (#67)
test / unit-tests (push) Successful in 6s
test / komodo-deploy-script (push) Successful in 16s
ci / docker (push) Successful in 1m13s
v3.0.0
2026-11-03 16:47:29 -06:00
trex Bot 0c02cd40b0 test: audit suite for meaningfulness, reach 100% coverage (#66)
test / unit-tests (push) Successful in 7s
test / komodo-deploy-script (push) Successful in 16s
ci / docker (push) Successful in 1m17s
2026-11-03 16:47:04 -06:00
trex Bot d8034278d8 fix: resolve the seven bugs pinned by the test audit
test / unit-tests (push) Successful in 14s
ci / docker (push) Successful in 23s
test / unit-tests (pull_request) Successful in 6s
test / komodo-deploy-script (push) Successful in 23s
test / komodo-deploy-script (pull_request) Successful in 16s
- read [ignored_tags] instead of [ignored_domains], so tag-based ignoring
  actually works
- match ignored tags as whole tags, not substrings ('ipt' no longer matches
  'iptorrents')
- send the login-error notification through the Pushover client instead of
  the non-existent module-level send_message()
- handle an empty torrent list instead of raising IndexError before any
  summary is sent
- tag a new torrent once instead of once per code path
- honour toml_path without DOCKER in AppriseClient
- close replaced log handlers so the file descriptor is released

Also add the missing [telemetry] section to config.toml.example, which
qbit-maid.py requires at startup.

The tests that pinned each bug now assert the fixed behaviour, and the
suite still reports 100% coverage.
2026-11-03 16:10:19 -06:00
trex Bot ab46ea1fb2 ci: fix unit-tests job on the Debian-packaged runner pip
ci / docker (push) Successful in 23s
test / unit-tests (pull_request) Successful in 5s
test / komodo-deploy-script (pull_request) Successful in 16s
test / unit-tests (push) Successful in 6s
test / komodo-deploy-script (push) Successful in 17s
The runner image ships pip 24.0 from the Debian package, so
`pip install --upgrade pip` aborts with "Cannot uninstall pip 24.0,
RECORD file not found" and the job failed after 4s. Drop the upgrade
and install with --break-system-packages.
2026-11-03 15:35:39 -06:00
trex Bot 925f9619be test: audit suite for meaningfulness, reach 100% coverage
test / unit-tests (push) Failing after 4s
test / komodo-deploy-script (push) Successful in 16s
test / unit-tests (pull_request) Failing after 3s
test / komodo-deploy-script (pull_request) Successful in 16s
ci / docker (push) Successful in 1m37s
The suite had 8 empty `pass` tests, two tests that made live network
calls to a production healthcheck endpoint, and a write_csv test that
only asserted the file existed. CI ran only test_komodo_deploy, so the
main suite never executed at all.

- Split tests by module: test_qlist, test_qprocess, test_qlogging_extra,
  test_apprise, test_qbt; rewrote test_qbitmaid and test_write_csv.
- qbt_fakes.py: shared fakes (FakeQbt, FakeQbtClient, FakeAPIError,
  StubPushover, FailingPushover, torrent factory).
- test_qbt.py loads the hyphenated qbit-maid.py via importlib and covers
  the __main__ entry point.
- Replaced the live-network tests with a RecordingRequests stub
  (suite time 14s -> 0.035s).
- .coveragerc + CI unit-tests job running the full suite with
  --fail-under=100.

127 unit tests, 100% statement coverage on all 5 first-party modules
(440 stmts), 15/15 mutations caught.

Seven pre-existing bugs are pinned by tests with KNOWN BUG docstrings
and left unfixed pending a decision.
2026-11-03 15:34:57 -06:00
trex Bot 5b54d9e558 Merge pull request 'feat(notify): value-first emoji rows' (#65) from dev-notify-layout into main
test / komodo-deploy-script (push) Successful in 17s
ci / docker (push) Successful in 1m54s
2026-11-03 15:19:40 -06:00
trex Bot dfce115fd8 feat(notify): value-first emoji rows
ci / docker (push) Successful in 24s
test / komodo-deploy-script (push) Successful in 26s
test / komodo-deploy-script (pull_request) Successful in 16s
Switch the summary to the layout jblu picked: each counter renders as
"emoji value label", grouped two per line and joined by a middle dot.

    Scanned 42 torrents in 12s

    🗑️ 7 removed  ·  👻 4 orphaned
    ⏭️ 5 ignored  ·  🐣 3 premature

    🛡️ 10 protected  ·  🌐 20 public

- the value leads, so the numbers are the first thing the eye lands on
- html style now bolds the values instead of the labels
- "Non-protected" reads as "public", matching the non_protected_tag
- use_emoji now defaults to true; false gives the plain variant
- dry runs read "7 would be removed"
2026-11-03 15:10:03 -06:00
trex Bot 5d9da0d22b fix(notify): group counters instead of padding columns
ci / docker (push) Successful in 36s
test / komodo-deploy-script (push) Successful in 16s
test / komodo-deploy-script (pull_request) Successful in 17s
Pushover renders the notification body in a proportional font, so the
space-padded label/value columns never lined up on a phone — the body
collapsed into a ragged flat list with no visual grouping. The html
variant was worse: the padding sat inside the HTML, so it collapsed to a
single space.

Counters are now grouped two per line and joined with a middle dot, which
survives any font. The body drops from 8 lines to 5 and no longer restates
the outcome the title already carries.

- replace _notify_row/LABEL_WIDTH/VALUE_WIDTH with _stat_row
- add docs/notify-preview.py, which renders the real build_summary()
  output as a phone-width PNG so layout changes can be reviewed visually
- tests: assert no space padding, two counters per row, and that the body
  does not repeat the title
2026-11-03 15:02:57 -06:00
jblu 1caa346a7c Merge pull request 'feat(notify): configurable plain/html summary formatting' (#64) from dev-notification-format into main
ci / docker (push) Successful in 1m16s
test / komodo-deploy-script (push) Successful in 1m31s
Reviewed-on: #64
2026-11-02 01:13:22 -06:00
nanobot 881765cdf5 feat(notify): configurable plain/html summary formatting
test / komodo-deploy-script (push) Successful in 17s
test / komodo-deploy-script (pull_request) Successful in 16s
ci / docker (push) Successful in 2m2s
Rework the Pushover/Apprise summary so it reads as a report instead of a
dump of counters.

- Extract build_summary() as the single source of truth for both notifiers,
  removing the duplicated body string and the stray leading indentation
  caused by backslash line continuations.
- Add a 'format' option: 'plain' (aligned columns) or 'html' (bold labels,
  sets html=1 for Pushover). Apprise always receives the plain body.
- Add 'use_emoji' for emoji-prefixed rows.
- Title now states the outcome ('7 torrents removed') instead of
  '--- qbit-maid summary ---'.
- Say 'Would remove' when delete_torrents is false, so a dry run is never
  mistaken for a real deletion.
- Format runtime as 12s / 1m 04s instead of a timedelta with microseconds.
- Add include_hostname, notify_on_empty, priority, sound, retry and expire.
- Log notification failures instead of letting them abort the run.
- Cover the new formatting with unit tests; document the options in the
  README and config.toml.example.
2026-10-27 10:09:35 -05:00
jblu ebec893a85 Merge pull request 'Improve logging: named logger, rotation, richer format' (#62) from logging-improvement into main
test / komodo-deploy-script (push) Successful in 20s
ci / docker (push) Successful in 42s
Reviewed-on: #62
2026-10-27 00:31:29 -05:00
jblu 147758a1e8 Merge pull request 'ci: auto-deploy qbit-maid to Komodo after image push' (#63) from dev-komodo-deploy into main
ci / docker (push) Failing after 21s
test / komodo-deploy-script (push) Successful in 22s
Reviewed-on: #63
2026-10-27 00:31:12 -05:00
Jonathan Branan b2b8f6c10d fix: deterministic exit code for missing Komodo env vars
test / komodo-deploy-script (push) Successful in 16s
ci / docker (push) Successful in 48s
test / komodo-deploy-script (pull_request) Successful in 16s
':?' exits 1 under bash but 2 under dash (the Ubuntu runner's sh),
so the two missing-variable tests failed in CI while passing locally.
Replace with explicit checks so every failure path exits 1.
2026-10-27 00:16:51 -05:00
Jonathan Branan 003217a2b8 test: cover komodo-deploy.sh against a mock Komodo API
ci / docker (push) Successful in 21s
test / komodo-deploy-script (push) Failing after 21s
15 unittest cases exercising the real script end to end: target
selection, auth headers, request shape, success/failure, HTTP 401/400,
unreachable host, polling to completion, and timeout.

Runs in CI via .gitea/workflows/test.yml on push to main/dev* and on
pull requests. No network or live Komodo instance required.
2026-10-27 00:11:53 -05:00
Jonathan Branan 45908b8f6e ci: fix Komodo deploy step permission denied
ci / docker (push) Successful in 5m11s
core.fileMode is false in this repo, so the exec bit on
komodo-deploy.sh was not recorded and the runner hit
'Permission denied'. Mark the file executable in the index and
invoke it via 'sh' so the step no longer depends on the mode bit.
2026-10-26 23:50:28 -05:00
Jonathan Branan ef002b2fce ci: auto-deploy to Komodo stack after image push
ci / docker (push) Failing after 44s
Adds a shared .gitea/scripts/komodo-deploy.sh that calls the Komodo
/execute/DeployStack API after the image is pushed, then polls
/read/GetUpdate until the deploy completes.

A push webhook cannot do this correctly: it fires before the image
exists in the registry, so Komodo would redeploy the previous :latest.

- docker.yml deploys stack 'qbit-maid' (required)
- docker-dev.yml deploys vars.KOMODO_STACK_DEV, skipped when unset
2026-10-26 23:43:42 -05:00
Jonathan Branan f1489ba8a8 docs: plan for automatic Komodo deploys from Gitea Actions 2026-10-26 23:31:04 -05:00
Jonathan Branan ab30d69c7c Improve logging: named logger, rotation, richer format, remove use_log guards
- Add setup_logging() returning a named 'qbit-maid' logger with
  RotatingFileHandler (configurable size/backups) and a console handler
- Add log_torrent() helper for structured torrent context
- Replace basicConfig-based tor_log() with setup_logging()
- Remove redundant 'if self.use_log:' guards across qbit-maid.py,
  qlist.py, qprocess.py, qlogging.py (level filtering handles it)
- Document new logging options in config.toml.example and README
2026-10-26 22:10:35 -05:00
jblu 36d9692086 Merge pull request 'fixed crontab writing jobs multiple times' (#61) from dev-update-crontab into main
ci / docker (push) Successful in 38s
Reviewed-on: #61
2026-04-10 16:40:28 -05:00
jblu 4416ebd924 fixed crontab writing jobs multiple times
ci / docker (push) Successful in 41s
2026-04-10 16:19:36 -05:00
jblu acaf91a301 update readme
ci / docker (push) Successful in 39s
2026-04-09 12:32:59 -05:00
jblu 2213a0655d Merge pull request 'dev-migrate-to-crond' (#60) from dev-migrate-to-crond into main
ci / docker (push) Successful in 40s
Reviewed-on: #60
2026-04-08 20:52:28 -05:00
jblu 6248b7f721 update readme
ci / docker (push) Successful in 38s
2026-04-08 19:12:43 -05:00
jblu e1668dd42d migrated to crond 2026-04-08 19:10:04 -05:00
jblu d15cc8d95c updated healthchecks to support starting and stopping a job
continuous-integration/drone/push Build is passing
2024-06-03 20:32:57 -05:00
jblu 708d56fc98 Updated documentation
continuous-integration/drone/push Build is passing
2023-10-05 08:24:28 -05:00
jblu 6110dade2d Updated help #56
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
v2.1.0
2023-10-05 07:37:21 -05:00
jblu da7951384f Merge pull request 'dev-fix-calculations' (#59) from dev-fix-calculations into main
continuous-integration/drone/push Build is passing
Reviewed-on: #59
2023-10-05 07:29:00 -05:00
jblu c3865d5fbb Updated test cases
continuous-integration/drone/push Build is passing
2023-10-04 15:03:11 -05:00
jblu 24f6e7b563 updated unit tests and fixed a bug
continuous-integration/drone/push Build is passing
2023-09-20 00:18:26 -05:00
jblu 588382ae14 fixed unit test
continuous-integration/drone/push Build is passing
2023-09-12 14:03:15 -05:00
jblu 01a4c88cc4 Fixed #58
continuous-integration/drone/push Build is failing
2023-09-12 13:04:38 -05:00
jblu 8e70374ae7 test
continuous-integration/drone/push Build is passing
2023-08-09 10:47:27 -05:00
jblu ce5ae0261c changed drone 2023-08-06 23:38:39 -05:00
jblu 4cfb4a88c1 added badge
continuous-integration/drone/push Build is passing
2023-07-23 00:39:39 -05:00
jblu 43c9324a3f updated documentation #56
continuous-integration/drone/push Build is passing
2023-07-23 00:32:15 -05:00
jblu d2ebddf473 Merge pull request 'updated testing' (#54) from dev-update-testing into main
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.jbranan.com/jblu/qbit-maid/pulls/54
2023-06-27 12:46:20 -05:00
jblu a4fc54afe5 updated testing
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2023-06-27 12:43:10 -05:00
Jonathan Branan 728e429979 fixed build process
continuous-integration/drone/push Build is passing
2023-06-23 04:24:14 -05:00
Jonathan Branan b8a31c43de updated drone
continuous-integration/drone/push Build is passing
2023-06-23 04:20:12 -05:00
jblu 167575fe5d Merge pull request 'migrated to supercronic' (#53) from dev-migrate-supercronic into main
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
Reviewed-on: https://git.jbranan.com/jblu/qbit-maid/pulls/53
2023-06-23 04:05:51 -05:00
Jonathan Branan ca1430b302 migrated to supercronic
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-23 04:02:05 -05:00
jblu 660a18a70f disable warnings
continuous-integration/drone/push Build is passing
2023-06-11 14:41:50 -05:00
jblu 7a6787888c tag only latest
continuous-integration/drone/push Build is passing
2023-06-06 15:20:20 -05:00
jblu 65598d97ac enabled drone
continuous-integration/drone/push Build is passing
2023-06-06 15:17:31 -05:00
jblu e2cdca60c3 Merge pull request 'intergrate-drone' (#51) from intergrate-drone into main
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.jbranan.com/jblu/qbit-maid/pulls/51
2023-06-06 15:06:12 -05:00
jblu 978e9326cc updated to execute on main branch
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-06-06 14:47:03 -05:00
jblu beee95caa4 updated to use secret
continuous-integration/drone/push Build is passing
2023-06-06 14:44:56 -05:00
jblu 6ce2add157 added drone support
continuous-integration/drone/push Build is passing
2023-06-06 14:33:07 -05:00
jblu dc533a33b1 updated docker ignore #50 2023-06-06 14:18:11 -05:00