Skip to content

Conversation

@adamviktora
Copy link
Member

@adamviktora adamviktora commented Jan 6, 2026

📝 Description

  1. Fixes double star in favoritable Table cell.

The issue was that we updated our package-lock.json (#3316), including the Patternfly dependencies that are with caret (^6.2.2) - so it updated Patternfly to 6.4.0. Console also has ^6.2.2 but their lockfile was last generated with Patternfly 6.2.2 as the newest version. Loading these PF versions together with Console breaks some styling.

Short term fix is to have specific Patternfly versions in package.json to align with Console.

  1. Also fixes a whole section reload on favoriting a bootable volume

🎥 Demo

Before:

Screen.Recording.2026-01-06.at.9.09.12.mov

After:

Screen.Recording.2026-01-05.at.16.14.41.mov

Summary by CodeRabbit

  • Chores
    • Pinned dependency versions to exact specifications for improved build consistency and stability.
    • Refactored internal component state management logic for better code maintainability.

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

- also fixes a whole section reload on favoriting a bootable volume
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jan 6, 2026

@adamviktora: This pull request references CNV-75852 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:

  • also fixes a whole section reload on favoriting a bootable volume

📝 Description

  1. Fixes double star in favoritable Table cell.

The issue was that we updated our package-lock.json (#3316), including the Patternfly dependencies that are with caret (^6.2.2) - so it updated Patternfly to 6.4.0. Console also has ^6.2.2 but their lockfile was last generated with Patternfly 6.2.2 as the newest version. Loading these PF versions together with Console breaks some styling.

Short term fix is to have specific Patternfly versions in package.json to align with Console.

  1. Also fixes a whole section reload on favoriting a bootable volume

🎥 Demo

Before:

Screen.Recording.2026-01-06.at.9.09.12.mov

After:

Screen.Recording.2026-01-05.at.16.14.41.mov

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 added the approved This issue is something we want to fix label Jan 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

PatternFly package dependencies pinned from caret ranges to exact versions in package.json. The loadedFavorites variable removed from useKubevirtUserSettings hook destructuring in a React component, with corresponding conditional logic adjusted.

Changes

Cohort / File(s) Summary
Dependency pinning
package.json
10 PatternFly packages converted from caret version ranges (e.g., ^6.2.2) to exact versions (e.g., 6.2.2). Affected: @patternfly/react-catalog-view-extension, @patternfly/react-charts, @patternfly/react-component-groups, @patternfly/react-core, @patternfly/react-icons, @patternfly/react-log-viewer, @patternfly/react-styles, @patternfly/react-table, @patternfly/react-tokens, @patternfly/react-topology
Hook destructuring update
src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.tsx
Removed loadedFavorites from useKubevirtUserSettings destructuring. Updated conditional early return logic to depend only on instanceTypesAndPreferencesData and loaded state

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

lgtm, approved

Suggested reviewers

  • avivtur
  • upalatucci
  • Pedro-S-Abreu

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main issue being fixed - the duplicate favorite star in the Catalog InstanceTypes page, which aligns with the primary bug fixes described in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed PR description is comprehensive with clear explanations of the changes, reasons for the changes, and before/after video demos.
✨ 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 6, 2026

@adamviktora: This pull request references CNV-75852 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

  1. Fixes double star in favoritable Table cell.

The issue was that we updated our package-lock.json (#3316), including the Patternfly dependencies that are with caret (^6.2.2) - so it updated Patternfly to 6.4.0. Console also has ^6.2.2 but their lockfile was last generated with Patternfly 6.2.2 as the newest version. Loading these PF versions together with Console breaks some styling.

Short term fix is to have specific Patternfly versions in package.json to align with Console.

  1. Also fixes a whole section reload on favoriting a bootable volume

🎥 Demo

Before:

Screen.Recording.2026-01-06.at.9.09.12.mov

After:

Screen.Recording.2026-01-05.at.16.14.41.mov

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

openshift-ci-robot commented Jan 6, 2026

@adamviktora: This pull request references CNV-75852 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

  1. Fixes double star in favoritable Table cell.

The issue was that we updated our package-lock.json (#3316), including the Patternfly dependencies that are with caret (^6.2.2) - so it updated Patternfly to 6.4.0. Console also has ^6.2.2 but their lockfile was last generated with Patternfly 6.2.2 as the newest version. Loading these PF versions together with Console breaks some styling.

Short term fix is to have specific Patternfly versions in package.json to align with Console.

  1. Also fixes a whole section reload on favoriting a bootable volume

🎥 Demo

Before:

Screen.Recording.2026-01-06.at.9.09.12.mov

After:

Screen.Recording.2026-01-05.at.16.14.41.mov

Summary by CodeRabbit

  • Chores
  • Pinned dependency versions to exact specifications for improved build consistency and stability.
  • Refactored internal component state management logic for better code maintainability.

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

🧹 Nitpick comments (2)
src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.tsx (1)

96-96: Consider removing the unnecessary type assertion.

The type assertion as [] on favorites is unnecessary and potentially misleading since favorites is already typed through its default value assignment on line 57. The prop should accept the inferred type without coercion.

As per coding guidelines, avoid using type assertions unless absolutely necessary for type narrowing.

🔎 Suggested improvement
-                    favorites={[favorites as [], updaterFavorites]}
+                    favorites={[favorites, updaterFavorites]}
package.json (1)

8-18: Consider establishing a process for regular PatternFly version reviews.

Pinning to exact versions prevents automatic security and bug fixes. Since the PR description mentions this is a "short-term fix," consider:

  1. Establishing a regular cadence (e.g., monthly) to review and update PatternFly versions
  2. Setting up automated dependency checks (e.g., Dependabot, Renovate) with manual approval
  3. Documenting the version alignment requirement with OpenShift Console in the project README
  4. Tracking this as technical debt for a longer-term solution

This will help balance version stability with security maintenance.

📜 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 bab684d and 0a43dd4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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/catalog/CreateFromInstanceTypes/CreateFromInstanceType.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 (3)
src/views/catalog/CreateFromInstanceTypes/CreateFromInstanceType.tsx (2)

57-60: LGTM - Removing loadedFavorites addresses the section reload issue.

The default value favorites = [] ensures the component handles the initial state gracefully. This change allows the component to render without waiting for favorites to load, which addresses the full section reload issue mentioned in the PR description.


62-68: LGTM - Conditional logic correctly simplified.

Removing loadedFavorites from the loading check is consistent with the hook destructuring change. The component will now proceed with the default empty favorites array, allowing BootableVolumeList to render without waiting for favorites to load, which resolves the duplicate star issue.

package.json (1)

8-18: All PatternFly versions are available and compatible.

All 11 pinned PatternFly packages exist on npm with the specified versions. The @patternfly/[email protected] is correctly aligned with the PatternFly 6.2.x series—despite its higher major version number, react-charts 8.2.x is intentionally released together with PatternFly 6.x.

The pinned versions should resolve the styling issues mentioned in the PR description.

@batyana
Copy link
Member

batyana commented Jan 6, 2026

/lgtm

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

openshift-ci bot commented Jan 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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 9cee336 into kubevirt-ui:main Jan 6, 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