Skip to content

Conversation

@adamviktora
Copy link
Member

@adamviktora adamviktora commented Jan 5, 2026

📝 Description

Installed features in Settings -> Configure features modal -> High availability are now checked.

(We can't make the checkboxes enabled, because the modal can't uninstall the features.)

🎥 Demo

After:
Screenshot 2026-01-05 at 14 02 10

Summary by CodeRabbit

  • Bug Fixes
    • Fixed high availability feature configuration display to correctly show the checked state when virtualization operators are already installed on the cluster, regardless of their current selection status. This ensures accurate visual feedback during cluster configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 5, 2026

@adamviktora: This pull request references CNV-74670 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

📝 Description

Installed features in Settings -> Configure features modal -> High availability are now checked.

(We can't make the checkboxes enabled, because the modal can't uninstall the features.)

🎥 Demo

After:
Screenshot 2026-01-05 at 14 02 10

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from aviavissar and pcbailey January 5, 2026 13:11
@openshift-ci openshift-ci bot added the approved This issue is something we want to fix label Jan 5, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

A single checkbox state logic modification in the HighAvailabilityFeatureItem component. The isChecked property now evaluates to operatorsToInstall?.[operatorName] || installed instead of only checking operatorsToInstall?.[operatorName], ensuring the checkbox reflects both newly selected operators and already-installed ones.

Changes

Cohort / File(s) Summary
High Availability UI State Logic
src/views/clusteroverview/SettingsTab/ClusterTab/components/.../HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
Modified checkbox isChecked condition to include OR logic with installed flag, allowing the checkbox to display as checked when operators are either selected for installation or already installed

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

lgtm, approved

Suggested reviewers

  • batyana
  • gouyang
  • upalatucci

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: installed features in High availability are now checked in the UI.
Description check ✅ Passed The description covers the main change and includes a demo screenshot, but lacks details about implementation specifics and testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

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-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 5, 2026

@adamviktora: This pull request references CNV-74670 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

📝 Description

Installed features in Settings -> Configure features modal -> High availability are now checked.

(We can't make the checkboxes enabled, because the modal can't uninstall the features.)

🎥 Demo

After:
Screenshot 2026-01-05 at 14 02 10

Summary by CodeRabbit

  • Bug Fixes
  • Fixed high availability feature configuration display to correctly show the checked state when virtualization operators are already installed on the cluster, regardless of their current selection status. This ensures accurate visual feedback during cluster configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx (1)

33-34: Add defensive handling for potentially undefined operatorDetailsMap entry.

The optional chaining on line 33 may result in undefined values for both installState and operatorHubURL if operatorDetailsMap is undefined or the operator key doesn't exist. While isInstalled returns false when passed undefined (preventing runtime errors), this is a type safety issue—the function signature expects InstallState, not InstallState | undefined.

Consider adding explicit defaults:

Suggested approach
-  const { installState, operatorHubURL } = operatorDetailsMap?.[operatorName];
+  const { installState = InstallState.UNKNOWN, operatorHubURL = '' } = operatorDetailsMap?.[operatorName] ?? {};
   const installed = isInstalled(installState);

This ensures isInstalled receives a valid InstallState enum value rather than undefined, making the type handling explicit and correct.

🧹 Nitpick comments (1)
src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx (1)

23-75: Consider wrapping the component in React.memo for performance.

While the component is relatively simple, the coding guidelines recommend using React memoization tools to avoid unnecessary re-renders. Wrapping this component in React.memo could prevent re-renders when parent components update but props remain the same.

🔎 Example implementation
-const HighAvailabilityFeatureItem: FC<HighAvailabilityFeatureItemProps> = ({
+const HighAvailabilityFeatureItem: FC<HighAvailabilityFeatureItemProps> = React.memo(({
   alternativeChecked,
   checkboxLabel,
   description,
   operatorName,
   setAlternativeChecked,
-}) => {
+}) => {
   const { operatorDetailsMap, operatorsToInstall, updateInstallRequests } =
     useVirtualizationFeaturesContext();
   
   // ... rest of component
   
   return (
     // ... JSX
   );
-};
+});
+
+HighAvailabilityFeatureItem.displayName = 'HighAvailabilityFeatureItem';
 
 export default HighAvailabilityFeatureItem;

As per coding guidelines, memoization helps optimize render performance.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3681b7e and 12908d8.

📒 Files selected for processing (1)
  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.tsx

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.tsx: Use .tsx file extension for all React components. One component per file with no nested components.
Use PascalCase for all React component names (e.g., HeaderTop.tsx)
Use functional components by default. Only use class components for specific lifecycle methods unavailable in functional components (e.g., componentDidCatch)
Use default exports for all React components
Use React.lazy and Suspense for lazy loading components

Files:

  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
**/*.{tsx,scss}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

Use project-based class names on components as anchors for styling rules rather than relying on PatternFly class names

Files:

  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{tsx,ts}: Extract logic from components into custom hooks or utility files to improve testability and component maintainability
Use React memoization tools (React.memo, useMemo, useCallback) to avoid unnecessary re-renders
Always specify dependencies in useEffect to avoid unnecessary re-renders or missed updates. Use an empty array [] if no dependencies are required

Files:

  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{ts,tsx,js,jsx}: Keep files under 150 lines whenever possible
Use descriptive names for variables, functions, and components. Avoid abbreviations unless widely recognized
Keep functions short and focused on one action. Apply Red → Green → Refactor methodology
Avoid hardcoded values (magic numbers) and define them as constants for easy adjustments and readability

Files:

  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

Define constants in utility files with uppercase and underscore-separated naming (e.g., API_URL)

Files:

  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{ts,tsx}: Prefer using type instead of interface for defining the shapes of objects or functions in TypeScript
If a type is exported, add it to a utility file
Avoid using any type in TypeScript. Use unknown instead and narrow the type as needed
Always explicitly define return types for functions rather than relying on TypeScript type inference

Files:

  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
🧠 Learnings (1)
📚 Learning: 2025-12-09T17:30:56.131Z
Learnt from: rszwajko
Repo: kubevirt-ui/kubevirt-plugin PR: 3235
File: src/views/checkups/self-validation/details/tabs/details/components/CheckupsSelfValidationDetailsDescriptionList.tsx:26-93
Timestamp: 2025-12-09T17:30:56.131Z
Learning: When using the Timestamp component from openshift-console/dynamic-plugin-sdk, you can pass sentinel values like NO_DATA_DASH directly to the timestamp prop without wrapping in conditional rendering. The component handles invalid/missing values gracefully. This applies to all TSX files that render the Timestamp component; ensure you do not add extra conditional logic for such values and rely on the component's internal handling. Reference: OpenShift Console Timestamp.tsx implementation.

Applied to files:

  • src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
src/views/clusteroverview/SettingsTab/ClusterTab/components/VirtualizationFeaturesSection/VirtualizationFeaturesWizard/components/ConfigurationStep/components/HighAvailabilityConfigurationSection/components/HighAvailabilityContent/HighAvailabilityFeatureItem/HighAvailabilityFeatureItem.tsx (1)

49-49: LGTM! Correctly implements the PR objective.

The change makes the checkbox checked when the operator is installed, which aligns with the PR goal of showing installed features as checked. Combined with the isDisabled prop on line 50, installed operators are displayed as checked and disabled, correctly preventing uninstallation.

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label Jan 5, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adamviktora, galkremer1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [adamviktora,galkremer1]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 89c1720 into kubevirt-ui:main Jan 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This issue is something we want to fix jira/valid-reference lgtm Passed code review, ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants