Skip to content

(WIP) MCO-2279#6050

Draft
isabella-janssen wants to merge 3 commits into
openshift:mainfrom
isabella-janssen:sno-readiness
Draft

(WIP) MCO-2279#6050
isabella-janssen wants to merge 3 commits into
openshift:mainfrom
isabella-janssen:sno-readiness

Conversation

@isabella-janssen
Copy link
Copy Markdown
Member

@isabella-janssen isabella-janssen commented May 14, 2026

- What I did

- How to verify it

- Description for the changelog

Summary by CodeRabbit

  • Tests
    • Added clarifying comments to test cases indicating SNO compatibility, improving maintainability and clarity without altering behavior.
    • Updated test utilities to use a more accurate cluster topology source, improving reliability of single-node detection in tests.
    • Added informational debug logging across several tests to record execution flow and selected resource names, aiding troubleshooting.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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: LGTM mode

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 14, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: isabella-janssen

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-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 14, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: c3056d94-7c7d-4b81-9513-c4e825d09afe

📥 Commits

Reviewing files that changed from the base of the PR and between ed2a241 and 8a55aa1.

📒 Files selected for processing (3)
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/mco_ocb.go
  • test/extended-priv/mco_osimagestream.go
✅ Files skipped from review due to trivial changes (3)
  • test/extended-priv/mco_ocb.go
  • test/extended-priv/mco_osimagestream.go
  • test/extended-priv/machineconfigpool.go

Walkthrough

Added clarifying SNO compatibility comments to five ImageModeStatusReporting test cases, changed the JSONPath used by IsSingleNodeTopology to read status.controlPlaneTopology, and added informational logging in several extended-priv tests.

Changes

ImageModeStatusReporting & test utilities

Layer / File(s) Summary
Test case clarification comments
test/extended/image_mode_status_reporting.go
Five comment lines added before individual test cases documenting SNO compatibility: three marked "Will not run on SNO" and two marked "Will run on SNO".
clusters.IsSingleNodeTopology JSONPath update
test/extended-priv/util/clusters.go
Changed the oc get infrastructure cluster JSONPath for control-plane topology from status.platformStatus.controlPlaneTopology to status.controlPlaneTopology.
GetCompactCompatiblePool logging
test/extended-priv/machineconfigpool.go
Added informational logger statements around the IsCompactOrSNOCluster(oc) check in GetCompactCompatiblePool (logs before return and after the condition).
mco_ocb debug log
test/extended-priv/mco_ocb.go
Added a logger.Infof call to log the current MCP name in the containerfile MachineOSConfig test.
mco_osimagestream additional logs
test/extended-priv/mco_osimagestream.go
Added logs for createdCustomPoolName and the selected MCP name in multiple osimagestream test cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title '(WIP) MCO-2279' is a work-in-progress indicator with a ticket reference only; it does not describe the actual changes made to the codebase. Replace with a descriptive title summarizing the main changes, such as 'Add logging and update control plane topology query path for SNO testing' or similar.
Test Structure And Quality ⚠️ Warning Test assertion at line 48 in clusters.go lacks diagnostic message: o.Expect(err).NotTo(o.HaveOccurred()) should include context explaining what operation failed. Add descriptive message to assertion at line 48: o.Expect(err).NotTo(o.HaveOccurred(), "failed to check feature gate state")
Microshift Test Compatibility ⚠️ Warning test/extended-priv/mco_ocb.go adds 5 new tests using MachineOSConfig/MachineOSBuild (machineconfiguration.openshift.io APIs) without MicroShift protection tags or skip mechanisms. Add [apigroup:machineconfiguration.openshift.io] tags to all It() test names in mco_ocb.go, or add [Skipped:MicroShift] labels if tests shouldn't run on MicroShift.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning New tests have IPv6 and disconnected network issues: machineconfigpool.go uses fmt.Sprintf for URLs without IPv6 brackets; mco_ocb.go pulls from external quay.io registry. Use net.JoinHostPort() for IPv6-safe URL construction. Replace external quay.io references with internal registry or add [Skipped:Disconnected] tag.
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 All Ginkgo test names are stable and deterministic. No dynamic information (timestamps, UUIDs, node names, IPs, or variable interpolation) found in 17+ test cases across modified files.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds only comments and logging to existing tests; no new Ginkgo e2e tests (It(), Describe(), etc.) are introduced, so the SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR introduces test file additions with SNO-readiness comments and logging; no deployment manifests or operator controller code introduce new scheduling constraints that would break non-HA topologies.
Ote Binary Stdout Contract ✅ Passed All logger.Infof calls route through ginkgo.GinkgoWriter via logext; all within test blocks, not process-level code. No direct stdout writes. No OTE contract violation.

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

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/extended/image_mode_status_reporting.go (1)

42-56: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add explicit SNO protection to match coding guidelines.

The comment documents that this test won't run on SNO, and the test does skip when there are no worker nodes (Line 50-51). However, the coding guidelines require explicit SNO protection using one of these mechanisms:

  • [Skipped:SingleReplicaTopology] label in the test name
  • exutil.IsSingleNode() check with g.Skip()
  • skipOnSingleNodeTopology() call

The current implicit protection (checking for worker nodes) works but isn't the standard pattern and could be fragile if refactored.

🔧 Suggested explicit SNO protection

Option 1: Add label to test name:

-	// Will not run on SNO
-	g.It("MachineConfigNode properties should match the associated node properties when OCB is enabled in a custom MCP [apigroup:machineconfiguration.openshift.io]", func() {
+	g.It("MachineConfigNode properties should match the associated node properties when OCB is enabled in a custom MCP [apigroup:machineconfiguration.openshift.io][Skipped:SingleReplicaTopology]", func() {

Option 2: Add explicit check at test start:

 	g.It("MachineConfigNode properties should match the associated node properties when OCB is enabled in a custom MCP [apigroup:machineconfiguration.openshift.io]", func() {
+		if exutil.IsSingleNode() {
+			g.Skip("Test requires multiple worker nodes")
+		}
+		
 		// Create machine config client for test

As per coding guidelines: "Flag tests that expect multiple control-plane/master nodes, multiple worker nodes... Do NOT flag Single Node OpenShift (SNO) test compatibility if test is already protected by: test name includes [Skipped:SingleReplicaTopology] label, test body contains exutil.IsSingleNode() check with g.Skip()..."

🤖 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 `@test/extended/image_mode_status_reporting.go` around lines 42 - 56, The test
lacks explicit Single Node OpenShift (SNO) protection; keep the existing
worker-MCP check (DoesMachineConfigPoolHaveMachines) but add one of the approved
SNO guards before running runImageModeMCNTest: either add the
`[Skipped:SingleReplicaTopology]` label to the g.It test name, or call
exutil.IsSingleNode() with g.Skip(), or call skipOnSingleNodeTopology() at the
start of the test body; place the guard immediately after creating
machineConfigClient and before the worker-MCP check so the test follows the
coding guideline and still calls runImageModeMCNTest(oc, machineConfigClient,
"infra", "", false) only when appropriate.
♻️ Duplicate comments (2)
test/extended/image_mode_status_reporting.go (2)

74-88: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add explicit SNO protection.

Same issue as the tests at lines 42-56 and 58-72: this test requires worker nodes and will skip on SNO, but lacks explicit SNO protection per coding guidelines. Consider adding [Skipped:SingleReplicaTopology] label or an exutil.IsSingleNode() check.

🤖 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 `@test/extended/image_mode_status_reporting.go` around lines 74 - 88, This test
lacks explicit Single Node (SNO) protection: add an SNO guard similar to the
other tests by either tagging the test with `[Skipped:SingleReplicaTopology]` in
the g.It description or programmatically skipping when single-node, e.g. call
exutil.IsSingleNode() before the worker-MCP check; update the test case that
calls runImageModeMCNTest(oc, machineConfigClient, "infra", "90-infra-testfile",
false) so it returns/skips on single-replica topology and keep the existing
DoesMachineConfigPoolHaveMachines(machineConfigClient, "worker") check.

58-72: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add explicit SNO protection.

Same issue as the test at lines 42-56: this test requires worker nodes and will skip on SNO, but lacks explicit SNO protection per coding guidelines. Consider adding [Skipped:SingleReplicaTopology] label or an exutil.IsSingleNode() check.

🤖 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 `@test/extended/image_mode_status_reporting.go` around lines 58 - 72, The test
"MachineConfigNode conditions should properly transition..." lacks explicit
Single Node OpenShift (SNO) protection; add SNO gating before it runs by either
adding the [Skipped:SingleReplicaTopology] label to the g.It declaration or
inserting an explicit exutil.IsSingleNode() check at the top of the test body
(before calling DoesMachineConfigPoolHaveMachines and runImageModeMCNTest) to
skip the test on SNO clusters; reference the test by its g.It description and
the functions DoesMachineConfigPoolHaveMachines and runImageModeMCNTest when
making the change.
🤖 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.

Outside diff comments:
In `@test/extended/image_mode_status_reporting.go`:
- Around line 42-56: The test lacks explicit Single Node OpenShift (SNO)
protection; keep the existing worker-MCP check
(DoesMachineConfigPoolHaveMachines) but add one of the approved SNO guards
before running runImageModeMCNTest: either add the
`[Skipped:SingleReplicaTopology]` label to the g.It test name, or call
exutil.IsSingleNode() with g.Skip(), or call skipOnSingleNodeTopology() at the
start of the test body; place the guard immediately after creating
machineConfigClient and before the worker-MCP check so the test follows the
coding guideline and still calls runImageModeMCNTest(oc, machineConfigClient,
"infra", "", false) only when appropriate.

---

Duplicate comments:
In `@test/extended/image_mode_status_reporting.go`:
- Around line 74-88: This test lacks explicit Single Node (SNO) protection: add
an SNO guard similar to the other tests by either tagging the test with
`[Skipped:SingleReplicaTopology]` in the g.It description or programmatically
skipping when single-node, e.g. call exutil.IsSingleNode() before the worker-MCP
check; update the test case that calls runImageModeMCNTest(oc,
machineConfigClient, "infra", "90-infra-testfile", false) so it returns/skips on
single-replica topology and keep the existing
DoesMachineConfigPoolHaveMachines(machineConfigClient, "worker") check.
- Around line 58-72: The test "MachineConfigNode conditions should properly
transition..." lacks explicit Single Node OpenShift (SNO) protection; add SNO
gating before it runs by either adding the [Skipped:SingleReplicaTopology] label
to the g.It declaration or inserting an explicit exutil.IsSingleNode() check at
the top of the test body (before calling DoesMachineConfigPoolHaveMachines and
runImageModeMCNTest) to skip the test on SNO clusters; reference the test by its
g.It description and the functions DoesMachineConfigPoolHaveMachines and
runImageModeMCNTest when making the change.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: a834512b-7047-44a2-bb0b-884f9ee71cef

📥 Commits

Reviewing files that changed from the base of the PR and between fbdd047 and efa77b7.

📒 Files selected for processing (1)
  • test/extended/image_mode_status_reporting.go

@isabella-janssen
Copy link
Copy Markdown
Member Author

/payload-job periodic-ci-openshift-machine-config-operator-release-5.0-periodics-e2e-aws-mco-single-node-disruptive

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 21, 2026

@isabella-janssen: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-machine-config-operator-release-5.0-periodics-e2e-aws-mco-single-node-disruptive

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/23a99e80-551c-11f1-91c5-e3cba9646b62-0

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant