Skip to content

Conversation

@Teagan42
Copy link
Contributor

@Teagan42 Teagan42 commented Oct 5, 2025

What

  • split loader ingestion, enrichment, and storage logic into dedicated subpackages with shared utilities and update the pipeline to orchestrate them
  • make the storage task depend on injected helpers, expose the IMDb retry queue alias, and adjust logging expectations to reference the storage worker
  • fix Qdrant batch slicing when overriding the batch size and bump the project version to 0.26.61

Why

  • renaming the upsert worker to a storage worker required a clearer module boundary and updated log expectations
  • dependency injection keeps existing tests and monkeypatching hooks working while the batching fix restores the intended upsert behavior

Affects

  • loader task orchestration, storage utilities, and logging tests
  • project version metadata

Testing

  • uv run pytest

Documentation

  • n/a

https://chatgpt.com/codex/tasks/task_e_68e2737183f08328be8d23c995b0b62b

Copilot AI review requested due to automatic review settings October 5, 2025 14:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This refactoring splits the monolithic loader module into specialized subpackages for ingestion, enrichment, and storage while maintaining clean interfaces between them. The changes improve modularity and enable better dependency injection for testing.

  • Split loader logic into dedicated ingestion, enrichment, and storage subpackages with shared utilities
  • Renamed "upsert worker" to "storage worker" throughout logging and orchestration code
  • Fixed Qdrant batch slicing logic and bumped project version to 0.26.61

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_loader_logging.py Updated test assertion to expect "Storage worker" instead of "Upsert worker"
pyproject.toml Bumped version from 0.26.60 to 0.26.61
mcp_plex/loader/utils.py Created shared utilities module with common functions for all loader subpackages
mcp_plex/loader/storage/utils.py Extracted storage-specific utilities including Qdrant operations and point building
mcp_plex/loader/storage/types.py Defined storage batch type alias
mcp_plex/loader/storage/init.py Implemented StorageTask class for handling Qdrant operations with dependency injection
mcp_plex/loader/ingestion/utils.py Extracted ingestion utilities including sample data loading and chunking
mcp_plex/loader/ingestion/types.py Defined ingestion batch types for movies, episodes, and samples
mcp_plex/loader/ingestion/init.py Implemented IngestionTask class for fetching and batching Plex data
mcp_plex/loader/enrichment/utils.py Extracted enrichment utilities for external API calls and metadata processing
mcp_plex/loader/enrichment/types.py Defined IMDbRetryQueue class with serialization support
mcp_plex/loader/enrichment/init.py Implemented EnrichmentTask class for metadata enrichment workflows
mcp_plex/loader/init.py Refactored main loader to orchestrate the new modular task classes
docker/pyproject.deps.toml Updated version to match main pyproject.toml

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Oct 5, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
mcp_plex/loader
   __init__.py2942392%135, 374, 376, 393–395, 406–407, 431, 483, 496–497, 508–510, 513, 516–517, 519, 608–610, 938
mcp_plex/loader/enrichment
   __init__.py1122776%105, 107, 111, 114–121, 124–131, 140, 144–155, 160–173, 177, 195, 199–201
   utils.py2605579%73, 136, 138–140, 155, 410–449, 468–534
mcp_plex/loader/ingestion
   __init__.py723058%49, 53, 61, 71, 82–114
mcp_plex/loader/storage
   __init__.py54296%63, 66
   utils.py151299%209–214
mcp_plex/server
   __init__.py6142995%43–44, 119–120, 148, 252, 256, 277–280, 297, 362, 365, 402, 420–421, 458, 1109, 1131–1137, 1173, 1191, 1196, 1214, 1338, 1375
   __main__.py440%3–8
   config.py48785%50, 52–55, 65, 76
TOTAL193517991% 

Tests Skipped Failures Errors Time
101 0 💤 0 ❌ 0 🔥 51.778s ⏱️

@Teagan42 Teagan42 merged commit 9d786a1 into main Oct 5, 2025
4 checks passed
@Teagan42 Teagan42 deleted the codex/rename-upsert-task-to-storage-task branch October 5, 2025 15:16
Teagan42 added a commit that referenced this pull request Oct 5, 2025
Teagan42 added a commit that referenced this pull request Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants