Skip to content

refactor(BA-6629): stop models importing the registry and views layers#12436

Merged
fregataa merged 1 commit into
mainfrom
refactor/BA-6629-models-leaf
Jun 29, 2026
Merged

refactor(BA-6629): stop models importing the registry and views layers#12436
fregataa merged 1 commit into
mainfrom
refactor/BA-6629-models-leaf

Conversation

@fregataa

@fregataa fregataa commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • 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; callers use self._check_inference_scaling_group(...).
  • replica_group/row.py: drop the to_*_scheduling_view methods (which imported manager.views); the row → view projection now lives as the private methods _to_*_scheduling_view on ReplicaGroupDBSource.

Notes

  • The models/image/row.py -> container_registry edge is split out to a separate sub-issue (not in this PR).

Test plan

  • CI: pants check (mypy) — moved method/function signatures resolve
  • CI: pants test — model_serving scaling-group check and replica_group scheduling-view projection behave unchanged

Resolves BA-6629

@github-actions github-actions Bot added size:L 100~500 LoC comp:manager Related to Manager component labels Jun 26, 2026
fregataa added a commit that referenced this pull request Jun 26, 2026
@fregataa fregataa marked this pull request as ready for review June 26, 2026 08:56
@fregataa fregataa requested a review from a team as a code owner June 26, 2026 08:56
@fregataa fregataa force-pushed the refactor/BA-6629-models-leaf branch from 2eb5302 to b868e8c Compare June 26, 2026 11:24
@fregataa fregataa marked this pull request as draft June 29, 2026 03:13
…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>
@fregataa fregataa force-pushed the refactor/BA-6629-models-leaf branch from b868e8c to fde80bc Compare June 29, 2026 04:46
@fregataa fregataa marked this pull request as ready for review June 29, 2026 04:48
@fregataa fregataa merged commit 80e22ed into main Jun 29, 2026
36 checks passed
@fregataa fregataa deleted the refactor/BA-6629-models-leaf branch June 29, 2026 04:56
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants