Skip to content

CONSOLE-5315: Get Node inventory card items from extensions#16582

Open
jeff-phillips-18 wants to merge 1 commit into
openshift:mainfrom
jeff-phillips-18:inventory-item-extension
Open

CONSOLE-5315: Get Node inventory card items from extensions#16582
jeff-phillips-18 wants to merge 1 commit into
openshift:mainfrom
jeff-phillips-18:inventory-item-extension

Conversation

@jeff-phillips-18

@jeff-phillips-18 jeff-phillips-18 commented Jun 9, 2026

Copy link
Copy Markdown
Member

Analysis / Root cause:

The Node inventory card in the Node dashboard was hardcoded to display only Pods and Images, with BareMetalHost and VirtualMachine inventory
items conditionally rendered based on the NODE_MGMT_V1 feature flag. This tight coupling prevented dynamic plugins from contributing their
own inventory items to the Node dashboard, limiting extensibility.

The static plugin architecture required BareMetalHost-specific inventory logic to reside in the core console-app package, violating
separation of concerns and making it difficult for other plugins to add custom inventory items.

Solution description:

This PR introduces a new extension point console.node/inventory-item that allows dynamic and static plugins to contribute inventory items to
the Node dashboard's inventory card.

Key changes:

  1. New Extension Point (console.node/inventory-item):
  • Defined in @console/dynamic-plugin-sdk/src/extensions/node.ts
  • Components receive the Node object via InventoryItemComponentProps
  • Uses priority-based ordering (higher priority = displayed first)
  • Documented in console-extensions.md with clear priority guidelines
  1. InventoryCard Refactoring:
  • Removed hardcoded BareMetalHost and VirtualMachine inventory items
  • Uses useResolvedExtensions to load inventory items from extensions
  • Merges standard items (Pods: 90, Images: 70) with extension items
  • Sorts by priority and renders dynamically
  1. Metal3 Plugin Integration:
  • Created BareMetalHostInventoryItemsForNode component in metal3-plugin
  • Displays Disk, NIC, and CPU counts from BareMetalHost resources
  • Registered via console.node/inventory-item extension with priority 60
  • Only loads when BAREMETAL and METAL3 flags are enabled
  1. Cleanup:
  • Deleted BareMetalInventoryItems and VirtualMachinesInventoryItems from console-app

Priority ordering:

  • Pods: 90 (built-in)
  • Images: 70 (built-in)
  • BareMetalHost items (Disk, NIC, CPU): 60 (metal3-plugin extension)

Screenshots / screen recording:
image

Test setup:

  1. Deploy a cluster with metal3 / baremetal platform
  2. Ensure BareMetalHost resources exist and are bound to Nodes
  3. Verify the console has the metal3-plugin enabled

Test cases:

  1. Standard Node (no BareMetalHost):
  • Navigate to Compute → Nodes → [select a node] → Overview
  • Verify inventory card shows Pods and Images only
  • Verify no errors in console logs
  1. BareMetalHost-backed Node:
  • Navigate to a Node backed by a BareMetalHost
  • Verify inventory card shows (in order): Pods, Images, Disk, NIC, CPU
  • Verify counts are accurate (match BareMetalHost spec)
  • Click Disk link → navigates to Configuration → Storage tab
  • Click NIC link → navigates to BareMetalHost NICs tab
  1. Non-admin User:
  • Login as non-admin user with limited namespace access
  • Navigate to Nodes
  • Verify inventory items load correctly for accessible resources only
  • Verify no 403 errors in network tab
  1. Extension Loading:
  • Verify inventory items load in correct priority order
  • Check console logs for extension resolution errors
  • Verify components render without React key warnings
  1. Feature Flag Gating:
  • Disable METAL3 feature flag
  • Verify BareMetalHost inventory items do not appear
  • Re-enable and verify they reappear

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Public API Changes:

  • ✅ New extension type: console.node/inventory-item (non-breaking addition)
  • ✅ Extension schema updated in console-extensions.ts
  • ✅ Documentation added to console-extensions.md
  • ⚠️ Breaking change for static plugins: Removed NODE_MGMT_V1 flag usage in InventoryCard

Related Work:

  • Builds on previous Node dashboard enhancements (CONSOLE-4943, CONSOLE-4945, CONSOLE-4983, CONSOLE-4946)
  • Part of Node Management V1 feature set

Migration Notes:

  • Other plugins can now contribute inventory items using the same pattern
  • Example: kubevirt-plugin could add VM-related inventory items

Reviewers and assignees:

Console Approver:
/assign @jhadvig

Docs approver:
/assign @jseseCCS

PX approver:
/assign @rh-joshbeverly

🤖 Generated with https://claude.com/claude-code

Summary by CodeRabbit

  • New Features

    • Plugins can contribute ordered inventory items to the Node inventory card.
    • Bare Metal host inventory for Nodes: disk/NIC/CPU counts and navigation links surfaced via plugin.
  • Refactor

    • Node inventory card rebuilt to resolve and render extension-provided items with priority-based ordering; legacy Bare Metal/VM inventory paths removed.
  • Documentation

    • Added docs for the new node inventory-item extension type.
  • Localization

    • Adjusted Node details and metrics labels ordering in English locales.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 9, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@jeff-phillips-18: This pull request references CONSOLE-5315 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 story to target either version "5.0." or "openshift-5.0.", but it targets "openshift-4.23" instead.

Details

In response to this:

Analysis / Root cause:

The Node inventory card in the Node dashboard was hardcoded to display only Pods and Images, with BareMetalHost and VirtualMachine inventory
items conditionally rendered based on the NODE_MGMT_V1 feature flag. This tight coupling prevented dynamic plugins from contributing their
own inventory items to the Node dashboard, limiting extensibility.

The static plugin architecture required BareMetalHost-specific inventory logic to reside in the core console-app package, violating
separation of concerns and making it difficult for other plugins to add custom inventory items.

Solution description:

This PR introduces a new extension point console.node/inventory-item that allows dynamic and static plugins to contribute inventory items to
the Node dashboard's inventory card.

Key changes:

  1. New Extension Point (console.node/inventory-item):
  • Defined in @console/dynamic-plugin-sdk/src/extensions/node.ts
  • Components receive the Node object via InventoryItemComponentProps
  • Uses priority-based ordering (higher priority = displayed first)
  • Documented in console-extensions.md with clear priority guidelines
  1. InventoryCard Refactoring:
  • Removed hardcoded BareMetalHost and VirtualMachine inventory items
  • Uses useResolvedExtensions to load inventory items from extensions
  • Merges standard items (Pods: 90, Images: 70) with extension items
  • Sorts by priority and renders dynamically
  1. Metal3 Plugin Integration:
  • Created BareMetalHostInventoryItemsForNode component in metal3-plugin
  • Displays Disk, NIC, and CPU counts from BareMetalHost resources
  • Registered via console.node/inventory-item extension with priority 60
  • Only loads when BAREMETAL and METAL3 flags are enabled
  1. Cleanup:
  • Deleted BareMetalInventoryItems and VirtualMachinesInventoryItems from console-app

Priority ordering:

  • Pods: 90 (built-in)
  • Images: 70 (built-in)
  • BareMetalHost items (Disk, NIC, CPU): 60 (metal3-plugin extension)

Screenshots / screen recording:
image

Test setup:

  1. Deploy a cluster with metal3 / baremetal platform
  2. Ensure BareMetalHost resources exist and are bound to Nodes
  3. Verify the console has the metal3-plugin enabled

Test cases:

  1. Standard Node (no BareMetalHost):
  • Navigate to Compute → Nodes → [select a node] → Overview
  • Verify inventory card shows Pods and Images only
  • Verify no errors in console logs
  1. BareMetalHost-backed Node:
  • Navigate to a Node backed by a BareMetalHost
  • Verify inventory card shows (in order): Pods, Images, Disk, NIC, CPU
  • Verify counts are accurate (match BareMetalHost spec)
  • Click Disk link → navigates to Configuration → Storage tab
  • Click NIC link → navigates to BareMetalHost NICs tab
  1. Non-admin User:
  • Login as non-admin user with limited namespace access
  • Navigate to Nodes
  • Verify inventory items load correctly for accessible resources only
  • Verify no 403 errors in network tab
  1. Extension Loading:
  • Verify inventory items load in correct priority order
  • Check console logs for extension resolution errors
  • Verify components render without React key warnings
  1. Feature Flag Gating:
  • Disable METAL3 feature flag
  • Verify BareMetalHost inventory items do not appear
  • Re-enable and verify they reappear

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Public API Changes:

  • ✅ New extension type: console.node/inventory-item (non-breaking addition)
  • ✅ Extension schema updated in console-extensions.ts
  • ✅ Documentation added to console-extensions.md
  • ⚠️ Breaking change for static plugins: Removed NODE_MGMT_V1 flag usage in InventoryCard

Related Work:

  • Builds on previous Node dashboard enhancements (CONSOLE-4943, CONSOLE-4945, CONSOLE-4983, CONSOLE-4946)
  • Part of Node Management V1 feature set

Migration Notes:

  • Other plugins can now contribute inventory items using the same pattern
  • Example: kubevirt-plugin could add VM-related inventory items

Reviewers and assignees:

Console Approver:
/assign @jhadvig

Docs approver:
/assign @jseseCCS

PX approver:
/assign @rh-joshbeverly

🤖 Generated with https://claude.com/claude-code

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 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@jeff-phillips-18: GitHub didn't allow me to assign the following users: rh-joshbeverly.

Note that only openshift members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

Details

In response to this:

Analysis / Root cause:

The Node inventory card in the Node dashboard was hardcoded to display only Pods and Images, with BareMetalHost and VirtualMachine inventory
items conditionally rendered based on the NODE_MGMT_V1 feature flag. This tight coupling prevented dynamic plugins from contributing their
own inventory items to the Node dashboard, limiting extensibility.

The static plugin architecture required BareMetalHost-specific inventory logic to reside in the core console-app package, violating
separation of concerns and making it difficult for other plugins to add custom inventory items.

Solution description:

This PR introduces a new extension point console.node/inventory-item that allows dynamic and static plugins to contribute inventory items to
the Node dashboard's inventory card.

Key changes:

  1. New Extension Point (console.node/inventory-item):
  • Defined in @console/dynamic-plugin-sdk/src/extensions/node.ts
  • Components receive the Node object via InventoryItemComponentProps
  • Uses priority-based ordering (higher priority = displayed first)
  • Documented in console-extensions.md with clear priority guidelines
  1. InventoryCard Refactoring:
  • Removed hardcoded BareMetalHost and VirtualMachine inventory items
  • Uses useResolvedExtensions to load inventory items from extensions
  • Merges standard items (Pods: 90, Images: 70) with extension items
  • Sorts by priority and renders dynamically
  1. Metal3 Plugin Integration:
  • Created BareMetalHostInventoryItemsForNode component in metal3-plugin
  • Displays Disk, NIC, and CPU counts from BareMetalHost resources
  • Registered via console.node/inventory-item extension with priority 60
  • Only loads when BAREMETAL and METAL3 flags are enabled
  1. Cleanup:
  • Deleted BareMetalInventoryItems and VirtualMachinesInventoryItems from console-app

Priority ordering:

  • Pods: 90 (built-in)
  • Images: 70 (built-in)
  • BareMetalHost items (Disk, NIC, CPU): 60 (metal3-plugin extension)

Screenshots / screen recording:
image

Test setup:

  1. Deploy a cluster with metal3 / baremetal platform
  2. Ensure BareMetalHost resources exist and are bound to Nodes
  3. Verify the console has the metal3-plugin enabled

Test cases:

  1. Standard Node (no BareMetalHost):
  • Navigate to Compute → Nodes → [select a node] → Overview
  • Verify inventory card shows Pods and Images only
  • Verify no errors in console logs
  1. BareMetalHost-backed Node:
  • Navigate to a Node backed by a BareMetalHost
  • Verify inventory card shows (in order): Pods, Images, Disk, NIC, CPU
  • Verify counts are accurate (match BareMetalHost spec)
  • Click Disk link → navigates to Configuration → Storage tab
  • Click NIC link → navigates to BareMetalHost NICs tab
  1. Non-admin User:
  • Login as non-admin user with limited namespace access
  • Navigate to Nodes
  • Verify inventory items load correctly for accessible resources only
  • Verify no 403 errors in network tab
  1. Extension Loading:
  • Verify inventory items load in correct priority order
  • Check console logs for extension resolution errors
  • Verify components render without React key warnings
  1. Feature Flag Gating:
  • Disable METAL3 feature flag
  • Verify BareMetalHost inventory items do not appear
  • Re-enable and verify they reappear

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Public API Changes:

  • ✅ New extension type: console.node/inventory-item (non-breaking addition)
  • ✅ Extension schema updated in console-extensions.ts
  • ✅ Documentation added to console-extensions.md
  • ⚠️ Breaking change for static plugins: Removed NODE_MGMT_V1 flag usage in InventoryCard

Related Work:

  • Builds on previous Node dashboard enhancements (CONSOLE-4943, CONSOLE-4945, CONSOLE-4983, CONSOLE-4946)
  • Part of Node Management V1 feature set

Migration Notes:

  • Other plugins can now contribute inventory items using the same pattern
  • Example: kubevirt-plugin could add VM-related inventory items

Reviewers and assignees:

Console Approver:
/assign @jhadvig

Docs approver:
/assign @jseseCCS

PX approver:
/assign @rh-joshbeverly

🤖 Generated with https://claude.com/claude-code

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 kubernetes-sigs/prow repository.

@openshift-ci openshift-ci Bot requested review from fsgreco and rawagner June 9, 2026 15:21
@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/metal3 Related to metal3-plugin component/sdk Related to console-plugin-sdk kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated plugin-api-changed Categorizes a PR as containing plugin API changes labels Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Refactors Node inventory to load items from a new console.node/inventory-item extension, implements bare-metal host inventory and an admin/namespace-accessible useAccessibleResources hook in metal3, updates SDK types/docs for the extension, rewrites InventoryCard tests, and reorders Node i18n keys.

Changes

Node Inventory Extension System

Layer / File(s) Summary
InventoryCard implementation
frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx
Adds NodePodInventoryItem and NodeImagesInventoryItem, resolves console.node/inventory-item extensions via useResolvedExtensions, merges with standard items, sorts by priority, and renders items in a Stack.
InventoryCard tests
frontend/packages/console-app/src/components/nodes/node-dashboard/__tests__/InventoryCard.spec.tsx
Refactors tests to mock extension resolution and pod/image watches, asserting rendering, watch call shapes, loading states, extension invocation, and priority ordering.
SDK types and docs
frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts, frontend/packages/console-dynamic-plugin-sdk/src/schema/console-extensions.ts, frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md
Adds InventoryItemComponentProps, NodeInventoryExtensionItem, isNodeInventoryItem type guard, updates SupportedExtension union, and documents console.node/inventory-item (priority, component).
metal3-plugin: bare-metal inventory and registration
frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx, frontend/packages/metal3-plugin/console-extensions.json, frontend/packages/metal3-plugin/package.json
New BareMetalHostInventoryItemsForNode presentational and container components (host↔machine matching, disk/NIC/CPU items); registers as console.node/inventory-item (priority 60, flags BAREMETAL & METAL3); adjusts exposedModules ordering.
useAccessibleResources hook
frontend/packages/metal3-plugin/src/hooks/useAccessibleResources.ts
New hook that watches resources directly for admins or aggregates per-namespace watches for non-admin users, returning flattened data with combined loaded and loadError.
Node i18n and utils cleanup
frontend/packages/console-app/locales/en/console-app.json, frontend/packages/console-app/src/components/nodes/utils/NodeBareMetalUtils.ts, frontend/packages/console-app/src/components/nodes/utils/NodeVmUtils.ts
Reorders Node UI localization keys (Images/Image/Inventory and relocation of “Virtual machines”) and removes exported BareMetalHostModel and VirtualMachineModel constants from node utils.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

  • openshift/console#16000: Overlapping refactor of node inventory additions and replacement of flag-driven components with extension-driven inventory rendering.
  • openshift/console#16124: Related changes to node dashboard inventory and VM/bare-metal watch utilities; overlaps on migrated inventory behavior.

Suggested labels

approved, lgtm, docs-approved, plugin-api-approved, verified

Suggested reviewers

  • fsgreco
  • spadgett
  • rhamilto
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: introducing a new extension point for Node inventory items.
Description check ✅ Passed The PR description comprehensively covers analysis, solution, test setup, test cases, and additional context; all major template sections are addressed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed This PR contains only TypeScript/JavaScript frontend files with no Go test files or Ginkgo tests. The custom check for Ginkgo test name stability is not applicable here.
Test Structure And Quality ✅ Passed Custom check for Ginkgo test quality is not applicable to this PR. The PR contains TypeScript React code with Jest tests only, no Go code or Ginkgo tests.
Microshift Test Compatibility ✅ Passed PR contains no new Ginkgo e2e tests (only TypeScript/React frontend changes). MicroShift compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR modifies TypeScript/React frontend components and tests only; no new Go-based Ginkgo e2e tests are added. The custom check applies exclusively to Ginkgo e2e tests and is not applicable here.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only UI components, SDK types, and localization—no deployment manifests, operators, or controllers are added, so topology-aware scheduling constraints don't apply.
Ote Binary Stdout Contract ✅ Passed Check is not applicable: PR modifies only TypeScript/React frontend code (.tsx, .ts, .json, .md files), not Go code. No OTE binary, test suite setup, or stdout operations are affected.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. All changes are TypeScript/JavaScript frontend code and Jest tests, not Go e2e tests. The check is not applicable.
No-Weak-Crypto ✅ Passed No weak cryptography (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB) or custom crypto implementations detected in PR changes. This is a UI refactoring with no cryptographic operations.
Container-Privileges ✅ Passed No container privilege escalation settings found. PR modifies UI components, type definitions, and localization strings only—no Kubernetes manifests or container configs.
No-Sensitive-Data-In-Logs ✅ Passed No logging statements that could expose sensitive data (passwords, tokens, API keys, PII, session IDs, hostnames, or customer data) found in any PR code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx (1)

55-69: ⚡ Quick win

Inconsistent StackItem wrapping across inventory components.

NodeImagesInventoryItem wraps its content in StackItem, but NodePodInventoryItem (lines 20-53) returns ResourceInventoryItem directly without a StackItem wrapper. This inconsistency may cause layout differences.

For consistency, either:

  1. Both components should wrap in StackItem, or
  2. Neither should wrap (let the parent Stack handle layout), or
  3. The map in the render (line 118) should wrap each item in StackItem
♻️ Recommended fix: Remove StackItem wrapper for consistency
 const NodeImagesInventoryItem: ComponentType<{ obj: NodeKind }> = ({ obj }) => {
   const { t } = useTranslation();
 
   return (
-    <StackItem>
-      <InventoryItem
-        isLoading={!obj}
-        title={t('console-app~Image')}
-        titlePlural={t('console-app~Images')}
-        count={obj.status?.images?.length}
-        error={!obj.status?.images}
-      />
-    </StackItem>
+    <InventoryItem
+      isLoading={!obj}
+      title={t('console-app~Image')}
+      titlePlural={t('console-app~Images')}
+      count={obj.status?.images?.length}
+      error={!obj.status?.images}
+    />
   );
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx`
around lines 55 - 69, NodeImagesInventoryItem is wrapped in a StackItem while
NodePodInventoryItem returns ResourceInventoryItem directly, causing layout
inconsistency; remove the StackItem wrapper from NodeImagesInventoryItem so it
returns InventoryItem directly (matching NodePodInventoryItem), keeping the same
props (isLoading, title, titlePlural, count, error) and leaving imports/usage of
InventoryItem, ResourceInventoryItem, NodeImagesInventoryItem and
NodePodInventoryItem intact.
frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx (1)

86-107: ⚡ Quick win

Unify the isLoading prop across all inventory items.

Line 88 uses isLoading={!loaded}, while lines 96 and 104 use isLoading={!obj}. This inconsistency can cause visual glitches when loaded is true but obj is still undefined (e.g., no matching BareMetalHost found).

♻️ Standardize loading state
       <InventoryItem
         title={t('metal3-plugin~NIC')}
-        isLoading={!obj}
+        isLoading={!loaded}
         count={getHostNICs(obj).length}
         TitleComponent={NICTitleComponent}
       />
     </StackItem>
     <StackItem>
       <InventoryItem
         title={t('metal3-plugin~CPU')}
-        isLoading={!obj}
+        isLoading={!loaded}
         count={getHostCPU(obj).count}
       />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx`
around lines 86 - 107, InventoryItem components use inconsistent loading checks:
Disk uses isLoading={!loaded} while NIC and CPU use isLoading={!obj}; change all
InventoryItem isLoading props (the Disk, NIC, and CPU InventoryItem instances
that use DiskTitleComponent, NICTitleComponent and
getHostStorage/getHostNICs/getHostCPU) to the same unified condition—preferably
isLoading={!loaded || !obj}—so loading state is consistent when either overall
data isn't loaded or the specific obj is missing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx`:
- Around line 55-110: BareMetalHostInventoryItems currently calls
getNamespace(obj), getName(obj), getHostStorage(obj), getHostNICs(obj), and
getHostCPU(obj) without guarding against obj being undefined; update
BareMetalHostInventoryItems to early-return null (or a loading/empty state) when
obj is undefined or otherwise provide safe fallback values for
hostName/namespace and counts (e.g., empty arrays and zero) before using
NICTitleComponent, DiskTitleComponent, getHostStorage, getHostNICs, and
getHostCPU so no runtime access occurs on an undefined obj.

In `@frontend/packages/metal3-plugin/src/hooks/useAccessibleResources.ts`:
- Around line 43-49: The initResources builder may spread an undefined
initResource which yields invalid WatchK8sResource objects; update the
useAccessibleResources hook to validate initResource before using it (inside the
initResources useMemo) — either return an empty WatchK8sResources object or
throw a clear error if initResource is falsy, or make initResource required in
the hook signature; ensure the logic around projectsNames and the created
resources[namespace] entries only runs when initResource is defined so each
entry includes required fields like groupVersionKind.
- Around line 38-41: projectsNames computed in the useMemo can be undefined when
projectsLoaded is true but projectsData is undefined, causing a forEach runtime
error; update the useMemo (projectsNames) to ensure it always yields an array by
using a nullish fallback around the map result (e.g., use
projectsData?.map(getName) ?? [] or a conditional projectsData ?
projectsData.map(getName) : []) and keep the same dependencies (isAdmin,
projectsData, projectsLoaded) so subsequent code that calls forEach on
projectsNames is safe.

---

Nitpick comments:
In
`@frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx`:
- Around line 55-69: NodeImagesInventoryItem is wrapped in a StackItem while
NodePodInventoryItem returns ResourceInventoryItem directly, causing layout
inconsistency; remove the StackItem wrapper from NodeImagesInventoryItem so it
returns InventoryItem directly (matching NodePodInventoryItem), keeping the same
props (isLoading, title, titlePlural, count, error) and leaving imports/usage of
InventoryItem, ResourceInventoryItem, NodeImagesInventoryItem and
NodePodInventoryItem intact.

In
`@frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx`:
- Around line 86-107: InventoryItem components use inconsistent loading checks:
Disk uses isLoading={!loaded} while NIC and CPU use isLoading={!obj}; change all
InventoryItem isLoading props (the Disk, NIC, and CPU InventoryItem instances
that use DiskTitleComponent, NICTitleComponent and
getHostStorage/getHostNICs/getHostCPU) to the same unified condition—preferably
isLoading={!loaded || !obj}—so loading state is consistent when either overall
data isn't loaded or the specific obj is missing.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7281cc07-991e-4730-a085-1fd4bc9c9f2e

📥 Commits

Reviewing files that changed from the base of the PR and between 9d30029 and 04f2638.

📒 Files selected for processing (14)
  • frontend/packages/console-app/locales/en/console-app.json
  • frontend/packages/console-app/src/components/nodes/node-dashboard/BareMetalInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/VirtualMachinesInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/__tests__/BareMetalInventoryItems.spec.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/__tests__/InventoryCard.spec.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/__tests__/VirtualMachinesInventoryItems.spec.tsx
  • frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/schema/console-extensions.ts
  • frontend/packages/metal3-plugin/console-extensions.json
  • frontend/packages/metal3-plugin/package.json
  • frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx
  • frontend/packages/metal3-plugin/src/hooks/useAccessibleResources.ts
💤 Files with no reviewable changes (4)
  • frontend/packages/console-app/src/components/nodes/node-dashboard/VirtualMachinesInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/tests/VirtualMachinesInventoryItems.spec.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/BareMetalInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/tests/BareMetalInventoryItems.spec.tsx

Comment thread frontend/packages/metal3-plugin/src/hooks/useAccessibleResources.ts
Comment thread frontend/packages/metal3-plugin/src/hooks/useAccessibleResources.ts
@jeff-phillips-18 jeff-phillips-18 force-pushed the inventory-item-extension branch from 04f2638 to 3fdfb21 Compare June 9, 2026 17:48
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jeff-phillips-18
Once this PR has been reviewed and has the lgtm label, please ask for approval from jhadvig. 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

@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/retest

1 similar comment
@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/retest

@jeff-phillips-18 jeff-phillips-18 force-pushed the inventory-item-extension branch from 3fdfb21 to f80360f Compare June 10, 2026 11:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx (1)

105-110: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Inconsistent loading state for CPU inventory item.

The CPU inventory item uses isLoading={!obj} (line 108) while Disk and NIC use isLoading={!loaded} (lines 92, 100). Since obj is already guarded to be non-null after the previous fix, all three should use the consistent loaded flag that reflects when both BareMetalHost and Machine resources have finished loading.

🔧 Proposed fix
       <InventoryItem
         title={t('metal3-plugin~CPU')}
-        isLoading={!obj}
+        isLoading={!loaded}
         count={getHostCPU(obj).count}
       />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx`
around lines 105 - 110, The CPU InventoryItem uses isLoading={!obj} while
Disk/NIC use isLoading={!loaded}, causing inconsistent loading state; update the
CPU item in BareMetalHostInventoryItemsForNode.tsx to use isLoading={!loaded}
instead of isLoading={!obj}, keeping the getHostCPU(obj).count call as-is
(getHostCPU, InventoryItem, obj, and loaded are the relevant symbols) so the
CPU, Disk, and NIC items share the same loaded flag that reflects both
BareMetalHost and Machine resource readiness.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md`:
- Line 63: Update the link fragment for the [console.tab/horizontalNav] entry so
it exactly matches the existing heading anchor: replace the camelCase fragment
"`#consoletabhorizontalNav`" with the all-lowercase "`#consoletabhorizontalnav`" to
satisfy the linter's exact-match requirement and ensure the fragment points to
the heading at the doc's anchor.

In
`@frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx`:
- Around line 55-85: Move the early guard for obj to before any selectors are
called: in the BareMetalHostInventoryItems functional component, check if (!obj)
return null at the top of the function body and only after that call
getNamespace(obj) and getName(obj); this ensures getNamespace/getName (used to
compute namespace, hostName and captured by NICTitleComponent and
DiskTitleComponent useCallbacks) are not invoked with undefined.

---

Duplicate comments:
In
`@frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx`:
- Around line 105-110: The CPU InventoryItem uses isLoading={!obj} while
Disk/NIC use isLoading={!loaded}, causing inconsistent loading state; update the
CPU item in BareMetalHostInventoryItemsForNode.tsx to use isLoading={!loaded}
instead of isLoading={!obj}, keeping the getHostCPU(obj).count call as-is
(getHostCPU, InventoryItem, obj, and loaded are the relevant symbols) so the
CPU, Disk, and NIC items share the same loaded flag that reflects both
BareMetalHost and Machine resource readiness.
🪄 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: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b264aab9-57e2-4429-aef2-a1647373c23e

📥 Commits

Reviewing files that changed from the base of the PR and between 04f2638 and f80360f.

📒 Files selected for processing (16)
  • frontend/packages/console-app/locales/en/console-app.json
  • frontend/packages/console-app/src/components/nodes/node-dashboard/BareMetalInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/VirtualMachinesInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/__tests__/BareMetalInventoryItems.spec.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/__tests__/InventoryCard.spec.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/__tests__/VirtualMachinesInventoryItems.spec.tsx
  • frontend/packages/console-app/src/components/nodes/utils/NodeBareMetalUtils.ts
  • frontend/packages/console-app/src/components/nodes/utils/NodeVmUtils.ts
  • frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
  • frontend/packages/console-dynamic-plugin-sdk/src/schema/console-extensions.ts
  • frontend/packages/metal3-plugin/console-extensions.json
  • frontend/packages/metal3-plugin/package.json
  • frontend/packages/metal3-plugin/src/components/baremetal-nodes/BareMetalHostInventoryItemsForNode.tsx
  • frontend/packages/metal3-plugin/src/hooks/useAccessibleResources.ts
💤 Files with no reviewable changes (5)
  • frontend/packages/console-app/src/components/nodes/node-dashboard/BareMetalInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/tests/BareMetalInventoryItems.spec.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/VirtualMachinesInventoryItems.tsx
  • frontend/packages/console-app/src/components/nodes/node-dashboard/tests/VirtualMachinesInventoryItems.spec.tsx
  • frontend/packages/console-app/src/components/nodes/utils/NodeVmUtils.ts
✅ Files skipped from review due to trivial changes (2)
  • frontend/packages/metal3-plugin/package.json
  • frontend/packages/console-app/locales/en/console-app.json
🚧 Files skipped from review as they are similar to previous changes (5)
  • frontend/packages/metal3-plugin/console-extensions.json
  • frontend/packages/console-dynamic-plugin-sdk/src/schema/console-extensions.ts
  • frontend/packages/console-app/src/components/nodes/node-dashboard/tests/InventoryCard.spec.tsx
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
  • frontend/packages/metal3-plugin/src/hooks/useAccessibleResources.ts

@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/test e2e-gcp-console
/test e2e-playwright

@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/test e2e-playwright

@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/test e2e-gcp-console
/test e2e-playwright

@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/test e2e-playwright

1 similar comment
@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/test e2e-playwright

@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@jeff-phillips-18: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-playwright f80360f link false /test e2e-playwright

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

component/core Related to console core functionality component/metal3 Related to metal3-plugin component/sdk Related to console-plugin-sdk jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated plugin-api-changed Categorizes a PR as containing plugin API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants