Skip to content

[IUO] use full API version (group/version) for HCO resource#3998

Open
hmeir wants to merge 1 commit intoRedHatQE:mainfrom
hmeir:fix-hco-api-version-v1beta1
Open

[IUO] use full API version (group/version) for HCO resource#3998
hmeir wants to merge 1 commit intoRedHatQE:mainfrom
hmeir:fix-hco-api-version-v1beta1

Conversation

@hmeir
Copy link
Contributor

@hmeir hmeir commented Feb 26, 2026

Short description:

Setting hco.api_version to just "v1beta1" instead of "hco.kubevirt.io/v1beta1" causes failures in ResourceEditor

More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
jira-ticket:

Summary by CodeRabbit

  • Bug Fixes
    • Fixed HyperConverged resource lookup to use correct API version formatting, ensuring proper resource identification and discovery during operations.

Setting hco.api_version to just "v1beta1" instead of
"hco.kubevirt.io/v1beta1" causes failures in ResourceEditor
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18e0f72 and fdda0e7.

📒 Files selected for processing (1)
  • utilities/infra.py

📝 Walkthrough

Walkthrough

The change modifies the HyperConverged resource lookup in utilities/infra.py to construct the API version string by combining an API group prefix with the version identifier, replacing direct version constant usage.

Changes

Cohort / File(s) Summary
API version configuration
utilities/infra.py
Modified HyperConverged resource lookup to set hco.api_version by concatenating hco.ApiGroup.HCO_KUBEVIRT_IO with hco.ApiVersion.V1BETA1 instead of using the version constant directly. Control flow and error handling unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. While the short description is present and relevant, critical sections like 'More details', 'What this PR does / why we need it', 'Which issue(s) this PR fixes', 'Special notes for reviewer', and 'jira-ticket' are empty. Fill in the remaining template sections: explain the technical rationale, describe what ResourceEditor failures were occurring, reference any related issues, and provide any relevant Jira ticket information.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 title clearly summarizes the main change: updating the HCO resource to use the full API version format (group/version) instead of just the version segment.

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

@openshift-virtualization-qe-bot-2
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: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • 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: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 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)
  • /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 build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

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. LGTM Count: Minimum 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • dshchedr
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • RoniKishner
  • dshchedr
  • geetikakay
  • rnetser
  • vsibirsk
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve

💡 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
  • Container Builds: Container images are automatically tagged with the PR number
  • 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.

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.60%. Comparing base (84584c3) to head (fdda0e7).
⚠️ Report is 49 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3998      +/-   ##
==========================================
+ Coverage   98.56%   98.60%   +0.04%     
==========================================
  Files          25       25              
  Lines        2297     2368      +71     
==========================================
+ Hits         2264     2335      +71     
  Misses         33       33              
Flag Coverage Δ
utilities 98.60% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

name=hco_name,
)
hco.api_version = hco.ApiVersion.V1BETA1
hco.api_version = f"{hco.ApiGroup.HCO_KUBEVIRT_IO}/{hco.ApiVersion.V1BETA1}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you share the errors? at the time i tried and did not see any

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

cailed on setup with "kubernetes.dynamic.exceptions.BadRequestError: 400
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Audit-Id': 'de36bd53-ec5a-485b-9a1e-8216ccd418ad', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'X-Kubernetes-Pf-Flowschema-Uid': 'c5b5aa81-2097-4133-ac9e-f487467646d0', 'X-Kubernetes-Pf-Prioritylevel-Uid': 'a61ff2c8-5ba3-4bbc-ac7f-1ff4218ddcab', 'Date': 'Sun, 01 Mar 2026 20:39:17 GMT', 'Content-Length': '218'})
HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the API version in the data (v1beta1) does not match the expected API version (hco.kubevirt.io/v1beta1)","reason":"BadRequest","code":400}\n'

Copy link
Collaborator

Choose a reason for hiding this comment

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

weird, thanks for the info
you can resolve

@rnetser
Copy link
Collaborator

rnetser commented Mar 3, 2026

/approve
/lgtm

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