refactor(BA-6629): stop models importing the registry and views layers#12436
Open
fregataa wants to merge 1 commit into
Open
refactor(BA-6629): stop models importing the registry and views layers#12436fregataa wants to merge 1 commit into
fregataa wants to merge 1 commit into
Conversation
fregataa
added a commit
that referenced
this pull request
Jun 26, 2026
Remove two models -> upper-layer import edges so editing these model files no longer fans out into the broader manager test/typecheck scope. - endpoint/row.py: move ModelServiceHelper.check_scaling_group (which imported manager.registry) into ModelServingRepository as the private method _check_inference_scaling_group; the model_serving test patches that method instead of the removed helper. - replica_group/row.py: drop the to_*_scheduling_view methods (which imported manager.views); the row -> view projection now lives as the standalone private functions _to_*_scheduling_view in the replica_group db_source module, covered by a dedicated unit test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2eb5302 to
b868e8c
Compare
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.
Summary
models/* -> upper-layerimport edges so editing these model files no longer fans out into the broader manager test/typecheck scope.endpoint/row.py: moveModelServiceHelper.check_scaling_group(which importedmanager.registry) intoModelServingRepositoryas the private method_check_inference_scaling_group; callers useself._check_inference_scaling_group(...).replica_group/row.py: drop theto_*_scheduling_viewmethods (which importedmanager.views); the row → view projection now lives as the private methods_to_*_scheduling_viewonReplicaGroupDBSource.Notes
models/image/row.py -> container_registryedge is split out to a separate sub-issue (not in this PR).Test plan
pants check(mypy) — moved method/function signatures resolvepants test— model_serving scaling-group check and replica_group scheduling-view projection behave unchangedResolves BA-6629