Skip to content

METAL-1756: Baremetal platform improvements#30868

Open
honza wants to merge 9 commits intoopenshift:mainfrom
honza:baremetal
Open

METAL-1756: Baremetal platform improvements#30868
honza wants to merge 9 commits intoopenshift:mainfrom
honza:baremetal

Conversation

@honza
Copy link
Member

@honza honza commented Mar 12, 2026

  1. fix unreachable code in skip logic (common.go)
  2. reenable HFS settings check (hosts.go)
  3. add Provisioning CR validation test (hosts.go)
  4. add metal3 pod container health test (hosts.go)
  5. add image-customization-controller deployment test (hosts.go)
  6. update OWNERS
  7. add metal3 api group annotations
  8. use metal3 types instead of unstructured
  9. update metal3 api

Summary by CodeRabbit

  • Tests
    • Migrate baremetal tests to typed Metal3 APIs with new helpers; stronger, clearer status/spec checks
    • Add validations for provisioning configuration, firmware settings and schema retrieval, metal3 pod container health, image-customization-controller deployment, preprovisioning image logic, and high-availability host checks
    • Improve readiness/provisioning assertions and more descriptive, host-specific error messages
  • Chores
    • Updated approvers list for the baremetal test area
    • Bump Metal3 API dependency version used by tests

honza and others added 2 commits March 12, 2026 10:09
The empty string check for provisioningNetwork was unreachable because
an empty string already satisfies the `!= "Disabled"` condition in the
preceding branch. This caused missing Provisioning CRs to skip with
the misleading "Unsupported config" message instead of reporting the
actual problem. Check for empty string first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This assertion was disabled over 3 years ago waiting for a BMO fix to
prevent HostFirmwareSettings with 0 entries. That fix has long since
shipped. Reenable the check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Replace unstructured access with typed Metal3 conversions; add firmware/provisioning helpers; update tests to use metal3v1alpha1 types and new assertions (provisioning, pods, deployment, firmware settings); update OWNERS and bump metal3 apis module version.

Changes

Cohort / File(s) Summary
Baremetal test utilities
test/extended/baremetal/common.go
Removed unstructured field-access helpers and FieldGetterFunc; added toBMH, toHFS, firmwareSchemaClient, and provisioningGVR; switched imports to runtime and metal3v1alpha1; adjusted provisioningNetwork validation ordering.
Host, firmware, and HA tests
test/extended/baremetal/hosts.go, test/extended/baremetal/high_availability.go
Switched assertions to typed metal3v1alpha1 fields/constants via toBMH/toHFS; added checks for provisioning configuration, metal3 pod container readiness/restarts, image-customization-controller deployment, and HostFirmwareSettings validation including firmwareSchema lookup.
Owners metadata
test/extended/baremetal/OWNERS
Updated approvers list: removed two entries and added multiple new approvers (reordered list).
Go module
go.mod
Bumped github.com/metal3-io/baremetal-operator/apis from v0.11.0-alpha.0 to v0.11.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Test structure has critical quality issues including a silent-fail condition check (lines 116-120), missing assertion messages in image-customization-controller test, and inconsistent timeout handling across API calls. Fix FirmwareSettingsValid condition check with foundValid flag validation, add meaningful failure messages to image-customization-controller assertions, and establish consistent timeout patterns for API calls.
Title check ❓ Inconclusive The title 'METAL-1756: Baremetal platform improvements' is vague and generic. It uses the term 'improvements' which does not convey specific meaningful information about the changeset and fails to highlight the primary changes. Use a more descriptive title that clearly summarizes the main changes, such as 'Migrate baremetal tests to typed Metal3 APIs and add health checks' or 'Re-enable firmware settings checks and add provisioning/container health validation.'
✅ Passed checks (2 passed)
Check name Status Explanation
Stable And Deterministic Test Names ✅ Passed All Ginkgo test titles in the pull request are stable and deterministic with no dynamic information.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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

@openshift-ci openshift-ci bot requested review from deads2k and sjenning March 12, 2026 13:18
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)
test/extended/baremetal/hosts.go (1)

181-187: Consider checking init container statuses as well.

The test only verifies ContainerStatuses but not InitContainerStatuses. While init containers should have completed for running pods, checking their restart counts could catch initialization instability issues.

♻️ Optional enhancement to include init containers
 for _, pod := range pods.Items {
     g.By(fmt.Sprintf("checking containers in pod %s", pod.Name))
+    for _, cs := range pod.Status.InitContainerStatuses {
+        o.Expect(cs.RestartCount).To(o.BeNumerically("<", 5), fmt.Sprintf("init container %s in pod %s has restarted %d times", cs.Name, pod.Name, cs.RestartCount))
+    }
     for _, cs := range pod.Status.ContainerStatuses {
         o.Expect(cs.Ready).To(o.BeTrue(), fmt.Sprintf("container %s in pod %s is not ready", cs.Name, pod.Name))
         o.Expect(cs.RestartCount).To(o.BeNumerically("<", 5), fmt.Sprintf("container %s in pod %s has restarted %d times", cs.Name, pod.Name, cs.RestartCount))
     }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/baremetal/hosts.go` around lines 181 - 187, The test currently
iterates pods.Items and only inspects pod.Status.ContainerStatuses; update the
check to also iterate pod.Status.InitContainerStatuses (e.g., inside the same
pod loop) and apply the same expectations (o.Expect(... Ready? only applies to
normal containers; for init containers assert RestartCount < 5 and that the
state indicates terminated/succeeded if appropriate) — specifically reference
the pod variable and the ContainerStatuses and InitContainerStatuses slices and
ensure you call o.Expect on each init cs.RestartCount to be < 5 and include the
same failure message format mentioning cs.Name and pod.Name.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/extended/baremetal/hosts.go`:
- Around line 181-187: The test currently iterates pods.Items and only inspects
pod.Status.ContainerStatuses; update the check to also iterate
pod.Status.InitContainerStatuses (e.g., inside the same pod loop) and apply the
same expectations (o.Expect(... Ready? only applies to normal containers; for
init containers assert RestartCount < 5 and that the state indicates
terminated/succeeded if appropriate) — specifically reference the pod variable
and the ContainerStatuses and InitContainerStatuses slices and ensure you call
o.Expect on each init cs.RestartCount to be < 5 and include the same failure
message format mentioning cs.Name and pod.Name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b3a19b3c-4794-4366-ab1b-6764d24e47ea

📥 Commits

Reviewing files that changed from the base of the PR and between 0097787 and f03ded6.

📒 Files selected for processing (2)
  • test/extended/baremetal/common.go
  • test/extended/baremetal/hosts.go

@honza honza changed the title Baremetal platform improvements METAL-1756: Baremetal platform improvements Mar 12, 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 12, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2026

@honza: This pull request references METAL-1756 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 the "4.22.0" version, but no target version was set.

Details

In response to this:

  1. fix unreachable code in skip logic (common.go)
  2. reenable HFS settings check (hosts.go)
  3. add Provisioning CR validation test (hosts.go)
  4. add metal3 pod container health test (hosts.go)
  5. add image-customization-controller deployment test (hosts.go)

Summary by CodeRabbit

  • Tests
  • Improved test validation for provisioning network configuration handling
  • Re-enabled firmware settings status assertions
  • Added validation tests for provisioning configuration, metal3 pod container health, and image-customization-controller deployment

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

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-metal-ovn-two-node-fencing

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2026

@honza: This pull request references METAL-1756 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 the "4.22.0" version, but no target version was set.

Details

In response to this:

  1. fix unreachable code in skip logic (common.go)
  2. reenable HFS settings check (hosts.go)
  3. add Provisioning CR validation test (hosts.go)
  4. add metal3 pod container health test (hosts.go)
  5. add image-customization-controller deployment test (hosts.go)

Summary by CodeRabbit

  • Tests
  • Improved validation for provisioning network handling (adjusted checks)
  • Re-enabled firmware settings status assertions
  • Added tests for provisioning configuration, metal3 pod container health, and image-customization-controller deployment
  • Chores
  • Updated approvers list for the baremetal test area

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 do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Mar 12, 2026
@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-metal-ovn-two-node-fencing

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2026

@honza: This pull request references METAL-1756 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 the "4.22.0" version, but no target version was set.

Details

In response to this:

  1. fix unreachable code in skip logic (common.go)
  2. reenable HFS settings check (hosts.go)
  3. add Provisioning CR validation test (hosts.go)
  4. add metal3 pod container health test (hosts.go)
  5. add image-customization-controller deployment test (hosts.go)

Summary by CodeRabbit

  • Tests
  • Migrate baremetal tests to typed Metal3 APIs and new helpers for stronger, clearer status/spec checks
  • Added validations for provisioning configuration, firmware settings, metal3 pod container health, image-customization-controller deployment, and preprovisioning image logic
  • Improved readiness/provisioning assertions and more descriptive error messages
  • Chores
  • Updated approvers list for the baremetal test area

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 vendor-update Touching vendor dir or related files label Mar 12, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: honza
Once this PR has been reviewed and has the lgtm label, please assign petr-muller 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

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)
test/extended/baremetal/hosts.go (1)

114-120: Consider verifying the condition exists.

The loop checks that if a FirmwareSettingsValid condition exists, it must be True. However, if the condition is missing entirely, the test passes silently. Consider asserting that the condition is found.

🔧 Optional: Ensure the condition exists
 			g.By("check that hostfirmwaresettings conditions show resource is valid")
 			o.Expect(hfs.Status.Conditions).ToNot(o.BeEmpty())
+			foundValidCondition := false
 			for _, cond := range hfs.Status.Conditions {
 				if cond.Type == string(metal3v1alpha1.FirmwareSettingsValid) {
 					o.Expect(cond.Status).To(o.Equal(metav1.ConditionTrue))
+					foundValidCondition = true
 				}
 			}
+			o.Expect(foundValidCondition).To(o.BeTrue(), "FirmwareSettingsValid condition not found for host %s", bmh.Name)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/baremetal/hosts.go` around lines 114 - 120, The test iterates
hfs.Status.Conditions and only asserts the status if a FirmwareSettingsValid
condition is present, so it silently passes when the condition is missing;
update the check in the test (in hosts.go) to assert the condition is present
and true by scanning hfs.Status.Conditions for
metal3v1alpha1.FirmwareSettingsValid (e.g., set a found flag while looping over
hfs.Status.Conditions), then o.Expect(found).To(o.BeTrue()) and
o.Expect(cond.Status).To(o.Equal(metav1.ConditionTrue)) for the matched
condition (or otherwise fail the test if not found).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/extended/baremetal/hosts.go`:
- Around line 114-120: The test iterates hfs.Status.Conditions and only asserts
the status if a FirmwareSettingsValid condition is present, so it silently
passes when the condition is missing; update the check in the test (in hosts.go)
to assert the condition is present and true by scanning hfs.Status.Conditions
for metal3v1alpha1.FirmwareSettingsValid (e.g., set a found flag while looping
over hfs.Status.Conditions), then o.Expect(found).To(o.BeTrue()) and
o.Expect(cond.Status).To(o.Equal(metav1.ConditionTrue)) for the matched
condition (or otherwise fail the test if not found).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5fb2651c-b953-45f1-bc77-416db20e5136

📥 Commits

Reviewing files that changed from the base of the PR and between a33ea62 and 8bf985b.

⛔ Files ignored due to path filters (4)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwarecomponents_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (4)
  • go.mod
  • test/extended/baremetal/common.go
  • test/extended/baremetal/high_availability.go
  • test/extended/baremetal/hosts.go

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2026

@honza: This pull request references METAL-1756 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 the "4.22.0" version, but no target version was set.

Details

In response to this:

  1. fix unreachable code in skip logic (common.go)
  2. reenable HFS settings check (hosts.go)
  3. add Provisioning CR validation test (hosts.go)
  4. add metal3 pod container health test (hosts.go)
  5. add image-customization-controller deployment test (hosts.go)

Summary by CodeRabbit

  • Tests
  • Migrate baremetal tests to typed Metal3 APIs with new helpers; stronger, clearer status/spec checks
  • Add validations for provisioning configuration, firmware settings and schema retrieval, metal3 pod container health, image-customization-controller deployment, preprovisioning image logic, and high-availability host checks
  • Improve readiness/provisioning assertions and more descriptive, host-specific error messages
  • Chores
  • Updated approvers list for the baremetal test area

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.

🧹 Nitpick comments (1)
test/extended/baremetal/hosts.go (1)

114-120: Consider asserting that the FirmwareSettingsValid condition is found.

The loop searches for the FirmwareSettingsValid condition but doesn't fail if the condition is absent. If this condition is expected to always be present, consider adding an assertion.

♻️ Optional: Add assertion that condition was found
 			g.By("check that hostfirmwaresettings conditions show resource is valid")
 			o.Expect(hfs.Status.Conditions).ToNot(o.BeEmpty())
+			foundValid := false
 			for _, cond := range hfs.Status.Conditions {
 				if cond.Type == string(metal3v1alpha1.FirmwareSettingsValid) {
 					o.Expect(cond.Status).To(o.Equal(metav1.ConditionTrue))
+					foundValid = true
 				}
 			}
+			o.Expect(foundValid).To(o.BeTrue(), "FirmwareSettingsValid condition not found for host %s", bmh.Name)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/baremetal/hosts.go` around lines 114 - 120, The test iterates
hfs.Status.Conditions looking for the FirmwareSettingsValid condition but never
asserts that it was found; update the check in the test (around
hfs.Status.Conditions loop) to set a boolean (e.g., foundFirmwareSettingsValid)
when cond.Type == string(metal3v1alpha1.FirmwareSettingsValid) and cond.Status
== metav1.ConditionTrue, then after the loop assert that
foundFirmwareSettingsValid is true (using the same o.Expect helper) so the test
fails if the condition is missing or not True.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/extended/baremetal/hosts.go`:
- Around line 114-120: The test iterates hfs.Status.Conditions looking for the
FirmwareSettingsValid condition but never asserts that it was found; update the
check in the test (around hfs.Status.Conditions loop) to set a boolean (e.g.,
foundFirmwareSettingsValid) when cond.Type ==
string(metal3v1alpha1.FirmwareSettingsValid) and cond.Status ==
metav1.ConditionTrue, then after the loop assert that foundFirmwareSettingsValid
is true (using the same o.Expect helper) so the test fails if the condition is
missing or not True.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1e597aa8-7257-41d5-9fc6-dd1cf416c0bf

📥 Commits

Reviewing files that changed from the base of the PR and between 8bf985b and cee506a.

⛔ Files ignored due to path filters (4)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwarecomponents_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (5)
  • go.mod
  • test/extended/baremetal/OWNERS
  • test/extended/baremetal/common.go
  • test/extended/baremetal/high_availability.go
  • test/extended/baremetal/hosts.go

@openshift-ci openshift-ci bot removed the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Mar 12, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2026

@honza: This pull request references METAL-1756 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 the "4.22.0" version, but no target version was set.

Details

In response to this:

  1. fix unreachable code in skip logic (common.go)
  2. reenable HFS settings check (hosts.go)
  3. add Provisioning CR validation test (hosts.go)
  4. add metal3 pod container health test (hosts.go)
  5. add image-customization-controller deployment test (hosts.go)

Summary by CodeRabbit

  • Tests
  • Migrate baremetal tests to typed Metal3 APIs with new helpers; stronger, clearer status/spec checks
  • Add validations for provisioning configuration, firmware settings and schema retrieval, metal3 pod container health, image-customization-controller deployment, preprovisioning image logic, and high-availability host checks
  • Improve readiness/provisioning assertions and more descriptive, host-specific error messages
  • Chores
  • Updated approvers list for the baremetal test area
  • Bump Metal3 API dependency version used by tests

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

🧹 Nitpick comments (1)
test/extended/baremetal/common.go (1)

104-106: Consider reusing provisioningGVR() in getProvisioningNetwork.

The same GVR is defined inline at line 67 in getProvisioningNetwork. Consider refactoring to use this helper for consistency.

♻️ Suggested refactor
 func getProvisioningNetwork(dc dynamic.Interface) string {
-	provisioningGVR := schema.GroupVersionResource{Group: "metal3.io", Resource: "provisionings", Version: "v1alpha1"}
-	provisioningClient := dc.Resource(provisioningGVR)
+	provisioningClient := dc.Resource(provisioningGVR())
 	provisioningConfig, err := provisioningClient.Get(context.Background(), "provisioning-configuration", metav1.GetOptions{})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/baremetal/common.go` around lines 104 - 106, The
GroupVersionResource for provisionings is duplicated; replace the inline GVR in
getProvisioningNetwork with a call to the existing provisioningGVR() helper to
avoid duplication. In getProvisioningNetwork, remove the inline
schema.GroupVersionResource{Group: "metal3.io", Resource: "provisionings",
Version: "v1alpha1"} and use provisioningGVR() when building the dynamic client
request and any comparisons so all code references the single provisioningGVR()
function.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/extended/baremetal/hosts.go`:
- Around line 115-120: The test currently iterates hfs.Status.Conditions and
only asserts when it finds a FirmwareSettingsValid entry, which lets the test
pass if that condition is absent; modify the check to first assert that a
condition with Type == string(metal3v1alpha1.FirmwareSettingsValid) exists
(e.g., set a bool found flag while iterating) and then assert its Status equals
metav1.ConditionTrue using o.Expect; update the block around
hfs.Status.Conditions and the loop that inspects cond.Type/cond.Status so the
test fails when the FirmwareSettingsValid condition is missing or not
ConditionTrue.

---

Nitpick comments:
In `@test/extended/baremetal/common.go`:
- Around line 104-106: The GroupVersionResource for provisionings is duplicated;
replace the inline GVR in getProvisioningNetwork with a call to the existing
provisioningGVR() helper to avoid duplication. In getProvisioningNetwork, remove
the inline schema.GroupVersionResource{Group: "metal3.io", Resource:
"provisionings", Version: "v1alpha1"} and use provisioningGVR() when building
the dynamic client request and any comparisons so all code references the single
provisioningGVR() function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d1314e5c-923b-4e1e-adbe-1cdc886573b3

📥 Commits

Reviewing files that changed from the base of the PR and between cee506a and ba5b163.

⛔ Files ignored due to path filters (4)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/baremetalhost_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/metal3-io/baremetal-operator/apis/metal3.io/v1alpha1/hostfirmwarecomponents_types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (5)
  • go.mod
  • test/extended/baremetal/OWNERS
  • test/extended/baremetal/common.go
  • test/extended/baremetal/high_availability.go
  • test/extended/baremetal/hosts.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • go.mod
  • test/extended/baremetal/high_availability.go

@honza honza force-pushed the baremetal branch 2 times, most recently from 51674be to 2f2b7aa Compare March 12, 2026 17:40
@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-metal-ovn-two-node-fencing

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 12, 2026

@honza: This pull request references METAL-1756 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 the "4.22.0" version, but no target version was set.

Details

In response to this:

  1. fix unreachable code in skip logic (common.go)
  2. reenable HFS settings check (hosts.go)
  3. add Provisioning CR validation test (hosts.go)
  4. add metal3 pod container health test (hosts.go)
  5. add image-customization-controller deployment test (hosts.go)
  6. update OWNERS
  7. add metal3 api group annotations
  8. use metal3 types instead of unstructured
  9. update metal3 api

Summary by CodeRabbit

  • Tests
  • Migrate baremetal tests to typed Metal3 APIs with new helpers; stronger, clearer status/spec checks
  • Add validations for provisioning configuration, firmware settings and schema retrieval, metal3 pod container health, image-customization-controller deployment, preprovisioning image logic, and high-availability host checks
  • Improve readiness/provisioning assertions and more descriptive, host-specific error messages
  • Chores
  • Updated approvers list for the baremetal test area
  • Bump Metal3 API dependency version used by tests

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.

@elfosardo
Copy link
Contributor

/test e2e-metal-ipi-ovn-ipv6

@openshift-trt
Copy link

openshift-trt bot commented Mar 13, 2026

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: 2f2b7aa

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have a valid provisioning configuration [Suite:openshift/conformance/parallel]" is a new test that failed 2 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have an image-customization-controller deployment [Suite:openshift/conformance/parallel]" is a new test that failed 2 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have hostfirmwaresetting resources [Suite:openshift/conformance/parallel]" is a new test that failed 2 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ovn-two-node-fencing High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have a valid provisioning configuration [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ovn-two-node-fencing High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have an image-customization-controller deployment [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit

New tests seen in this PR at sha: 2f2b7aa

  • "[sig-installer][Feature:baremetal][apigroup:metal3.io] Baremetal/OpenStack/vSphere/None/AWS/Azure/GCP platforms have a metal3 deployment [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 3, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have a valid provisioning configuration [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 0, Fail: 3, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have all metal3 pod containers running [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 3, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have an image-customization-controller deployment [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 0, Fail: 3, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have baremetalhost resources [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 3, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have hostfirmwaresetting resources [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 1, Fail: 2, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have preprovisioning images for workers [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 3, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should not allow updating BootMacAddress [Suite:openshift/conformance/parallel]" [Total: 3, Pass: 3, Fail: 0, Flake: 0]

e2eskipper.Skipf("Unable to read ProvisioningNetwork from Provisioning CR")
} else {
return
} else if provisioningNetwork != "Disabled" {
Copy link
Member

Choose a reason for hiding this comment

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

While we've never announced, we actually support provisioning network on "none" since 4.20 (I think)

Copy link
Member

Choose a reason for hiding this comment

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

(it does not have to be fixed here, to be clear)

@dtantsur
Copy link
Member

dtantsur commented Mar 13, 2026

Looks good, but the new and updated tests fail in the v6 job.

honza and others added 7 commits March 13, 2026 10:52
The Provisioning CR (provisioning-configuration) is the key resource
managed by cluster-baremetal-operator, yet it had zero test coverage.
Add a test that verifies it exists and has a provisioningNetwork spec
field.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

fix
The existing test only checks that the metal3 deployment has 1
available replica. Add a test that verifies every container in the
metal3 pod is Ready and hasn't been crash-looping (< 5 restarts).
This catches issues with individual containers like ironic that the
deployment-level check misses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The image-customization-controller is deployed by CBO on baremetal
platform as the metal3-image-customization deployment but had zero
test coverage. Add a test that verifies the deployment exists, has 1
available replica, and carries the expected CBO ownership annotation
and label.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All baremetal test suites use metal3.io API resources but were missing
the [apigroup:metal3.io] annotation needed for proper CI filtering.
Also add [apigroup:config.openshift.io] to the baremetal-only suite
which queries the Infrastructure resource.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace manual unstructured field access (expectStringField,
getStringField, expectBoolField, etc.) with typed metal3.io/v1alpha1
structs using runtime.DefaultUnstructuredConverter. This catches API
drift at compile time and makes the tests much more readable.

The dynamic client is still used for API calls since there is no
generated clientset for metal3.io, but results are now converted to
BareMetalHost and HostFirmwareSettings typed structs for assertions.

The Provisioning CR and BootMacAddress update tests retain unstructured
access where needed (Provisioning has no vendored type, and the update
test requires manipulating raw unstructured objects).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update from v0.11.0-alpha.0 to the v0.11.0 release. No struct field
changes affect our tests — the only API change is GetChecksum()
returning error instead of bool. No transitive dependency changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-metal-ovn-two-node-fencing

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 13, 2026

@honza: The following tests 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-gcp-ovn 72e7cd4 link true /test e2e-gcp-ovn
ci/prow/e2e-metal-ovn-two-node-fencing 72e7cd4 link false /test e2e-metal-ovn-two-node-fencing
ci/prow/e2e-aws-ovn-microshift-serial 72e7cd4 link true /test e2e-aws-ovn-microshift-serial
ci/prow/e2e-aws-ovn-microshift 72e7cd4 link true /test e2e-aws-ovn-microshift
ci/prow/e2e-aws-ovn-fips 72e7cd4 link true /test e2e-aws-ovn-fips
ci/prow/e2e-metal-ipi-ovn-ipv6 72e7cd4 link true /test e2e-metal-ipi-ovn-ipv6

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-trt
Copy link

openshift-trt bot commented Mar 13, 2026

Risk analysis has seen new tests most likely introduced by this PR.
Please ensure that new tests meet guidelines for naming and stability.

New Test Risks for sha: 72e7cd4

Job Name New Test Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have a metal3-image-customization deployment [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have hostfirmwaresetting resources [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit
pull-ci-openshift-origin-main-e2e-metal-ovn-two-node-fencing High - "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have a metal3-image-customization deployment [Suite:openshift/conformance/parallel]" is a new test that failed 1 time(s) against the current commit

New tests seen in this PR at sha: 72e7cd4

  • "[sig-installer][Feature:baremetal][apigroup:metal3.io] Baremetal/OpenStack/vSphere/None/AWS/Azure/GCP platforms have a metal3 deployment [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have a metal3-image-customization deployment [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 0, Fail: 2, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have a valid provisioning configuration [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have all metal3 pod containers running [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have baremetalhost resources [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have hostfirmwaresetting resources [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 1, Fail: 1, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should have preprovisioning images for workers [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]
  • "[sig-installer][Feature:baremetal][apigroup:metal3.io][apigroup:config.openshift.io] Baremetal platform should not allow updating BootMacAddress [Suite:openshift/conformance/parallel]" [Total: 2, Pass: 2, Fail: 0, Flake: 0]

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. vendor-update Touching vendor dir or related files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants