POC: move one test to HCO API v1#4695
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughFive pytest fixtures in ChangesParameterized Fixture Architecture with HCO v1 Spec Fields
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Review rate limit: 0/1 reviews remaining, refill in 34 minutes and 43 seconds.Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4695 +/- ##
==========================================
+ Coverage 98.63% 98.67% +0.03%
==========================================
Files 25 25
Lines 2420 2491 +71
==========================================
+ Hits 2387 2458 +71
Misses 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Prepare utilities for the transition to the HCO V1 API by adding an api_version parameter to get_hyperconverged_resource and defining HCOV1SpecFields constants for the new spec structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Nahshon Unna Tsameret <nunnatsa@redhat.com>
|
Clean rebase detected — no code changes compared to previous head ( |
|
Clean rebase detected — no code changes compared to previous head ( |
There was a problem hiding this comment.
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 `@tests/conftest.py`:
- Around line 1168-1202: Each hyperconverged_resource fixture
(hyperconverged_resource_scope_function, hyperconverged_resource_scope_class,
hyperconverged_resource_scope_module, hyperconverged_resource_scope_package,
hyperconverged_resource_scope_session) should stop splatting request.param;
instead explicitly extract supported keys (at minimum api_version =
getattr(request, "param", {}).get("api_version")) and pass only those named
arguments to get_hyperconverged_resource(client=admin_client,
hco_ns_name=hco_namespace.name, api_version=api_version) (and add any other
allowed params explicitly), leaving out unknown keys so typos or unexpected
params don’t get forwarded.
In `@utilities/infra.py`:
- Around line 610-617: add explicit type annotations to
get_hyperconverged_resource: annotate parameters (client: Any, hco_ns_name: str,
*, api_version: HyperConverged.ApiVersion = HyperConverged.ApiVersion.V1BETA1)
and the return type as HyperConverged; import Any from typing and make
api_version a keyword-only parameter by adding a leading * in the signature;
ensure the function body remains the same but update the signature to def
get_hyperconverged_resource(client: Any, hco_ns_name: str, *, api_version:
HyperConverged.ApiVersion = HyperConverged.ApiVersion.V1BETA1) -> HyperConverged
so mypy can validate callers and the new public argument.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 73247a6f-624f-4f60-9a80-97aa58d4d53a
📒 Files selected for processing (4)
tests/conftest.pytests/install_upgrade_operators/crypto_policy/test_hco_custom_profile_negative.pyutilities/constants.pyutilities/infra.py
Forward indirect parametrize kwargs from fixtures to get_hyperconverged_resource, enabling tests to select the API version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Nahshon Unna Tsameret <nunnatsa@redhat.com>
HCO is transitioning from v1beta1 to v1 API. The v1 API introduces a restructured spec where fields are grouped under domain-specific sections (e.g. security, virtualization, networking). This commit is a proof of concept for the migration, applying the v1 API to a single test. It switches test_set_hco_crypto_failed_without_required_cipher to use the V1 API version via indirect fixture parametrization and updates the TLS spec structure to nest tlsSecurityProfile under the new HCOV1SpecFields.SECURITY field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Nahshon Unna Tsameret <nunnatsa@redhat.com>
Short description:
HCO is transitioning from v1beta1 to v1 API. The v1 API introduces a restructured spec where fields are grouped under domain-specific sections (e.g. security, virtualization, networking).
This PR is a proof of concept for the migration, applying the v1 API to a single test. It switches
test_set_hco_crypto_failed_without_required_cipher to use the V1 API version
field.
More details:
This PR also added some preparations for moving to HCO v1 API:
api_versionparameter to theget_hyperconverged_resourcefunctionHCOV1SpecFieldsconstants for the newspecstructureget_hyperconverged_resource, enabling tests to select the API versionWhich issue(s) this PR fixes:
POC for the implementation of https://redhat.atlassian.net/browse/CNV-86253
jira-ticket:
https://redhat.atlassian.net/browse/CNV-86253
Summary by CodeRabbit
Tests
Improvements