Extract experiment crud module - #2601
Merged
Merged
Conversation
Continues the incremental split of the crud monolith. Experiment moves to its own module; the router switches to a direct submodule import. 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 (#2588, #2590, #2591, #2592, #2597, #2599, #2600), taking out the smallest remaining block.What Changed
crud/experiment.pywithget_experiments, moved verbatim fromcrud/__init__.py, importing only what it needs.crud/__init__.py. No re-export left behind — the old name is gone from the monolith.routers/experiments.pyswitched tofrom rhesis.backend.app.crud import experiment as experiment_crud. It keeps itsfrom rhesis.backend.app import crudimport because line 231 still usescrud.delete_item.This is a pure move: no logic, signature or behaviour changes.
Additional Context
_*_RELATED_FIELDSconstant — theinclude(...)calls are inline in the query, so nothing else moved with it.get_experimentsfound exactly two hits: the definition and the single router call. No direct-name imports, no function-local imports, and nomock.patchstring targets pointing at it.get_test_sets_for_test,get_test_set_tests,resolve_test_setandbulk_delete_testsstraddle both entities.Testing
Full backend suite from
apps/backend:uv run pytest ../../tests/backend/→ 7802 passed, 62 skipped, 1 xfailed in 5m23s.Targeted:
tests/backend/routes/test_experiments.py→ 63 passed;tests/backend/services/test_experiment_service.py→ 7 passed.Ruff check and format clean on all three touched files.