Extract test configuration crud module - #2599
Merged
Merged
Conversation
Continues the incremental split of the crud monolith. TestConfiguration moves to its own module; callers switch to direct submodule imports. Pure move -- no logic changes.
akwasigroch
force-pushed
the
refactor/extract-test-configuration-crud
branch
from
August 25, 2026 15:09
87fbe8e to
58d73d9
Compare
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 the TestConfiguration block out.What Changed
crud/test_configuration.pywithget_test_configuration,get_test_configurations,create_test_configurationandupdate_test_configuration, 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 test_configuration as test_configuration_crud):routers/test_configuration.py,services/test_run.py,services/test_set.py,jobs/execution/config.pyandjobs/execution/modes.py. Inservices/test_set.pythe call sites sit inside function-local imports, so those were adjusted in place rather than at the module header.tests/backend/services/test_rescore.pyandtests/backend/routes/test_execute_dispatch_task_id.py.This is a pure move: no logic, signature or behaviour changes. Import direction stays jobs → app.
Additional Context
Two pre-existing problems surfaced while tracing callers. Neither is touched here, both are worth a separate fix:
routers/test_configuration.py:176callscrud.delete_test_configuration, which does not exist anywhere in the codebase — that DELETE endpoint raisesAttributeErrorat runtime. The router keeps itsfrom rhesis.backend.app import crudimport solely for that broken line.jobs/execution/modes.py:93reaches a schema through the crud module ascrud.schemas.TestConfigurationUpdateinstead of importingschemasdirectly.Two sibling PRs split other blocks of the same file in parallel. They touch different line ranges and different callers.
Testing
uv run pytest tests/backend/services/test_rescore.py tests/backend/routes/test_execute_dispatch_task_id.py tests/backend/routes/test_execute_with_reuse.py tests/backend/jobs/test_execution.py tests/backend/services/test_test_set.py tests/backend/services/test_test_execution.py→ 85 passed, 3 skipped (pre-existing skips).uv run pytest tests/backend/routes/test_quota_gates.py tests/backend/security/test_organization_filtering.py tests/backend/auth/test_object_level_auth.py tests/backend/jobs/test_validation.py tests/backend/jobs/test_filter_configs_by_scope.py→ 68 passed.Ruff check and format on all touched files are at the pre-change baseline.