Skip to content

HIVE-3148: Hive test extension binary#31059

Closed
miyadav wants to merge 1 commit intoopenshift:mainfrom
miyadav:hivetestsbinary
Closed

HIVE-3148: Hive test extension binary#31059
miyadav wants to merge 1 commit intoopenshift:mainfrom
miyadav:hivetestsbinary

Conversation

@miyadav
Copy link
Copy Markdown
Member

@miyadav miyadav commented Apr 23, 2026

/hold

depends on - openshift/hive#2894

Summary by CodeRabbit

  • New Features
    • Test binaries can be marked optional, so extraction continues when optional components are absent.
    • Extraction now treats missing optional binaries as warnings instead of failures.
    • Added a new optional extension binary to the registry for additional testing scenarios.

@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: automatic mode

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 23, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Walkthrough

Adds an optional flag to test binary registrations and updates extraction logic so failures for optional binaries are logged and skipped, while failures for non-optional binaries still propagate as extraction errors.

Changes

Cohort / File(s) Summary
Optional Binary Support
pkg/test/extensions/binary.go
Added optional field to TestBinary, registered a new optional hive extension, and changed ExtractAllTestBinaries to log and skip extraction failures for optional entries while preserving error propagation for non-optional entries.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Caller as Caller
    participant Registry as extensionBinaries (registry)
    participant Payload as ReleasePayload
    participant Extractor as Extractor
    participant Logger as Logger
    Caller->>Registry: request list of test binaries
    Registry->>Caller: returns entries (some optional)
    loop for each entry
        Caller->>Payload: request binary data for entry
        Payload->>Extractor: provide data / path
        Extractor->>Extractor: attempt extraction
        alt extraction succeeds
            Extractor->>Caller: success
        else extraction fails
            alt entry.optional == true
                Extractor->>Logger: warn and skip
                Extractor->>Caller: continue without error
            else entry.optional == false
                Extractor->>Caller: send error via errCh (propagate failure)
            end
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding a Hive test extension binary, which aligns with the primary modification of introducing a new optional hive extension binary and the optional flag functionality.
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 The modified file pkg/test/extensions/binary.go contains no Ginkgo test definitions and introduces no dynamic test names.
Test Structure And Quality ✅ Passed The custom check applies to Ginkgo test code, but this PR modifies utility infrastructure code in pkg/test/extensions/binary.go, not Ginkgo test specifications.
Microshift Test Compatibility ✅ Passed PR modifies infrastructure code for test extension binaries without adding new Ginkgo e2e tests, so custom check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This pull request does not add new Ginkgo e2e tests. Changes are limited to adding infrastructure file pkg/test/extensions/binary.go with utility functions only.
Topology-Aware Scheduling Compatibility ✅ Passed Code modifies test infrastructure for binary extraction without introducing topology-aware scheduling constraints.
Ote Binary Stdout Contract ✅ Passed No stdout-writing calls in process-level OTE binary entry points; logging occurs in utility function context only.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Pull request modifies test infrastructure code with zero Ginkgo e2e test definitions, zero IPv4-specific patterns, and zero external connectivity calls.

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

@openshift-ci openshift-ci Bot requested review from deads2k and sjenning April 23, 2026 10:42
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 23, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/test/extensions/binary.go`:
- Around line 694-697: The current optional-binary handling inside the
extraction loop (where b.optional and b.imageTag are used) skips on any error,
which can hide real failures; change the logic to call a helper
isMissingFromPayloadError(err) (implement as per the suggested string checks)
and only warn+continue when that helper returns true; for any other error, log
it as an error/return it (don’t silently continue) so auth/transport/path issues
surface. Ensure the helper is used where the extraction error is checked and
maintain the existing log format for the skip case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: eeab91a2-f7da-467b-84d1-e0b02adaf8c2

📥 Commits

Reviewing files that changed from the base of the PR and between 88e6572 and 7e1febd.

📒 Files selected for processing (1)
  • pkg/test/extensions/binary.go

Comment on lines +694 to +697
if b.optional {
logrus.Warnf("Skipping optional extension %s (not in payload): %v", b.imageTag, err)
continue
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Handle only “missing from payload” as skippable for optional binaries.

At Line 694, the current logic skips on any extraction error for optional binaries. That can mask real failures (auth/transport/path regressions) and silently drop coverage for callers that continue on success.

Proposed hardening
-					if err != nil {
-						if b.optional {
-							logrus.Warnf("Skipping optional extension %s (not in payload): %v", b.imageTag, err)
-							continue
-						}
-						errCh <- err
-						continue
-					}
+					if err != nil {
+						if b.optional && isMissingFromPayloadError(err) {
+							logrus.Warnf("Skipping optional extension %s (%s): %v", b.imageTag, b.binaryPath, err)
+							continue
+						}
+						errCh <- fmt.Errorf("failed extracting extension %s (%s): %w", b.imageTag, b.binaryPath, err)
+						continue
+					}
func isMissingFromPayloadError(err error) bool {
	msg := strings.ToLower(err.Error())
	return strings.Contains(msg, "not found") ||
		strings.Contains(msg, "manifest unknown") ||
		strings.Contains(msg, "no such image")
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/extensions/binary.go` around lines 694 - 697, The current
optional-binary handling inside the extraction loop (where b.optional and
b.imageTag are used) skips on any error, which can hide real failures; change
the logic to call a helper isMissingFromPayloadError(err) (implement as per the
suggested string checks) and only warn+continue when that helper returns true;
for any other error, log it as an error/return it (don’t silently continue) so
auth/transport/path issues surface. Ensure the helper is used where the
extraction error is checked and maintain the existing log format for the skip
case.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

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

@miyadav miyadav changed the title Hive test extension binary HIVE-3148: Hive test extension binary Apr 23, 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 Apr 23, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 23, 2026

@miyadav: This pull request references HIVE-3148 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 task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

/hold

depends on - openshift/hive#2894

Summary by CodeRabbit

Release Notes

  • New Features
  • Test binaries can now be marked as optional, allowing extraction to continue if optional components are unavailable.
  • Improved extraction robustness: missing optional binaries trigger warnings instead of causing extraction failure.
  • Added a new optional extension binary for enhanced testing features.

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2026
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 27, 2026
@miyadav
Copy link
Copy Markdown
Member Author

miyadav commented Apr 27, 2026

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2026
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.

♻️ Duplicate comments (1)
pkg/test/extensions/binary.go (1)

697-700: ⚠️ Potential issue | 🟠 Major

Only skip optional binaries when the error indicates “missing from payload”.

At Line 697, skipping on any error can hide real extraction failures. Keep optional skips scoped to missing-image conditions; propagate all other errors.

🔧 Proposed hardening
 					testBinary, err := externalBinaryProvider.ExtractBinaryFromReleaseImage(b.imageTag, b.binaryPath)
 					if err != nil {
-						if b.optional {
+						if b.optional && isMissingFromPayloadError(err) {
 							logrus.Warnf("Skipping optional extension %s (not in payload): %v", b.imageTag, err)
 							continue
 						}
-						errCh <- err
+						errCh <- fmt.Errorf("failed extracting extension %s (%s): %w", b.imageTag, b.binaryPath, err)
 						continue
 					}
+func isMissingFromPayloadError(err error) bool {
+	msg := strings.ToLower(err.Error())
+	return strings.Contains(msg, "not found") ||
+		strings.Contains(msg, "manifest unknown") ||
+		strings.Contains(msg, "no such image")
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/extensions/binary.go` around lines 697 - 700, The current logic in
the binary extraction loop (around b.optional and b.imageTag in
pkg/test/extensions/binary.go) skips any error for optional binaries; change
this so only errors that explicitly indicate "missing from payload" (or the
specific sentinel/error type used by the extractor) are treated as benign: when
err indicates missing-image, log the Warnf and continue, otherwise do not
continue—propagate or return the error so extraction failures are surfaced;
update the conditional to inspect the error message/type instead of blindly
checking b.optional.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@pkg/test/extensions/binary.go`:
- Around line 697-700: The current logic in the binary extraction loop (around
b.optional and b.imageTag in pkg/test/extensions/binary.go) skips any error for
optional binaries; change this so only errors that explicitly indicate "missing
from payload" (or the specific sentinel/error type used by the extractor) are
treated as benign: when err indicates missing-image, log the Warnf and continue,
otherwise do not continue—propagate or return the error so extraction failures
are surfaced; update the conditional to inspect the error message/type instead
of blindly checking b.optional.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: accf18c8-4ad4-4ab8-89eb-1f457fd5b472

📥 Commits

Reviewing files that changed from the base of the PR and between 7e1febd and 150f48f.

📒 Files selected for processing (1)
  • pkg/test/extensions/binary.go

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 27, 2026

@miyadav: 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 7e1febd link true /test e2e-gcp-ovn
ci/prow/e2e-aws-ovn-serial-1of2 7e1febd link true /test e2e-aws-ovn-serial-1of2
ci/prow/e2e-aws-ovn-fips 7e1febd link true /test e2e-aws-ovn-fips
ci/prow/okd-scos-images 150f48f link true /test okd-scos-images
ci/prow/verify 150f48f link true /test verify
ci/prow/lint 150f48f link true /test lint
ci/prow/images 150f48f link true /test images
ci/prow/unit 150f48f link true /test unit

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.

@miyadav
Copy link
Copy Markdown
Member Author

miyadav commented Apr 27, 2026

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2026
@miyadav
Copy link
Copy Markdown
Member Author

miyadav commented Apr 27, 2026

/close
Out of payload images will not need this

@openshift-ci openshift-ci Bot closed this Apr 27, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 27, 2026

@miyadav: Closed this PR.

Details

In response to this:

/close
Out of payload images will not need this

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

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants