Extract status, topic and category crud modules - #2597
Merged
Conversation
Continues the incremental split of the crud monolith. Status, Topic and Category each move to their own module; callers switch to direct submodule imports. Pure move -- no logic changes.
This was referenced Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
app/crud/__init__.pyis the crud monolith thatapps/backend/AGENTS.mdsays should only shrink from here. This continues the incremental split started in #2588, #2590, #2591 and #2592, taking three of the small self-contained blocks out.What Changed
crud/status.py,crud/topic.pyandcrud/category.py, each holding the five CRUD functions for its entity, moved verbatim fromcrud/__init__.py.crud/__init__.py. No re-exports left behind — the old names are gone from the monolith.from rhesis.backend.app.crud import status as status_crud):routers/status.py,routers/topic.py,routers/category.py, andservices/task_notification.py.tests/backend/security/test_organization_filtering.py.This is a pure move: no logic, signature or behaviour changes.
Additional Context
services/task_notification.pywas reached through a direct name import (from rhesis.backend.app.crud import get_status, get_type_lookup) rather than attribute access, so it does not show up in acrud.get_statusgrep. It keepsget_type_lookupon the monolith for now.task_notification.pyimport line.Testing
uv run pytest tests/backend/security/test_organization_filtering.py tests/backend/routes/test_status.py tests/backend/routes/test_topic.py tests/backend/routes/test_category.py→ 138 passed, 6 skipped (pre-existing skips).uv run pytest tests/backend/services/test_task_notification.py→ 4 passed.Ruff check and format on all touched files are at the pre-change baseline.