test: add backend simple tests and enable ty check#542
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a reusable backend test-and-lint CI workflow, root pytest configuration and fixtures, constrains common generics with PEP 695, hardens indexer XML parsing, expands unit tests (indexer, torrent utils, API smoke tests), and applies peripheral type-suppression/annotation fixes. ChangesTesting & Type-Checking Infrastructure Upgrade
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@media_manager/indexer/indexers/torznab_mixin.py`:
- Around line 31-35: The code accesses enclosure.attrib['type'] and
enclosure.attrib['url'] directly which raises when attributes are missing;
update the handling in the torznab_mixin logic (where enclosure is found/checked
and later referenced around the enclosure variable and the code at the second
access near line 79) to explicitly guard attribute access: use
enclosure.get('type') and enclosure.get('url') (or check 'type' in
enclosure.attrib and 'url' in enclosure.attrib'), and if either is missing log a
warning like "Torznab item missing enclosure type/url, skipping." and continue
so malformed items are skipped deterministically instead of triggering the broad
exception path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: def51c93-4abb-4d42-8c83-5f11237498a1
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (29)
.github/workflows/backend-test-lint.yml.github/workflows/build-push-backend.ymlconftest.pydocs/contributing-to-mediamanager/developer-guide.mdmedia_manager/auth/router.pymedia_manager/auth/users.pymedia_manager/common/repository.pymedia_manager/common/schemas.pymedia_manager/common/service.pymedia_manager/indexer/indexers/jackett.pymedia_manager/indexer/indexers/prowlarr.pymedia_manager/indexer/indexers/torznab_mixin.pymedia_manager/indexer/tests/test_schemas.pymedia_manager/indexer/tests/test_scoring.pymedia_manager/main.pymedia_manager/movies/importer.pymedia_manager/movies/service.pymedia_manager/notification/repository.pymedia_manager/torrent/download_clients/qbittorrent.pymedia_manager/torrent/tests/test_utils.pymedia_manager/tv/importer.pymedia_manager/tv/service.pypyproject.tomlruff.tomltests/api/__init__.pytests/api/conftest.pytests/api/test_health.pytests/factories/indexer.pytests/types.py
📜 Review details
🔇 Additional comments (30)
media_manager/common/repository.py (1)
2-2: LGTM!Also applies to: 5-6, 10-11, 19-19, 142-144, 148-150, 180-182
media_manager/common/service.py (1)
4-4: LGTM!Also applies to: 7-8, 26-26, 52-52, 85-85, 97-97, 137-137, 155-155, 208-210
media_manager/auth/router.py (1)
37-37: LGTM!Also applies to: 53-53
media_manager/auth/users.py (1)
60-62: LGTM!Also applies to: 141-143, 228-236
media_manager/main.py (1)
147-147: LGTM!Also applies to: 152-152
media_manager/movies/service.py (1)
91-91: LGTM!media_manager/notification/repository.py (1)
2-2: LGTM!Also applies to: 4-4, 94-94
media_manager/torrent/download_clients/qbittorrent.py (1)
63-65: LGTM!Also applies to: 177-179
media_manager/torrent/tests/test_utils.py (1)
1-62: LGTM!docs/contributing-to-mediamanager/developer-guide.md (2)
200-224: LGTM!
225-236: LGTM!media_manager/common/schemas.py (1)
7-7: LGTM!Also applies to: 28-28
media_manager/tv/importer.py (1)
14-14: LGTM!Also applies to: 40-40, 59-59, 121-121
media_manager/movies/importer.py (1)
38-38: LGTM!Also applies to: 125-125
media_manager/tv/service.py (1)
25-25: LGTM!Also applies to: 224-224
media_manager/indexer/indexers/torznab_mixin.py (1)
3-3: LGTM!Also applies to: 26-29, 44-44, 66-66
media_manager/indexer/indexers/jackett.py (1)
93-96: LGTM!Also applies to: 203-203
media_manager/indexer/indexers/prowlarr.py (1)
135-135: LGTM!Also applies to: 164-164
media_manager/indexer/tests/test_schemas.py (1)
1-80: LGTM!media_manager/indexer/tests/test_scoring.py (1)
1-134: LGTM!tests/factories/indexer.py (1)
1-22: LGTM!tests/types.py (1)
1-17: LGTM!.github/workflows/backend-test-lint.yml (1)
1-65: LGTM!.github/workflows/build-push-backend.yml (1)
36-38: LGTM!Also applies to: 59-59
conftest.py (1)
1-66: LGTM!pyproject.toml (2)
53-64: LGTM!
45-46: ⚡ Quick winDependency versions are valid and compatible.
Pytest 9.0.3 (released 7 April 2026) and pytest-asyncio 1.3.0 (released as stable version) are confirmed compatible. pytest-asyncio 1.3.0 was specifically updated to support pytest 9, confirming compatibility with the
asyncio_mode = "strict"configuration.ruff.toml (1)
46-58: LGTM!tests/api/conftest.py (1)
1-11: LGTM!tests/api/test_health.py (1)
10-45: LGTM!
Hey!
While implementing #541 i was really missed quick way to make sure to check that the repo is operational / type checked.
tyalready, fixed all 72 errorstyin docsNOT included: proper api test, db tests, e2e test -- the main gold pf this PR is not discuss and make a foundation to build on + enable auto-testing in ci.
That would be great if you can take a look! @maxdorninger
Thanks!
Summary by CodeRabbit
Tests
Bug Fixes
Documentation
Chores