fix(#985): add missing return after ResolveTCPAddr error - #986
fix(#985): add missing return after ResolveTCPAddr error#986fullsend-ai-coder[bot] wants to merge 6 commits into
Conversation
In checkIfIpIsLive, when net.ResolveTCPAddr fails the error was logged but execution continued, calling methods on a nil *net.TCPAddr pointer and causing a panic. Add `return err` after the error log to match the error-handling pattern used by the other error checks in the same function. Add a test case that verifies checkIfIpIsLive returns an error for an unresolvable address instead of panicking. Closes #985 Authored-By: Claude Code (fullsend-ai-coder)
|
🤖 Finished Review · ✅ Success · Started 10:16 AM UTC · Completed 10:26 AM UTC |
ReviewFindingsLow
Previous runReviewFindingsLow
Previous run (2)Looks good to me Previous run (3)ReviewFindingsLow
Labels: Bug fix in IBM cloud provider package (pkg/ibm); patch-level severity change Previous run (4)Looks good to me Labels: Bug fix in IBM cloud provider package — prevents nil pointer panic in checkIfIpIsLive |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #986 +/- ##
==========================================
+ Coverage 76.92% 77.21% +0.29%
==========================================
Files 26 26
Lines 2817 2818 +1
==========================================
+ Hits 2167 2176 +9
+ Misses 452 444 -8
Partials 198 198
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
/agentic-review |
|
/agentic_review |
Code Review by Qodo
Context used✅ Compliance rules (platform):
2 rules 1.
|
Co-authored-by: Francesco Ilario <filario@redhat.com>
PR Summary by QodoFix nil panic in checkIfIpIsLive on ResolveTCPAddr failure
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
|
🤖 Review · ❌ Terminated · Started 9:17 AM UTC · Ended 9:26 AM UTC |
|
Code review by qodo was updated up to the latest commit b398b21 |
|
🤖 Finished Review · ✅ Success · Started 9:17 AM UTC · Completed 9:26 AM UTC |
adding good fullsend comment
|
🤖 Review · ❌ Terminated · Started 12:49 PM UTC · Ended 12:56 PM UTC |
|
Code review by qodo was updated up to the latest commit 8b849c6 |
|
🤖 Finished Review · ✅ Success · Started 12:49 PM UTC · Completed 12:56 PM UTC |
filariow
left a comment
There was a problem hiding this comment.
/fs-fix
in tests we prefer to declare variables outside the function call and we prefer to use Expect(function(var1, var2)).ShouldNot(Succeed())
|
/fs-fix in tests we prefer to declare variables outside the function call and we prefer to use |
|
🤖 Finished Fix · ✅ Success · Started 3:29 PM UTC · Completed 3:45 PM UTC |
Declare test variables outside the function call and use Expect(func(vars)).ShouldNot(Succeed()) pattern per reviewer preference. Addresses review feedback on #986 Authored-By: Claude Code <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (human-triggered)Addressed review feedback: refactored checkIfIpIsLive test to declare variables outside the function call and use the Expect(func(vars)).ShouldNot(Succeed()) assertion pattern. All 116 tests pass. Fixed (1):
Tests: passed Updated by fullsend fix agent |
|
🤖 Review · ❌ Terminated · Started 3:46 PM UTC · Ended 3:55 PM UTC |
|
Code review by qodo was updated up to the latest commit 08207a9 |
|
🤖 Finished Review · ✅ Success · Started 3:46 PM UTC · Completed 3:55 PM UTC |
|
🤖 Review · ❌ Terminated · Started 6:09 AM UTC · Ended 6:19 AM UTC |
|
Code review by qodo was updated up to the latest commit 802fefa |
|
🤖 Finished Review · ✅ Success · Started 6:09 AM UTC · Completed 6:19 AM UTC |
|
/retest |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 9:36 AM UTC · Completed 9:49 AM UTC |
Replace ShouldNot(Succeed()) with errors.As(*net.DNSError) to prove the test exercises the net.ResolveTCPAddr error branch, not DialTimeout. Addresses review feedback on #986 Authored-By: Claude Code <noreply@anthropic.com>
🔧 Fix agent — iteration 2 (human-triggered)Addressed 1 review finding: strengthened the checkIfIpIsLive test assertion to verify the error is a *net.DNSError, proving the net.ResolveTCPAddr error branch is exercised rather than accepting any error. Fixed (1):
Tests: passed Decision points
Updated by fullsend fix agent |
|
🤖 Review · ❌ Terminated · Started 9:50 AM UTC · Ended 9:52 AM UTC |
|
Code review by qodo was updated up to the latest commit 5b34b92 |
|
🤖 Finished Review · ❌ Failure · Started 9:50 AM UTC · Completed 9:52 AM UTC |
Summary
Fix nil pointer panic in
checkIfIpIsLivewhen DNS resolution fails for an IBM Z or Power host IP address. The missingreturn errafter a failednet.ResolveTCPAddrcall caused execution to continue and dereference the nil*net.TCPAddrpointer.Changes
pkg/ibm/ibmz_helpers.go: Addreturn errafter the error log in thenet.ResolveTCPAddrerror branch, matching the error-handling pattern used elsewhere in the function (lines 89 and 93).pkg/ibm/ibmz_helpers_test.go: Add a Ginkgo test that callscheckIfIpIsLivewith an unresolvable address and verifies it returns an error instead of panicking.Testing
make lintpasses (0 issues)go test ./pkg/ibm/...passes (116 of 116 specs)Coverage
Patch adds one line of production code (the
return err) and one test that exercises the new code path. Patch coverage is 100%.Notes
One-line fix following the existing error-handling pattern in the same function.
Closes #985
Post-script verification
agent/985-fix-nil-panic-checkifipislive)6683f88b167b28e8bda2ea80e4545031a1853307..HEAD)