Skip to content

Fixing manifest ci failure#2228

Open
gangwgr wants to merge 1 commit intoopenshift:mainfrom
gangwgr:new-ci-azure-fix
Open

Fixing manifest ci failure#2228
gangwgr wants to merge 1 commit intoopenshift:mainfrom
gangwgr:new-ci-azure-fix

Conversation

@gangwgr
Copy link
Contributor

@gangwgr gangwgr commented Mar 16, 2026

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Walkthrough

Adds context-aware retry polling for image info retrieval in the E2E CLI test and replaces nested architecture-specific conditionals with a switch-based validation that logs detected architecture and fails on unsupported arches.

Changes

Cohort / File(s) Summary
E2E CLI Tests
test/e2e/cli.go
Replaces single image-info calls with context-aware polling loops that retry and log on failure; adds assertions after polling. Refactors architecture-specific if/else checks into a switch statement with explicit per-arch assertions and a default failure case; preserves subsequent mirroring/description logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

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

Tip

CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.

OpenGrep is compatible with Semgrep configurations. Add an opengrep.yml or semgrep.yml configuration file to your project to enable OpenGrep analysis.

@openshift-ci openshift-ci bot requested review from ingvagabund and tchap March 16, 2026 06:24
@ardaguclu
Copy link
Member

This looks good to me. Ping me once OTE tests pass.

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.

Caution

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

⚠️ Outside diff range comments (1)
test/e2e/cli.go (1)

475-507: ⚠️ Potential issue | 🟠 Major

Poll until the asserted condition is true, not just until oc image info stops erroring.

Both retry loops return success on first successful command execution, but the actual correctness checks happen later (Line 486 and Lines 515/518/521/524). That still leaves a flake window if registry metadata is not fully visible yet. Fold the expected-content check into the poll condition.

Suggested reliability fix
 err = wait.Poll(30*time.Second, 180*time.Second, func() (bool, error) {
 	var infoErr error
 	out, infoErr = oc.WithoutNamespace().Run("image").Args("info", serInfo.serviceName+"/testimage:ppc64", "--insecure").Output()
 	if infoErr != nil {
 		e2e.Logf("image info failed, retrying: %v", infoErr)
 		return false, nil
 	}
+	if !strings.Contains(out, "ppc64le") {
+		e2e.Logf("image info does not contain ppc64le yet, retrying")
+		return false, nil
+	}
 	return true, nil
 })

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/cli.go` around lines 475 - 507, The poll loops currently return
success as soon as oc image info/mirror stops returning an error, but the actual
assertions (strings.Contains checks on out and imageInfo) happen after the
poll—move the expected-content checks into the poll closure so the poll only
returns true when the command succeeds AND the output contains the expected
substring; specifically, in the first wait.Poll that runs
oc.WithoutNamespace().Run("image").Args("info",
serInfo.serviceName+"/testimage:ppc64"...).Output(), check that out contains
"ppc64le" before returning true (and keep logging/returning false on errors or
missing content), and in the later poll that queries
serInfo.serviceName+"/testimage:default" ensure imageInfo contains the expected
indicator (e.g. the mirrored tag or relevant metadata) before returning true;
remove or simplify the subsequent o.Expect(...) assertions that duplicate these
checks and keep AssertWaitPollNoErr as-is to surface timeout failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@test/e2e/cli.go`:
- Around line 475-507: The poll loops currently return success as soon as oc
image info/mirror stops returning an error, but the actual assertions
(strings.Contains checks on out and imageInfo) happen after the poll—move the
expected-content checks into the poll closure so the poll only returns true when
the command succeeds AND the output contains the expected substring;
specifically, in the first wait.Poll that runs
oc.WithoutNamespace().Run("image").Args("info",
serInfo.serviceName+"/testimage:ppc64"...).Output(), check that out contains
"ppc64le" before returning true (and keep logging/returning false on errors or
missing content), and in the later poll that queries
serInfo.serviceName+"/testimage:default" ensure imageInfo contains the expected
indicator (e.g. the mirrored tag or relevant metadata) before returning true;
remove or simplify the subsequent o.Expect(...) assertions that duplicate these
checks and keep AssertWaitPollNoErr as-is to surface timeout failures.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7c088384-3d15-489b-912a-22e5565917bf

📥 Commits

Reviewing files that changed from the base of the PR and between 4ead568 and 25a54d7.

📒 Files selected for processing (1)
  • test/e2e/cli.go

@gangwgr
Copy link
Contributor Author

gangwgr commented Mar 16, 2026

/payload 4.22 nightly blocking

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2026

@gangwgr: trigger 14 job(s) of type blocking for the nightly release of OCP 4.22

  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-upgrade-ovn-single-node
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips
  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-upgrade
  • periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-gcp-ovn-rt-upgrade
  • periodic-ci-openshift-hypershift-release-4.22-periodics-e2e-aws-ovn-conformance
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-serial-1of2
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-serial-2of2
  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn-techpreview-serial-1of3
  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn-techpreview-serial-2of3
  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn-techpreview-serial-3of3
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips-no-nat-instance
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv4
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv6

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b2428e70-2107-11f1-807e-fdf1dee9b118-0

@gangwgr
Copy link
Contributor Author

gangwgr commented Mar 16, 2026

/payload 4.22 nightly informing

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2026

@gangwgr: trigger 65 job(s) of type informing for the nightly release of OCP 4.22

  • periodic-ci-openshift-hypershift-release-4.22-periodics-e2e-azure-aks-ovn-conformance
  • periodic-ci-openshift-release-main-nightly-4.22-console-aws
  • periodic-ci-openshift-cluster-control-plane-machine-set-operator-release-4.22-periodics-e2e-aws
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-csi
  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-cgroupsv2
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-fips
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-single-node
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-single-node-csi
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-single-node-serial
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-single-node-techpreview
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-single-node-techpreview-serial
  • periodic-ci-openshift-release-main-nightly-4.22-upgrade-from-stable-4.21-e2e-aws-upgrade-ovn-single-node
  • periodic-ci-openshift-release-main-ci-4.22-e2e-aws-ovn-upgrade-out-of-change
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upi
  • periodic-ci-openshift-cluster-control-plane-machine-set-operator-release-4.22-periodics-e2e-azure
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-azure-csi
  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn
  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-serial
  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-techpreview-serial
  • periodic-ci-openshift-release-main-ci-4.22-e2e-azure-ovn-upgrade-out-of-change
  • periodic-ci-openshift-release-main-cnv-nightly-4.22-deploy-azure-kubevirt-ovn
  • periodic-ci-openshift-cluster-control-plane-machine-set-operator-release-4.22-periodics-e2e-gcp
  • periodic-ci-openshift-release-main-ci-4.22-e2e-gcp-ovn
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-gcp-ovn-csi
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-gcp-ovn-rt
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-gcp-ovn-serial
  • periodic-ci-openshift-release-main-ci-4.22-e2e-gcp-ovn-techpreview
  • periodic-ci-openshift-release-main-ci-4.22-e2e-gcp-ovn-techpreview-serial
  • periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-gcp-ovn-upgrade
  • periodic-ci-openshift-release-main-ci-4.22-e2e-gcp-ovn-upgrade
  • periodic-ci-openshift-hypershift-release-4.22-periodics-e2e-azure-kubevirt-ovn
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-dualstack
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-dualstack-techpreview
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv6-techpreview
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-serial-ipv4
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-serial-virtualmedia-1of2
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-serial-virtualmedia-2of2
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-techpreview
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-upgrade
  • periodic-ci-openshift-release-main-nightly-4.22-upgrade-from-stable-4.21-e2e-metal-ipi-ovn-upgrade
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-serial-ovn-ipv6
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-serial-ovn-dualstack
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-upgrade-ovn-ipv6
  • periodic-ci-openshift-release-main-nightly-4.22-upgrade-from-stable-4.21-e2e-metal-ipi-upgrade-ovn-ipv6
  • periodic-ci-openshift-release-main-nightly-4.22-metal-ovn-single-node-recert-cluster-rename
  • periodic-ci-openshift-osde2e-main-nightly-4.22-osd-aws
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-osd-ccs-gcp
  • periodic-ci-openshift-osde2e-main-nightly-4.22-osd-gcp
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-proxy
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ovn-single-node-live-iso
  • periodic-ci-openshift-eng-ocp-qe-perfscale-ci-main-aws-4.22-nightly-x86-payload-control-plane-6nodes
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-telco5g
  • periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-aws-ovn-upgrade
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-ovn
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-ovn-csi
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-ovn-serial
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-ovn-techpreview
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-ovn-techpreview-serial
  • periodic-ci-openshift-release-main-ci-4.22-e2e-vsphere-ovn-upgrade
  • periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-vsphere-ovn-upgrade
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-ovn-upi
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-ovn-upi-serial
  • periodic-ci-openshift-release-main-nightly-4.22-e2e-vsphere-static-ovn

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b98588e0-2107-11f1-9295-2cc5f42bee78-0

test/e2e/cli.go Outdated
AssertWaitPollNoErr(err, fmt.Sprintf("max time reached but mirror still falied"))
out, err := oc.WithoutNamespace().Run("image").Args("info", serInfo.serviceName+"/testimage:ppc64", "--insecure").Output()
var out string
err = wait.Poll(30*time.Second, 180*time.Second, func() (bool, error) {
Copy link
Member

Choose a reason for hiding this comment

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

30 seconds is long time for polling. Can it be 5 seconds?.

test/e2e/cli.go Outdated
o.Expect(err).NotTo(o.HaveOccurred())
imageInfo, err := oc.WithoutNamespace().Run("image").Args("info", serInfo.serviceName+"/testimage:default", "--insecure").Output()
var imageInfo string
err = wait.Poll(30*time.Second, 180*time.Second, func() (bool, error) {
Copy link
Member

Choose a reason for hiding this comment

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

same

@ardaguclu
Copy link
Member

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, gangwgr

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 Mar 16, 2026
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 (2)
test/e2e/cli.go (2)

475-486: Polling pattern looks good; consider removing redundant error check.

The 5-second polling interval addresses the prior feedback. However, line 486 is redundant — AssertWaitPollNoErr already fails the test if err != nil (see test/e2e/util.go:354-359).

♻️ Optional: remove redundant assertion
 		AssertWaitPollNoErr(err, "max time reached but image info for testimage:ppc64 still failed")
-		o.Expect(err).NotTo(o.HaveOccurred())
 		o.Expect(strings.Contains(out, "ppc64le")).To(o.BeTrue())
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/cli.go` around lines 475 - 486, The test duplicates failure handling
after polling: AssertWaitPollNoErr(err, ...) already fails on non-nil err, so
remove the redundant o.Expect(err).NotTo(o.HaveOccurred()) assertion at the end
of the block; keep the wait.PollUntilContextTimeout loop and the
AssertWaitPollNoErr call (referencing the err variable and the
AssertWaitPollNoErr helper) and delete the extra o.Expect(...) line to avoid
duplicate assertions.

498-509: Same redundant assertion pattern.

Line 509 duplicates the error check already performed by AssertWaitPollNoErr on line 508.

♻️ Optional: remove redundant assertion
 		AssertWaitPollNoErr(err, "max time reached but image info for testimage:default still failed")
-		o.Expect(err).NotTo(o.HaveOccurred())
 		architecture, err := exec.Command("bash", "-c", "uname -a").Output()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/e2e/cli.go` around lines 498 - 509, The code calls
AssertWaitPollNoErr(err, ...) to fail on timeout and then redundantly asserts
o.Expect(err).NotTo(o.HaveOccurred()); remove the duplicate check by deleting
the o.Expect(...) line. Keep the wait.PollUntilContextTimeout usage and the
AssertWaitPollNoErr(err, "max time reached but image info for testimage:default
still failed") call (and the related err variable and imageInfo assignment) so
the test still fails correctly on timeout, but do not perform the second
assertion using o.Expect/HaveOccurred.
🤖 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/e2e/cli.go`:
- Around line 475-486: The test duplicates failure handling after polling:
AssertWaitPollNoErr(err, ...) already fails on non-nil err, so remove the
redundant o.Expect(err).NotTo(o.HaveOccurred()) assertion at the end of the
block; keep the wait.PollUntilContextTimeout loop and the AssertWaitPollNoErr
call (referencing the err variable and the AssertWaitPollNoErr helper) and
delete the extra o.Expect(...) line to avoid duplicate assertions.
- Around line 498-509: The code calls AssertWaitPollNoErr(err, ...) to fail on
timeout and then redundantly asserts o.Expect(err).NotTo(o.HaveOccurred());
remove the duplicate check by deleting the o.Expect(...) line. Keep the
wait.PollUntilContextTimeout usage and the AssertWaitPollNoErr(err, "max time
reached but image info for testimage:default still failed") call (and the
related err variable and imageInfo assignment) so the test still fails correctly
on timeout, but do not perform the second assertion using o.Expect/HaveOccurred.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40941b25-7b34-48b4-9c21-881ecb197b52

📥 Commits

Reviewing files that changed from the base of the PR and between 25a54d7 and 1f395ca.

📒 Files selected for processing (1)
  • test/e2e/cli.go

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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants