Skip to content

feat: add maas_auth_policy and maas_subscription resources and deprecate old.#2670

Open
SB159 wants to merge 1 commit intoRedHatQE:mainfrom
SB159:feature/update-maas-authpolicy-wrapper
Open

feat: add maas_auth_policy and maas_subscription resources and deprecate old.#2670
SB159 wants to merge 1 commit intoRedHatQE:mainfrom
SB159:feature/update-maas-authpolicy-wrapper

Conversation

@SB159
Copy link
Contributor

@SB159 SB159 commented Mar 6, 2026

…ate old

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

  • New Features

    • Added MaaSAuthPolicy resource class to manage authentication policies in MAAS OpenDataHub with support for metering metadata and model references.
    • Added MaaSSubscription resource class to manage MAAS subscriptions with configurable owner, priority, and token metadata.
  • Deprecations

    • Deprecated legacy MaaS API resource implementations; users should migrate to the new MaaSAuthPolicy and MaaSSubscription resource classes.

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Walkthrough

This PR introduces two new MAAS OpenDataHub resource classes (MaaSAuthPolicy and MaaSSubscription) while deprecating previously-named versions with different capitalization. The old underscored versions now emit deprecation warnings on import directing users to the new camelCase equivalents.

Changes

Cohort / File(s) Summary
Deprecation Warnings
ocp_resources/maa_s_auth_policy.py, ocp_resources/maa_s_subscription.py
Added module-level deprecation warnings notifying users to migrate from these underscored versions to the newly introduced camelCase resource classes.
New Resource Classes
ocp_resources/maas_auth_policy.py, ocp_resources/maas_subscription.py
Introduced NamespacedResource-based classes for MAAS OpenDataHub API with init methods accepting resource configuration parameters and to_dict methods that validate required arguments and construct spec dictionaries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is incomplete. All required template sections are present but contain no substantive content beyond the title. Fill in all template sections with details about the changes, motivation, related issues, and any special review notes or concerns.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% 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 pull request title clearly summarizes the main changes: adding new MaaSAuthPolicy and MaaSSubscription resource classes while deprecating their old counterparts.

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

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ocp_resources/maa_s_auth_policy.py`:
- Around line 5-15: The deprecation warn call for MaaSAuthPolicy is inside a
generated module and must be moved out; remove the warn(...) block from this
generated file (maa_s_auth_policy.py) and place it into a non-generated
compatibility wrapper (e.g., a small hand-maintained module that imports
MaaSAuthPolicy from maas_auth_policy.py and emits the DeprecationWarning) or add
the warning into the code generator output so it persists across regenerations;
ensure the wrapper imports the class symbol MaaSAuthPolicy from
maas_auth_policy.py and emits the same DeprecationWarning with stacklevel=2,
leaving the generated NamespacedResource/exception imports untouched.

In `@ocp_resources/maa_s_subscription.py`:
- Around line 5-15: The deprecation warning shim was added inside the generated
module maa_s_subscription.py and must be removed from generated code; instead
update the generator/template to emit the deprecation or create a small
handwritten compatibility module (e.g., a new maa_s_subscription shim module)
that imports the real MaaSSubscription from maas_subscription.py and issues the
warn(…, DeprecationWarning, stacklevel=2) before re-exporting the symbol. Remove
the warn(...) block from the generated file and ensure the compatibility module
re-exports the same public symbol(s) so callers continue to work while keeping
generated code untouched.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ba693b7c-9c74-4bf4-925a-9dc90e24f18f

📥 Commits

Reviewing files that changed from the base of the PR and between 4f30885 and cb0b5b4.

⛔ Files ignored due to path filters (1)
  • class_generator/schema/__resources-mappings.json.gz is excluded by !**/*.gz, !class_generator/schema/**
📒 Files selected for processing (4)
  • ocp_resources/maa_s_auth_policy.py
  • ocp_resources/maa_s_subscription.py
  • ocp_resources/maas_auth_policy.py
  • ocp_resources/maas_subscription.py

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