Skip to content

CONSOLE-5284: Put new node inventory items behind tech-preview#16414

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jeff-phillips-18:node-inventory-items-flagged
Jun 1, 2026
Merged

CONSOLE-5284: Put new node inventory items behind tech-preview#16414
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jeff-phillips-18:node-inventory-items-flagged

Conversation

@jeff-phillips-18
Copy link
Copy Markdown
Member

@jeff-phillips-18 jeff-phillips-18 commented May 8, 2026

Analysis / Root cause:
New node inventory items (bare metal hardware metrics and virtual machines) need to be gated behind the tech-preview NODE_MGMT_V1 feature flag as part of the node management v1 feature rollout.

Solution description:

  • Added FLAG_NODE_MGMT_V1 flag check to the node dashboard InventoryCard component
  • Wrapped BareMetalInventoryItems and virtual machine inventory items in a conditional render based on the flag
  • This ensures the new inventory items (disks, NICs, CPUs, and VMs) are only displayed when the node management v1 feature is enabled via tech-preview

**Screenshots **:

*** Before / With Tech-Preview:
image

*** After / without Tech-Preview
image

Test setup:

  1. Ensure a cluster with nodes is available
  2. Test with the NODE_MGMT_V1 feature flag both enabled and disabled
  3. For bare metal tests, ensure a node with an associated BareMetalHost resource
  4. For VM tests, ensure KubeVirt plugin is active and VMs are scheduled on the node

Test cases:

  • With NODE_MGMT_V1 flag disabled: BareMetalInventoryItems and VM inventory items should not be displayed on node dashboard
  • With NODE_MGMT_V1 flag enabled: BareMetalInventoryItems (disks, NICs, CPUs) should be displayed when a BareMetalHost is associated with the node
  • With NODE_MGMT_V1 flag enabled: VM inventory count should be displayed when KubeVirt plugin is active and VMs exist on the node
  • Pod inventory item continues to display correctly regardless of flag state

Browser conformance:

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

Additional info:
This change is part of the larger node management v1 feature work tracked in CONSOLE-5284. The feature flag allows for controlled rollout and testing of the new inventory items.

Reviewers and assignees:
/cc @jhadvig

Summary by CodeRabbit

  • New Features
    • Inventory section display is now feature-gated, enabling selective visibility of node management and virtual machine inventory details.

@openshift-ci openshift-ci Bot requested a review from jhadvig May 8, 2026 13:45
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented May 8, 2026

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

Details

In response to this:

Analysis / Root cause:
New node inventory items (bare metal hardware metrics and virtual machines) need to be gated behind the tech-preview NODE_MGMT_V1 feature flag as part of the node management v1 feature rollout.

Solution description:

  • Added FLAG_NODE_MGMT_V1 flag check to the node dashboard InventoryCard component
  • Wrapped BareMetalInventoryItems and virtual machine inventory items in a conditional render based on the flag
  • This ensures the new inventory items (disks, NICs, CPUs, and VMs) are only displayed when the node management v1 feature is enabled via tech-preview

**Screenshots **:

*** Before / With Tech-Preview:
image

*** After / without Tech-Preview
image

Test setup:

  1. Ensure a cluster with nodes is available
  2. Test with the NODE_MGMT_V1 feature flag both enabled and disabled
  3. For bare metal tests, ensure a node with an associated BareMetalHost resource
  4. For VM tests, ensure KubeVirt plugin is active and VMs are scheduled on the node

Test cases:

  • With NODE_MGMT_V1 flag disabled: BareMetalInventoryItems and VM inventory items should not be displayed on node dashboard
  • With NODE_MGMT_V1 flag enabled: BareMetalInventoryItems (disks, NICs, CPUs) should be displayed when a BareMetalHost is associated with the node
  • With NODE_MGMT_V1 flag enabled: VM inventory count should be displayed when KubeVirt plugin is active and VMs exist on the node
  • Pod inventory item continues to display correctly regardless of flag state

Browser conformance:

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

Additional info:
This change is part of the larger node management v1 feature work tracked in CONSOLE-5284. The feature flag allows for controlled rollout and testing of the new inventory items.

Reviewers and assignees:
/cc @jhadvig

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 component/core Related to console core functionality label May 8, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

📝 Walkthrough

Walkthrough

The InventoryCard component gates inventory display sections behind a feature flag (FLAG_NODE_MGMT_V1) using the useFlag hook. A new nodeMgmtV1Enabled boolean is introduced to conditionally render the BareMetalInventoryItems section and the virtual machines inventory group (including the VM count link and associated loading/error states). The underlying rendering logic for virtual machines remains unchanged; it is now nested under the feature-flag condition.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the Jira issue CONSOLE-5284 and accurately describes the main change: gating new node inventory items behind a feature flag for tech-preview rollout.
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 Custom check is not applicable. PR modifies only React/TypeScript component code and Jest tests, not Ginkgo tests. Ginkgo is a Go testing framework; this PR contains no Go test changes.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code. Custom check is for Ginkgo test quality; not applicable. PR modifies TypeScript/React components and includes Jest tests.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. The check applies only to new e2e tests; this PR modifies only a React component file (InventoryCard.tsx). Not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds no Ginkgo e2e tests—it modifies frontend React component InventoryCard.tsx only. SNO test compatibility check is not applicable to non-test code changes.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only a React UI component with feature flag gating. No deployment manifests, operator code, controllers, or scheduling constraints. Not applicable to topology-aware scheduling check.
Ote Binary Stdout Contract ✅ Passed Check not applicable. PR modifies frontend React/TS component. OTE stdout contract applies to Go binaries (main, init, TestMain, suite setup), not frontend components.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies React/TypeScript frontend component (InventoryCard.tsx), not adding Ginkgo e2e tests. Custom check is inapplicable to frontend code changes.
Description check ✅ Passed The PR description comprehensively covers all required template sections with clear analysis, solution details, screenshots, test setup, test cases, browser conformance verification, and additional context.

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

Copy link
Copy Markdown
Contributor

@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: 1

🤖 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-app/src/components/nodes/node-dashboard/InventoryCard.tsx`:
- Around line 61-64: The VM watch hook useWatchVirtualMachineInstances is being
invoked unconditionally (creating side effects) even when FLAG_NODE_MGMT_V1 is
off; modify the hook or its usage so watching is gated by the feature flag:
update useWatchVirtualMachineInstances to accept an enabled boolean (e.g.,
useWatchVirtualMachineInstances(nodeName: string, enabled = true)) or, if you
cannot change the hook, only call it when nodeMgmtV1Enabled && showVms and
provide safe fallback values for vms, vmsLoaded, and vmsLoadError; in
InventoryCard.tsx replace the unconditional call with a guarded call using
nodeMgmtV1Enabled (and showVms) so the VM watch traffic only starts when
FLAG_NODE_MGMT_V1 is true.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 3569d736-5944-47b0-ac9a-35fe6aa34216

📥 Commits

Reviewing files that changed from the base of the PR and between 2291108 and 7c39c36.

📒 Files selected for processing (1)
  • frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx
📜 Review details
🔇 Additional comments (1)
frontend/packages/console-app/src/components/nodes/node-dashboard/InventoryCard.tsx (1)

95-124: Good boundary for tech-preview UI gating.

This correctly keeps Pods/Images always visible while placing bare metal + VM inventory UI behind nodeMgmtV1Enabled.

@jeff-phillips-18 jeff-phillips-18 force-pushed the node-inventory-items-flagged branch 2 times, most recently from 8ac9499 to 43a209c Compare May 11, 2026 12:21
@openshift-ci openshift-ci Bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label May 11, 2026
Copy link
Copy Markdown
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

Clean, well-scoped change. The feature flag gating is correct — no items leak when NODE_MGMT_V1 is off, pod inventory is unaffected, and the refactoring of VM inventory into its own component is a solid improvement. All dead imports properly cleaned up, no barrel import violations, i18n keys preserved.

The only gap is test coverage for the new component and the flag-gating behavior. Once tests are added this is good to go. See inline comments.

Comment on lines +89 to +94
{nodeMgmtV1Enabled && (
<>
<BareMetalInventoryItems />
<VirtualMachinesInventoryItems />
</>
)}
Copy link
Copy Markdown
Member

@jhadvig jhadvig May 19, 2026

Choose a reason for hiding this comment

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

The core behavioral change of this PR — gating bare metal and VM items behind NODE_MGMT_V1 — has no automated test coverage. Please add tests for InventoryCard verifying:

  • With NODE_MGMT_V1 off: BareMetalInventoryItems and VirtualMachinesInventoryItems do not render
  • With NODE_MGMT_V1 on: both render
  • Pod inventory always renders regardless of flag state

);
};

export default VirtualMachinesInventoryItems;
Copy link
Copy Markdown
Member

@jhadvig jhadvig May 19, 2026

Choose a reason for hiding this comment

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

New component without unit tests. There's an existing BareMetalInventoryItems.spec.tsx that establishes a clear testing pattern — a matching VirtualMachinesInventoryItems.spec.tsx should be added for parity. At minimum:

  • Renders nothing when kubevirt plugin is not active
  • Renders VM count with link when kubevirt is active and VMs exist
  • Handles loading and error states


const [vms, vmsLoaded, vmsLoadError] = useWatchVirtualMachineInstances(obj.metadata.name);

if (!showVms) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 Good extraction. The early-return guard pattern mirrors BareMetalInventoryItems nicely, and useWatchVirtualMachineInstances already handles the disabled case internally (passes undefined to useK8sWatchResource when kubevirt is inactive), so no API watch leaks here despite the hook being called before the guard — this is the correct approach given Rules of Hooks.

@jeff-phillips-18 jeff-phillips-18 force-pushed the node-inventory-items-flagged branch from 43a209c to b5bd35d Compare May 19, 2026 18:37
@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented May 20, 2026

QA Verification Evidence

Details
Branch node-inventory-items-flagged
Baseline main @ ed9a644125
Candidate node-inventory-items-flagged @ b5bd35dc89
Verified 2026-05-20
Browser Playwright 1.60.0 / Chrome for Testing 148.0.7778.96 (playwright chromium v1223)
OS Darwin 25.4.0
Jira CONSOLE-5284

Verification Steps

# Route Action Status
number route action status
1 /k8s/cluster/nodes Navigate, wait load pass
2 /k8s/cluster/nodes/ Navigate to dashboard pass
3 /k8s/cluster/nodes/ Scroll to Inventory card pass
4 /k8s/cluster/nodes/ Navigate, scroll to Inventory card pass
5 Console errors browser_console_messages pass
Animated overview (click to expand)
Baseline Candidate
Step 1: description (status)
Baseline (main) Candidate (node-inventory-items-flagged)
Step 2: Node list page (pass)
Baseline (main) Candidate (node-inventory-items-flagged)
Step 3: Worker node dashboard (pass)
Baseline (main) Candidate (node-inventory-items-flagged)
Step 4: Worker node Inventory card (flag disabled) (pass)
Baseline (main) Candidate (node-inventory-items-flagged)

Warning

This verification was performed by an AI agent. Results may contain false positives or miss
regressions that require human judgment. Always review the screenshots manually before approving.

Automated QA verification by Claude Code

@jeff-phillips-18 jeff-phillips-18 requested a review from jhadvig May 26, 2026 11:16
Copy link
Copy Markdown
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

/lgtm
/verified by @jhadvig
/approve

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 27, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@jhadvig: This PR has been marked as verified by @jhadvig.

Details

In response to this:

/lgtm
/verified by @jhadvig
/approve

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 lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 27, 2026
@jhadvig jhadvig added the plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer label May 27, 2026
@rh-joshbeverly
Copy link
Copy Markdown

/label px-approved

@openshift-ci openshift-ci Bot added the px-approved Signifies that Product Support has signed off on this PR label May 29, 2026
Copy link
Copy Markdown

@jseseCCS jseseCCS left a comment

Choose a reason for hiding this comment

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

looked over user-facing strings; left minor suggestions inline.

approving in good faith that you'll consider these comments, apply them as appropriate. Thanks!

"Network transfer": "Network transfer",
"Pod count": "Pod count",
"Virtual machines": "Virtual machines",
"This count reflects your access permissions and might not include all virtual machines.": "This count reflects your access permissions and might not include all virtual machines.",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

396/413: "This count reflects your access permissions and might not include all virtual machines" leads w/technical explanation instead of user impact. rewrite to focus on UX?

--> You might not see all virtual machines, depending on your access permissions.

OR

The total shown is based on your access permissions and might not include all virtual machines.

<DescriptionListTermHelp
text={t('console-app~Virtual machines')}
textHelp={t(
'console-app~This count reflects your access permissions and might not include all virtual machines.',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ditto my comment in preceding file

@jseseCCS
Copy link
Copy Markdown

/label docs-approved

@openshift-ci openshift-ci Bot added the docs-approved Signifies that Docs has signed off on this PR label May 29, 2026
@jeff-phillips-18 jeff-phillips-18 force-pushed the node-inventory-items-flagged branch from b5bd35d to 76bb8b0 Compare May 29, 2026 14:56
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label May 29, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 29, 2026
@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented Jun 1, 2026

/lgtm
/verified by @jhadvig

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@jhadvig: This PR has been marked as verified by @jhadvig.

Details

In response to this:

/lgtm
/verified by @jhadvig

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 lgtm Indicates that a PR is ready to be merged. label Jun 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 1, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jeff-phillips-18, jhadvig, jseseCCS

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
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 509d5d7 and 2 for PR HEAD 76bb8b0 in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 1, 2026

@jeff-phillips-18: all tests passed!

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit 377ea54 into openshift:main Jun 1, 2026
9 checks passed
@jeff-phillips-18
Copy link
Copy Markdown
Member Author

/cherry-pick release-4.22

@openshift-cherrypick-robot
Copy link
Copy Markdown

@jeff-phillips-18: new pull request created: #16524

Details

In response to this:

/cherry-pick release-4.22

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality docs-approved Signifies that Docs has signed off on this PR 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 lgtm Indicates that a PR is ready to be merged. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants