Skip to content

feat: Add MaaSModelRef resource#2663

Open
SB159 wants to merge 3 commits intoRedHatQE:mainfrom
SB159:feature/resoucre1
Open

feat: Add MaaSModelRef resource#2663
SB159 wants to merge 3 commits intoRedHatQE:mainfrom
SB159:feature/resoucre1

Conversation

@SB159
Copy link
Contributor

@SB159 SB159 commented Mar 4, 2026

Short description:
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
Bug:

Summary by CodeRabbit

  • Refactor
    • Renamed internal model reference identifiers to improve API naming consistency.
    • Updated related documentation strings and references so API surface reads consistently for integrators and tooling.

@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 83b0b8d5-93ee-409a-ab0b-f64dc04a05ac

📥 Commits

Reviewing files that changed from the base of the PR and between dc17ed6 and 6cae588.

⛔ Files ignored due to path filters (2)
  • class_generator/schema/__resources-mappings.json.gz is excluded by !**/*.gz, !class_generator/schema/**
  • class_generator/schema/_definitions.json is excluded by !class_generator/schema/**
📒 Files selected for processing (1)
  • ocp_resources/maas_model_ref.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • ocp_resources/maas_model_ref.py

Walkthrough

A public class in ocp_resources/maas_model_ref.py was renamed from MaaSModel to MaaSModelRef, and the module docstring was updated to reference the new class/API schema name. No base class or API group changes were made.

Changes

Cohort / File(s) Summary
Class Rename
ocp_resources/maas_model_ref.py
Renamed public class MaaSModelMaaSModelRef; updated module/docstring to reference MaaSModelRef. (Lines changed: +2/-2)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only empty template sections with no actual content filled in. Fill in the required sections with relevant information about the changes, rationale, related issues, and any special reviewer notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding the MaaSModelRef resource class to the codebase.

✏️ 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.

@redhat-qe-bot
Copy link
Contributor

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: Disabled for this repository
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: All label categories are enabled (default configuration)

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest python-module-install - Test Python package installation
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. Status Checks: All required status checks must pass
  3. No Blockers: No wip, hold, has-conflicts labels and PR must be mergeable (no conflicts)
  4. Verified: PR must be marked as verified

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@myakove
Copy link
Collaborator

myakove commented Mar 5, 2026

@SB159
once #2665 is merged you can regenerate your resource and it will get the right name

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
ocp_resources/utils/utils.py (1)

91-96: LGTM! Clean approach for acronym normalization.

The normalization dictionary is a maintainable solution for handling mixed-case acronyms. The inline comment clearly explains the rationale.

Consider adding an example to the docstring (around lines 70-77) to document this behavior:

>>> convert_camel_case_to_snake_case("MaaSModelRef")
'maas_model_ref'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ocp_resources/utils/utils.py` around lines 91 - 96, Add a short
doctest/example to the convert_camel_case_to_snake_case function's docstring
demonstrating the acronym normalization behavior (e.g., showing "MaaSModelRef"
-> "maas_model_ref"); update the docstring near lines ~70-77 to include a
one-line example and expected output so maintainers see how normalize_acronyms
(and the replacement logic that maps "MaaS" to "Maas") affects results.
tests/test_camelcase_to_snake.py (1)

35-49: LGTM! Good test coverage for MaaS acronym normalization.

The new test cases properly validate the expected snake_case conversion for mixed-case acronyms. The test IDs are descriptive and follow the existing naming pattern.

Consider adding edge cases for broader coverage:

  • "MaaS" alone → "maas" (standalone acronym)
  • Acronym followed by another acronym (if applicable in your domain)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_camelcase_to_snake.py` around lines 35 - 49, Add two additional
pytest.param cases to tests/test_camelcase_to_snake.py: one for the standalone
acronym "MaaS" expecting "maas" (id="standalone_acronym_maas"), and one for an
acronym followed immediately by another acronym (e.g., "MaaSAPI" expecting
"maas_api" with id="acronym_followed_by_acronym_maas_api" or a
domain-appropriate pair like "MaaSID"->"maas_id"); place them alongside the
existing MaaS cases so the test matrix covers the standalone and acronym+acronym
edge cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ocp_resources/utils/utils.py`:
- Around line 91-96: Add a short doctest/example to the
convert_camel_case_to_snake_case function's docstring demonstrating the acronym
normalization behavior (e.g., showing "MaaSModelRef" -> "maas_model_ref");
update the docstring near lines ~70-77 to include a one-line example and
expected output so maintainers see how normalize_acronyms (and the replacement
logic that maps "MaaS" to "Maas") affects results.

In `@tests/test_camelcase_to_snake.py`:
- Around line 35-49: Add two additional pytest.param cases to
tests/test_camelcase_to_snake.py: one for the standalone acronym "MaaS"
expecting "maas" (id="standalone_acronym_maas"), and one for an acronym followed
immediately by another acronym (e.g., "MaaSAPI" expecting "maas_api" with
id="acronym_followed_by_acronym_maas_api" or a domain-appropriate pair like
"MaaSID"->"maas_id"); place them alongside the existing MaaS cases so the test
matrix covers the standalone and acronym+acronym edge cases.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0cb2d479-4b08-4ef0-bb56-6b82e3f1fa19

📥 Commits

Reviewing files that changed from the base of the PR and between 2b12b92 and 26f50de.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • class_generator/core/generator.py
  • ocp_resources/maas_model_ref.py
  • ocp_resources/utils/utils.py
  • pyproject.toml
  • tests/test_camelcase_to_snake.py
✅ Files skipped from review due to trivial changes (1)
  • pyproject.toml

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.

6 participants