← Back to Pull requests

RHOAIENG-79900: Verify model-serving has zero internal imports from internal and model-registry #9532

Closed
unknown closed this pull request without merging on Sep 02, 2026 16:58 UTC
View on GitHub
unknown unknown commented on Aug 31, 2026 10:31 UTC
Author

<!--- If this is a non-code change, this template is not required; reference any issues or top-level descriptions as needed -->
<!--- All code change PRs should relate to an issue, reference it here; see example below -->
<!--- https://issues.redhat.com/browse/RHOAIENG-123456 -->

Description


Eliminates all 56 @odh-dashboard/internal imports (28 files) and 5 @odh-dashboard/model-registry imports (5 files) from packages/model-serving/, moving each symbol to its architecturally correct shared package per docs/package-topology.md. No duplication — code is moved, not copied. All consumers across the monorepo are
updated.

### Moved items

#### To @odh-dashboard/k8s-core (K8s types, models, CRUD, stateless logic)

| Category | Items | Export path |
|----------|-------|-------------|
| K8s models | SecretModel, ServiceAccountModel, RoleModel, RoleBindingModel, ConfigMapModel, ClusterQueueModel, LocalQueueModel, WorkloadModel | ./api/models |
| Secrets API | assembleSecretSA, createSecret, getSecret, deleteSecret, replaceSecret, getSecretsByLabel | ./api/secrets |
| ServiceAccounts API | assembleServiceAccount, getServiceAccount, createServiceAccount | ./api/serviceAccounts |
| Roles API | getRole, createRole | ./api/roles |
| RoleBindings API | generateRoleBindingServiceAccount, getRoleBinding, createRoleBinding | ./api/roleBindings |
| ConfigMaps API | getConfigMap | ./api/configMaps |
| LocalQueues API | listLocalQueues | ./api/localQueues |
| ClusterQueues API | getClusterQueue, listClusterQueues | ./api/clusterQueues |
| Workloads API | listWorkloads | ./api/workloads |
| K8s utilities | addOwnerReference | ./api/k8sUtils |
| Error utilities | getGenericErrorCode | ./api/errorUtils |
| Type | ServiceAccountKind | ./index (barrel) |
| Kueue types | KueueWorkloadStatus, KueueWorkloadStatusWithMessage, KUEUE_STATUSES_ constants | ./kueue/types |
| Kueue status logic | getKueueWorkloadStatusWithMessage, aggregateKueueStatusForModel, KUEUE_QUEUE_LABEL, GenericConditionStatus | ./kueue/workloadStatus |
| Kueue messages | getDeploymentKueueSubStepMessage, isInadmissibleQuotaCondition, full messageUtils | ./kueue/messageUtils |

#### To @odh-dashboard/ui-core (React components, hooks, UI utilities)

| Category | Items | Export path |
|----------|-------|-------------|
| Kueue UI types | KueueStatusInfo | ./kueue/types |
| Kueue UI functions | getKueueStatusInfo, getKueueConditionStatus, getKueueSchedulingSubStep | ./kueue/statusInfo |
| Components | conditionalArea + AreaComponent | ./components/conditionalArea |
| Components | MultiSelection | ./components/MultiSelection |
| Components | UnderlinedTruncateButton | ./components/UnderlinedTruncateButton |
| Hooks | useRefreshInterval | ./hooks/useRefreshInterval |
| Hooks | useMakeFetchObject | ./hooks/useMakeFetchObject |
| Hooks | useAssignedFlavor | ./hooks/useAssignedFlavor |
| Hooks | useClusterQueue | ./hooks/useClusterQueue |
| Utilities | getAllConsumedResources, getAssignedFlavorFromWorkload | ./utilities/clusterQueueUtils |
| Types | PendingContextResourceData | ./types/prometheus |

#### To @odh-dashboard/model-serving (feature-specific)

| Category | Items | Export path |
|----------|-------|-------------|
| Extension-point types | DeployPrefillData, ModelDeployPrefillInfo, RegisteredModelRef | ./extension-points/deploy-prefill |
| Component | ProjectSelector (legacy model-serving variant) | ./modelRegistry/ProjectSelector |
| Mock data | mockValidatedConfigurations, mockPrometheusQueryResponse | ./__mocks__/
|
| Axios instance | Local axios.create() for prometheus queries | ./src/api/prometheus/axios.ts (internal) |

### Additional changes

- Deploy prefill types ownership reversed: Types previously exported from model-registry/shared now live in model-serving/extension-points/deploy-prefill. model-registry imports them from model-serving (type-only, per topology Rule 2). The model-registry/shared/ directory and export path are removed.
- @odh-dashboard/plugin-core added as peer + dev dependency of ui-core (for conditionalArea's useIsAreaAvailable import).
- axios added to k8s-core (for getGenericErrorCode's AxiosError check), ui-core (for PendingContextResourceData type), and model-serving (for local axios instance).
- Cypress test files (8 model-training tests) updated to import kueue models from @odh-dashboard/k8s-core/api/models.
- 16 files across 6 packages (nim-serving, autorag, automl, llmd-serving, kserve, agent-ops) updated for getGenericErrorCode import path change.
- 5 feature-store + 2 maas files updated for MultiSelection and conditionalArea imports.

### Dependency graph changes

model-serving
├── @odh-dashboard/internal ← REMOVED
├── @odh-dashboard/model-registry ← REMOVED
└── axios ← ADDED

model-registry
└── @odh-dashboard/model-serving ← ADDED (type-only)

ui-core
├── @odh-dashboard/plugin-core ← ADDED (peer + dev)
└── axios ← ADDED

k8s-core
└── axios ← ADDED

## How Has This Been Tested?

- npm run type-check — passes across all packages
- npm run build — passes across all packages
- npm run test — unit tests pass for model-serving, kserve, nim-serving, llmd-serving, frontend, and all other affected packages
- npm run lint — passes (no new warnings beyond pre-existing baseline)
- Verified zero @odh-dashboard/internal imports remain in packages/model-serving/ (src, cypress, extension-points, modelRegistry)
- Verified zero @odh-dashboard/model-registry imports remain in packages/model-serving/
- Verified no circular dependencies introduced

## Test Impact

No new tests added. This is a pure move refactor — existing unit tests continue to cover all moved items. Only import paths and jest.mock()/require() targets were updated in test files:
- auth.spec.ts: 6 jest.mock() + 5 require() paths updated to @odh-dashboard/k8s-core/api/
- 4 test files: mock data imports updated to @odh-dashboard/model-serving/__mocks__/

- 2 test files: KueueWorkloadStatus imports updated to @odh-dashboard/k8s-core/kueue/types
- 1 cypress test: STOP_MODAL_PREFERENCE_KEY import updated to @odh-dashboard/model-serving/concepts/useStopModalPreference

Request review criteria:


<!--- This PR will be merged by any repository approver when it meets all the points in the checklist -->
<!--- Go over all the following points, and put an x in all the boxes that apply. -->

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work

  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).

  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

  • The code follows our [Best Practices](/docs/best-practices.md) (React coding standards, PatternFly usage, performance considerations)
  • If you have UI changes:
    <!--- You can ignore these if you are doing manifest, backend, internal logic, etc changes; aka non-UI / visual changes -->

  • Included any necessary screenshots or gifs if it was a UI change.

  • Included tags to the UX team if it was a UI/UX change.
  • After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: paulovmr Review duration: 3267m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #9532"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%