refactor: update Kueue management state checks and messaging#52
Conversation
- Deregistered the Kueue OperatorInstalledCheck in command.go, with a note to re-enable it in a future release that supports the Unmanaged state. - Enhanced the ManagementStateCheck to validate that only the Removed state is supported for Kueue before upgrading to RHOAI 3.3.1, updating the remediation messages accordingly. - Renamed test functions to reflect the new logic regarding management states, ensuring clarity in test outcomes. - Updated the DataIntegrityCheck to focus on the Unmanaged state, aligning checks with the new management state requirements. This refactor improves clarity and correctness in Kueue management state validations, ensuring users are informed about the necessary migration steps for upgrades. Signed-off-by: Andy Stoneberg <astonebe@redhat.com>
📝 WalkthroughWalkthroughThis PR modifies Kueue management-state validation logic for RHOAI 3.x. Both Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Actionable Issues1. Breaking API Semantic Change Without Deprecation 2. Policy Inversion Requires Validation Across Integration Points 3. Error Handling Addition for Unexpected Management State 4. Deregistration Without Clear Sunset Path 5. Test Fixture Bulk Update Risk 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/lint/checks/components/kueue/kueue.go (1)
22-24: TODO for version parameterization is tracked.Hardcoded "3.3.1" in messages is acknowledged by the deferred TODO. Consider creating a follow-up issue to avoid stale version references in future releases.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/lint/checks/components/kueue/kueue.go` around lines 22 - 24, The two user-facing constants msgManagedProhibited and msgUnmanagedProhibited hardcode the version "3.3.1"; update them to reference a parameterized version instead (using ComponentRequest.TargetVersion or a helper that formats the target version) so messages reflect the actual target version at runtime; change the string construction so it inserts the target version value into the message text for both msgManagedProhibited and msgUnmanagedProhibited and ensure any callers of those constants use the runtime-formatted message rather than the static constants.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/lint/checks/components/kueue/kueue.go`:
- Around line 22-24: The two user-facing constants msgManagedProhibited and
msgUnmanagedProhibited hardcode the version "3.3.1"; update them to reference a
parameterized version instead (using ComponentRequest.TargetVersion or a helper
that formats the target version) so messages reflect the actual target version
at runtime; change the string construction so it inserts the target version
value into the message text for both msgManagedProhibited and
msgUnmanagedProhibited and ensure any callers of those constants use the
runtime-formatted message rather than the static constants.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: d351b4ad-f64e-48d1-8689-febff05feba5
📒 Files selected for processing (7)
pkg/lint/checks/components/kueue/kueue.gopkg/lint/checks/components/kueue/kueue_operator_installed.gopkg/lint/checks/components/kueue/kueue_test.gopkg/lint/checks/workloads/kueue/check.gopkg/lint/checks/workloads/kueue/check_test.gopkg/lint/checks/workloads/kueue/support.gopkg/lint/command.go
harshad16
left a comment
There was a problem hiding this comment.
/lgtm
Reading through the changes, as user i can understand that unmanaged and managed, managementState of kueue are prohibited and upgrade cant be performed.
👍
Description
This refactor improves clarity and correctness in Kueue management state validations, ensuring users are informed about the necessary migration steps for upgrades.
How Has This Been Tested?
Kueue Unmanaged
➜ odh-cli/ git:(feat/agressive-kueue-gating) $ ./bin/kubectl-odh lint --target-version 3.3 --verboseLook for
prohibitedseverity in outputℹ️ For
Unmanaged- we are still running both themanagementStatecheck as well as thedata-integritycheck for Kueue... as themanagementStateis a point-in-time strategy that will be relaxed in the future - while thedata-integritycheck will continue to be required... so I felt it necessary to still continue to run thedata-integritycheck in this caseTOP LEVEL BANNER / SUMMARY TABLE
VERBOSE OUTPUT TABLE
RESULT OUTPUT
Kueue Managed
https://console-openshift-console.apps.prod.rhoai.rh-aiservices-bu.com➜ odh-cli/ git:(feat/agressive-kueue-gating) $ ./bin/kubectl-odh lint --target-version 3.3 --verbose --debugLook for
prohibitedseverity in outputSUMMARY TABLE
Kueue Removed (and/or not present)
➜ odh-cli/ git:(feat/agressive-kueue-gating) $ ./bin/kubectl-odh lint --target-version 3.3 --verboseSUMMARY TABLE
Merge criteria:
Summary by CodeRabbit
Bug Fixes
Chores