Skip to content

NO-ISSUE: Remove orphan files#3460

Open
LiorSoffer wants to merge 1 commit intoopenshift-assisted:masterfrom
LiorSoffer:orphan
Open

NO-ISSUE: Remove orphan files#3460
LiorSoffer wants to merge 1 commit intoopenshift-assisted:masterfrom
LiorSoffer:orphan

Conversation

@LiorSoffer
Copy link
Contributor

@LiorSoffer LiorSoffer commented Mar 16, 2026

Summary by CodeRabbit

  • Refactor

    • Cluster property helper functions were moved into a dedicated utility module and imports updated.
  • Chores

    • Removed an assisted-installer cluster detail card component.
    • Removed several public cluster-detail component exports.
  • Localization

    • Removed the English "Cluster Details" translation entry (may affect the UI label).

@openshift-ci openshift-ci bot requested review from ElayAharoni and asmasarw March 16, 2026 14:52
@openshift-ci
Copy link

openshift-ci bot commented Mar 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LiorSoffer
Once this PR has been reviewed and has the lgtm label, please assign jgyselov for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

Moved four cluster-detail helper functions into a new clusterPropertiesUtils.tsx, removed ClusterProperties.tsx and AssistedInstallerExtraDetailCard.tsx, updated import paths to the new utilities, removed several public exports from the clusterDetail index, and deleted one English translation entry.

Changes

Cohort / File(s) Summary
New utils / Deleted implementations
libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx, libs/ui-lib/lib/ocm/components/clusterDetail/ClusterProperties.tsx (deleted)
Added clusterPropertiesUtils.tsx exporting getNetworkType, getManagementType, getStackTypeLabel, getDiskEncryptionEnabledOnStatus. Deleted the previous ClusterProperties.tsx which contained those helpers and the ClusterProperties component and types.
Removed wrapper component
libs/ui-lib/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx (deleted)
Removed AssistedInstallerExtraDetailCard.tsx including its Redux-connected Wrapper default export.
Import updates / tests
libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx, libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx, libs/ui-lib/lib/ocm/components/clusterDetail/ClusterPropertiesUtils.test.ts
Updated imports to consume helpers from clusterPropertiesUtils instead of the deleted ClusterProperties module; test import updated accordingly.
Index export cleanup
libs/ui-lib/lib/ocm/components/clusterDetail/index.ts
Removed default exports for ClusterDetail, ClusterInstallationProgressCard, and AssistedInstallerExtraDetailCard from the public index file.
Locale change
libs/locales/lib/en/translation.json
Removed the ai:Cluster Details translation entry.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

lgtm, approved

Suggested reviewers

  • ElayAharoni
  • asmasarw
  • jgyselov

Poem

🐰 I hopped through lines and moved some things,

Helpers grouped where clarity sings.
A wrapper folded, exports pruned,
Paths updated, translations nudged.
— your tiny rabbit reviewer 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'Remove orphan files' accurately summarizes the main objective of this PR, which removes unused/orphaned components and utilities.

✏️ 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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can enable review details to help with troubleshooting, context usage and more.

Enable the reviews.review_details setting to include review details such as the model used, the time taken for each step and more in the review comments.

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.

🧹 Nitpick comments (1)
libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx (1)

5-19: Simplify helpers by returning expressions directly

Both helpers are correct, but removing temporary mutable variables will make the code shorter and easier to scan.

♻️ Proposed refactor
 export const getNetworkType = (clusterNetworkType: Cluster['networkType']): string => {
-  let networkType: string;
-  clusterNetworkType === NETWORK_TYPE_SDN
-    ? (networkType = 'Software-Defined Networking (SDN)')
-    : (networkType = 'Open Virtual Network (OVN)');
-  return networkType;
+  return clusterNetworkType === NETWORK_TYPE_SDN
+    ? 'Software-Defined Networking (SDN)'
+    : 'Open Virtual Network (OVN)';
 };
 
 export const getManagementType = ({ userManagedNetworking }: Cluster): string => {
-  let managementType: string;
-  userManagedNetworking
-    ? (managementType = 'User-Managed Networking')
-    : (managementType = 'Cluster-managed networking');
-  return managementType;
+  return userManagedNetworking ? 'User-Managed Networking' : 'Cluster-managed networking';
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx`
around lines 5 - 19, Replace the temporary mutable variables in getNetworkType
and getManagementType with direct expression returns: for getNetworkType return
the ternary expression based on clusterNetworkType (comparing to
NETWORK_TYPE_SDN) instead of assigning to networkType, and for getManagementType
return the ternary expression based on the Cluster's userManagedNetworking
property instead of assigning to managementType; update only those functions
(getNetworkType, getManagementType) to return the expressions directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx`:
- Around line 5-19: Replace the temporary mutable variables in getNetworkType
and getManagementType with direct expression returns: for getNetworkType return
the ternary expression based on clusterNetworkType (comparing to
NETWORK_TYPE_SDN) instead of assigning to networkType, and for getManagementType
return the ternary expression based on the Cluster's userManagedNetworking
property instead of assigning to managementType; update only those functions
(getNetworkType, getManagementType) to return the expressions directly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0bc004a3-8b16-416e-9e01-c87cca2c4a5c

📥 Commits

Reviewing files that changed from the base of the PR and between 55e173e and d203a9f.

📒 Files selected for processing (8)
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/ClusterProperties.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/ClusterPropertiesUtils.test.ts
  • libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/index.ts
💤 Files with no reviewable changes (4)
  • libs/ui-lib/lib/ocm/components/clusterDetail/index.ts
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/ClusterProperties.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx

Signed-off-by: Lior Soffer <liorsoffer1@gmail.com>
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: 2

🧹 Nitpick comments (1)
libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx (1)

5-11: Consider simplifying to a direct ternary return.

The intermediate variable and assignment-in-ternary pattern is verbose. A direct return is cleaner and more idiomatic.

♻️ Suggested simplification
 export const getNetworkType = (clusterNetworkType: Cluster['networkType']): string => {
-  let networkType: string;
-  clusterNetworkType === NETWORK_TYPE_SDN
-    ? (networkType = 'Software-Defined Networking (SDN)')
-    : (networkType = 'Open Virtual Network (OVN)');
-  return networkType;
+  return clusterNetworkType === NETWORK_TYPE_SDN
+    ? 'Software-Defined Networking (SDN)'
+    : 'Open Virtual Network (OVN)';
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx`
around lines 5 - 11, The function getNetworkType currently uses an intermediate
variable and assignment inside a ternary; simplify it to return the string
directly from the ternary expression using the Cluster['networkType'] parameter
and the NETWORK_TYPE_SDN constant (i.e., replace the variable +
ternary-assignment pattern with a single return clusterNetworkType ===
NETWORK_TYPE_SDN ? 'Software-Defined Networking (SDN)' : 'Open Virtual Network
(OVN)').
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx`:
- Around line 13-19: The getManagementType function returns inconsistent label
capitalization; update the two returned strings so they match (e.g., change
"Cluster-managed networking" to "Cluster-Managed Networking" to match
"User-Managed Networking") by editing the string literals in getManagementType
(which reads the Cluster.userManagedNetworking flag) so both labels use the same
title-case style.
- Around line 24-44: The getDiskEncryptionEnabledOnStatus function currently
only handles 'all', 'masters', and 'workers' and returns null for other
DiskEncryption['enableOn'] values; update this function to add switch cases for
'arbiters' (render "Enabled on arbiters"), 'masters,arbiters' (render "Enabled
on control plane nodes and arbiters"), 'masters,workers' (render "Enabled on
control plane nodes and workers"), and 'arbiters,workers' (render "Enabled on
arbiters and workers") so the disk encryption row is shown for those
combinations; use the existing JSX pattern (fragments and <br /> where needed)
within getDiskEncryptionEnabledOnStatus to match the current UI style.

---

Nitpick comments:
In `@libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx`:
- Around line 5-11: The function getNetworkType currently uses an intermediate
variable and assignment inside a ternary; simplify it to return the string
directly from the ternary expression using the Cluster['networkType'] parameter
and the NETWORK_TYPE_SDN constant (i.e., replace the variable +
ternary-assignment pattern with a single return clusterNetworkType ===
NETWORK_TYPE_SDN ? 'Software-Defined Networking (SDN)' : 'Open Virtual Network
(OVN)').

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: edda31f6-2b22-4bb6-ba88-075c3ec9b057

📥 Commits

Reviewing files that changed from the base of the PR and between d203a9f and fcc6ca7.

📒 Files selected for processing (8)
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/ClusterProperties.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/ClusterPropertiesUtils.test.ts
  • libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/index.ts
💤 Files with no reviewable changes (4)
  • libs/ui-lib/lib/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.tsx
  • libs/locales/lib/en/translation.json
  • libs/ui-lib/lib/ocm/components/clusterDetail/ClusterProperties.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/index.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx
  • libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewNetworkingTable.tsx
  • libs/ui-lib/lib/ocm/components/clusterDetail/ClusterPropertiesUtils.test.ts

Comment on lines +13 to +19
export const getManagementType = ({ userManagedNetworking }: Cluster): string => {
let managementType: string;
userManagedNetworking
? (managementType = 'User-Managed Networking')
: (managementType = 'Cluster-managed networking');
return managementType;
};
Copy link

@coderabbitai coderabbitai bot Mar 16, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistent capitalization in management type labels.

"User-Managed Networking" uses title case while "Cluster-managed networking" uses sentence case. This creates an inconsistent UI appearance.

✏️ Proposed fix for consistency
 export const getManagementType = ({ userManagedNetworking }: Cluster): string => {
-  let managementType: string;
-  userManagedNetworking
-    ? (managementType = 'User-Managed Networking')
-    : (managementType = 'Cluster-managed networking');
-  return managementType;
+  return userManagedNetworking
+    ? 'User-Managed Networking'
+    : 'Cluster-Managed Networking';
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const getManagementType = ({ userManagedNetworking }: Cluster): string => {
let managementType: string;
userManagedNetworking
? (managementType = 'User-Managed Networking')
: (managementType = 'Cluster-managed networking');
return managementType;
};
export const getManagementType = ({ userManagedNetworking }: Cluster): string => {
return userManagedNetworking
? 'User-Managed Networking'
: 'Cluster-Managed Networking';
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx`
around lines 13 - 19, The getManagementType function returns inconsistent label
capitalization; update the two returned strings so they match (e.g., change
"Cluster-managed networking" to "Cluster-Managed Networking" to match
"User-Managed Networking") by editing the string literals in getManagementType
(which reads the Cluster.userManagedNetworking flag) so both labels use the same
title-case style.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be sentence case per PF guidelines https://www.patternfly.org/ux-writing/capitalization

Feel free to make it consistent across the project @LiorSoffer

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Comment on lines +24 to +44
export const getDiskEncryptionEnabledOnStatus = (diskEncryption: DiskEncryption['enableOn']) => {
let diskEncryptionType = null;
switch (diskEncryption) {
case 'all':
diskEncryptionType = (
<>
Enabled on control plane nodes
<br />
Enabled on workers
</>
);
break;
case 'masters':
diskEncryptionType = <>Enabled on control plane nodes</>;
break;
case 'workers':
diskEncryptionType = <>Enabled on workers</>;
break;
}
return diskEncryptionType;
};
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how getDiskEncryptionEnabledOnStatus is used and whether arbiters/combinations appear elsewhere

# Find usages of getDiskEncryptionEnabledOnStatus
echo "=== Usages of getDiskEncryptionEnabledOnStatus ==="
rg -n "getDiskEncryptionEnabledOnStatus" --type=ts --type=tsx -C2

# Check if 'arbiters' or combination values are referenced in disk encryption contexts
echo "=== References to arbiters in disk encryption contexts ==="
rg -n "arbiters" --type=ts --type=tsx -C2

# Check the DiskEncryption type definition
echo "=== DiskEncryption type definition ==="
rg -nP "enableOn.*:" -A10 --type=ts | head -50

Repository: openshift-assisted/assisted-installer-ui

Length of output: 3332


🏁 Script executed:

# Search more broadly for the function
echo "=== Direct file search ==="
cat -n libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx | head -60

echo ""
echo "=== Search for imports of clusterPropertiesUtils ==="
rg -n "clusterPropertiesUtils" --type-list | head -5
rg -n "clusterPropertiesUtils" -A 2

echo ""
echo "=== Search with simpler patterns ==="
rg -n "getDiskEncryptionEnabledOnStatus"

echo ""
echo "=== Check if getDiskEncryptionEnabledOnStatus is exported ==="
grep -n "export\|getDiskEncryptionEnabledOnStatus" libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx

Repository: openshift-assisted/assisted-installer-ui

Length of output: 4616


🏁 Script executed:

# Check the usage context in ReviewClusterDetailTable.tsx
sed -n '60,80p' libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx

# Also check if there's any handling for null/undefined values
sed -n '60,90p' libs/ui-lib/lib/ocm/components/clusterConfiguration/review/ReviewClusterDetailTable.tsx

Repository: openshift-assisted/assisted-installer-ui

Length of output: 1453


Handle additional enableOn values in disk encryption status display.

The function unhandled cases ('arbiters', 'masters,arbiters', 'masters,workers', 'arbiters,workers') that are actively generated by DiskEncryptionService. When these values occur, getDiskEncryptionEnabledOnStatus returns null, causing the disk encryption row to not appear in the cluster details review table.

Add cases for these combinations to display appropriate status text:

  • 'arbiters' → "Enabled on arbiters"
  • 'masters,arbiters' → "Enabled on control plane nodes and arbiters"
  • 'masters,workers' → "Enabled on control plane nodes and workers"
  • 'arbiters,workers' → "Enabled on arbiters and workers"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-lib/lib/ocm/components/clusterDetail/clusterPropertiesUtils.tsx`
around lines 24 - 44, The getDiskEncryptionEnabledOnStatus function currently
only handles 'all', 'masters', and 'workers' and returns null for other
DiskEncryption['enableOn'] values; update this function to add switch cases for
'arbiters' (render "Enabled on arbiters"), 'masters,arbiters' (render "Enabled
on control plane nodes and arbiters"), 'masters,workers' (render "Enabled on
control plane nodes and workers"), and 'arbiters,workers' (render "Enabled on
arbiters and workers") so the disk encryption row is shown for those
combinations; use the existing JSX pattern (fragments and <br /> where needed)
within getDiskEncryptionEnabledOnStatus to match the current UI style.

import { isDualStack, NETWORK_TYPE_SDN } from '../../../common';
import { Cluster, DiskEncryption } from '@openshift-assisted/types/assisted-installer-service';

export const getNetworkType = (clusterNetworkType: Cluster['networkType']): string => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also unused (the getNetworkType function in /cim is a different one). Let's remove it.

return networkType;
};

export const getManagementType = ({ userManagedNetworking }: Cluster): string => {
Copy link
Contributor

@jgyselov jgyselov Mar 16, 2026

Choose a reason for hiding this comment

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

While we're at it, this could be simpler. Let's make it a ternary operator.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since all of these functions appear to be connected to the Review step, I'd put them in a utils.tsx file in the review folder.

@jgyselov jgyselov changed the title Remove orphan files NO-ISSUE: Remove orphan files Mar 16, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 16, 2026
@openshift-ci-robot
Copy link

@LiorSoffer: This pull request explicitly references no jira issue.

Details

In response to this:

Summary by CodeRabbit

  • Refactor

  • Cluster property helper functions were moved into a dedicated utility module and imports updated.

  • Chores

  • Removed an assisted-installer cluster detail card component.

  • Removed several public cluster-detail component exports.

  • Localization

  • Removed the English "Cluster Details" translation entry (may affect the UI label).

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants