[iris] Introduce stores layer between transitions.py and db.py#5147
[iris] Introduce stores layer between transitions.py and db.py#5147
Conversation
|
Claude finished @rjpower's task in 1m 15s —— View job Code reviewChecked for bugs and CLAUDE.md / AGENTS.md compliance across all 18 modified files. Ran four parallel reviewers (2x AGENTS.md compliance, 2x bug/logic) and validated each candidate issue against the diff and repo state. Findings (1 issue):
Intentionally not flagged (false positives / deliberate design):
No bugs, no broken call sites, no misrouted store/db access. The refactor wires cleanly: every
|
| # Escape hatch kept only while the phased migration moves SQL out of | ||
| # this file. Direct ``self._db`` SQL calls should decrease every phase | ||
| # and hit zero at the end (see plans/i-want-to-introduce-prancy-swing.md). |
There was a problem hiding this comment.
The referenced plan file plans/i-want-to-introduce-prancy-swing.md does not exist in the repository (the canonical plan location is .agents/projects/, not plans/). Per AGENTS.md: "Delete stale comments immediately on discovery." Either add the plan doc or drop the reference.
| # Escape hatch kept only while the phased migration moves SQL out of | |
| # this file. Direct ``self._db`` SQL calls should decrease every phase | |
| # and hit zero at the end (see plans/i-want-to-introduce-prancy-swing.md). | |
| # Escape hatch kept only while the phased migration moves SQL out of | |
| # this file. Direct ``self._db`` SQL calls should decrease every phase | |
| # and hit zero at the end. |
d085f0c to
cb895dc
Compare
cb895dc to
2525406
Compare
Phase 1 of the transitions -> stores -> db refactor: add ControllerStore bundling typed per-entity stores and fold EndpointRegistry into EndpointStore. Remaining stores (Job, Task, TaskAttempt, Worker, DispatchQueue, Reservation) are skeletons to be filled in subsequent phases.
Phase 2 of the stores refactor. Moves the ~26 jobs/job_config/users/user_budgets queries out of transitions.py into JobStore. Adds fetchall/fetchone on TransactionCursor so read methods accept either a write cursor or a read snapshot uniformly. Renames the endpoint registry test file to match the new store name.
2525406 to
bcd7edc
Compare
yonromai
left a comment
There was a problem hiding this comment.
🤖 Code review
Approved. No issues found in the current head. Checked for bugs and AGENTS.md compliance.
Validation:
cd lib/iris && uv run --group dev python -m pytest -n1 --tb=short -m 'not slow and not docker and not e2e' tests/cluster/controller/test_endpoint_store.py tests/cluster/controller/test_transitions.py tests/cluster/controller/test_service.py tests/cluster/controller/test_dashboard.py tests/cluster/controller/test_api_keys.py tests/cluster/controller/test_auth.py tests/cluster/controller/test_task_resource_history.py tests/test_budget.py- Result:
347 passed, 6 warnings in 63.32s uv run --package marin --group test python -m pytest -q tests/integration/iris/test_iris_kind.py::test_gpu_pod_attributes_with_in_memory_k8s- Result:
1 passed, 1 warning in 0.69s
Generated with Codex.
Phase 1 of the transitions -> stores -> db refactor: add ControllerStore bundling typed per-entity stores, and fold EndpointRegistry into EndpointStore. Remaining stores (Job, Task, TaskAttempt, Worker, DispatchQueue, Reservation) are skeletons to be filled in subsequent phases. ControllerTransitions now takes store= and routes endpoint ops through it; transitions.py retains a temporary self._db escape hatch for unmigrated queries.