HIVE-3148: Hive test extension binary#31059
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
WalkthroughA test binary extraction system is enhanced to support optional extensions. A new flag is added to designate test binaries as optional, allowing extraction failures for optional entries to produce warnings and be skipped rather than fail the entire extraction process. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: miyadav The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
pkg/test/extensions/binary.go
| if b.optional { | ||
| logrus.Warnf("Skipping optional extension %s (not in payload): %v", b.imageTag, err) | ||
| continue | ||
| } |
There was a problem hiding this comment.
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.
|
Scheduling required tests: |
|
@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. DetailsIn response to 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@miyadav: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
/hold
depends on - openshift/hive#2894
Summary by CodeRabbit
Release Notes