Skip to content

test(maas): switch from MaaSModel to MaaSModelRef as per dev changes#1183

Merged
dbasunag merged 5 commits intoopendatahub-io:mainfrom
SB159:feature/maas-model-ref-update
Mar 9, 2026
Merged

test(maas): switch from MaaSModel to MaaSModelRef as per dev changes#1183
dbasunag merged 5 commits intoopendatahub-io:mainfrom
SB159:feature/maas-model-ref-update

Conversation

@SB159
Copy link
Copy Markdown
Contributor

@SB159 SB159 commented Mar 6, 2026

Pull Request

Summary

Updated MaaS tests to use MaaSModelRef instead of MaaSModel as per latest dev changes.

Related Issues

  • Fixes:
  • JIRA:

How it has been tested

  • Locally
  • Jenkins

Additional Requirements

  • If this PR introduces a new test image, did you create a PR to mirror it in disconnected environment?
  • If this PR introduces new marker(s)/adds a new component, was relevant ticket created to update relevant Jenkins job?

Summary by CodeRabbit

  • Refactor
    • Updated internal model reference handling to use a more streamlined resource type, eliminating deprecated model wrapper implementation and updating all related test infrastructure accordingly.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

The following are automatically added/executed:

  • PR size label.
  • Run pre-commit
  • Run tox
  • Add PR author as the PR assignee
  • Build image based on the PR

Available user actions:

  • To mark a PR as WIP, add /wip in a comment. To remove it from the PR comment /wip cancel to the PR.
  • To block merging of a PR, add /hold in a comment. To un-block merging of PR comment /hold cancel.
  • To mark a PR as approved, add /lgtm in a comment. To remove, add /lgtm cancel.
    lgtm label removed on each new commit push.
  • To mark PR as verified comment /verified to the PR, to un-verify comment /verified cancel to the PR.
    verified label removed on each new commit push.
  • To Cherry-pick a merged PR /cherry-pick <target_branch_name> to the PR. If <target_branch_name> is valid,
    and the current PR is merged, a cherry-picked PR would be created and linked to the current PR.
  • To build and push image to quay, add /build-push-pr-image in a comment. This would create an image with tag
    pr-<pr_number> to quay repository. This image tag, however would be deleted on PR merge or close action.
Supported labels

{'/build-push-pr-image', '/lgtm', '/cherry-pick', '/verified', '/hold', '/wip'}

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: f752b4aa-6864-4621-89d6-6edc79099fb0

📥 Commits

Reviewing files that changed from the base of the PR and between 7fc9d7f and cf99db0.

📒 Files selected for processing (2)
  • tests/model_serving/model_server/maas_billing/maas_subscription/conftest.py
  • utilities/resources/maa_s_model.py
💤 Files with no reviewable changes (1)
  • utilities/resources/maa_s_model.py

📝 Walkthrough

Walkthrough

This refactoring removes the MaaSModel resource class and migrates test fixtures to use MaaSModelRef from ocp_resources instead. Type annotations are updated accordingly across fixture parameters and return types, shifting the API resource representation from a utilities module to an external resources module.

Changes

Cohort / File(s) Summary
Test fixture migration
tests/model_serving/model_server/maas_billing/maas_subscription/conftest.py
Updated fixture return types and parameters from MaaSModel to MaaSModelRef. Import source changed to ocp_resources.maas_model_ref. Constructor calls replaced with MaaSModelRef(...) including new model_ref field initialization.
Resource class deletion
utilities/resources/maa_s_model.py
Removed MaaSModel(NamespacedResource) class entirely, including api_group attribute set to ApiGroups.MAAS_IO, __init__ method with model_ref parameter, and to_dict() method that populated spec with nested "modelRef" structure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Critical items requiring verification:

  • Confirm MaaSModelRef from ocp_resources handles the spec generation logic previously in MaaSModel.to_dict() (modelRef nesting in spec)—deletion of this validation and population logic requires tracing where this responsibility now resides
  • Verify no other codebase references remain to the deleted MaaSModel class outside this diff
  • Validate MaaSModelRef constructor accepts model_ref parameter and behaves equivalently to the removed class
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: migrating test code from MaaSModel to MaaSModelRef in alignment with upstream development changes.
Description check ✅ Passed The description includes a summary explaining the change and follows the template structure. However, testing checklist items are unchecked and no related issues/JIRA references are provided.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread utilities/resources/maa_s_model.py
@SB159 SB159 force-pushed the feature/maas-model-ref-update branch from 7fc9d7f to 4750812 Compare March 9, 2026 18:30
@github-actions github-actions bot added size/m and removed size/s labels Mar 9, 2026
@SB159 SB159 requested a review from dbasunag March 9, 2026 18:56
@dbasunag dbasunag enabled auto-merge (squash) March 9, 2026 19:24
@dbasunag dbasunag disabled auto-merge March 9, 2026 19:39
@dbasunag
Copy link
Copy Markdown
Collaborator

dbasunag commented Mar 9, 2026

Merging based on conversation with @SB159

@dbasunag dbasunag merged commit 12ded46 into opendatahub-io:main Mar 9, 2026
8 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2026

Status of building tag latest: success.
Status of pushing tag latest to image registry: success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants