refactor(BA-6629): stop models importing the registry and views layers#12436
Merged
Conversation
fregataa
added a commit
that referenced
this pull request
Jun 26, 2026
2eb5302 to
b868e8c
Compare
…y layer Remove a models -> registry import edge so editing the endpoint model file 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. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b868e8c to
fde80bc
Compare
jopemachine
approved these changes
Jun 29, 2026
fregataa
added a commit
that referenced
this pull request
Jun 29, 2026
These tests instantiate ORM rows (DomainFairShareRow, ...) and call to_data(). Since #12436 stopped models importing the registry/views layers, the relationship targets (ScalingGroupForDomainRow, ...) are no longer transitively registered, so SQLAlchemy mapper configuration failed when constructing the rows. Add a conftest with a with_tables fixture that imports the related rows in FK order (plus a python_test_utils target to own it), and have the tests request it so the mappers are configured before row construction. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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