setup: summarize remote probe errors#56
Conversation
Summary by CodeRabbit
WalkthroughAdded Changes
Sequence DiagramsequenceDiagram
participant Caller
participant remote_probe_error
participant sanitize_remote_error
participant ErrorHandler
Caller->>remote_probe_error: run git ls-remote (fails)
remote_probe_error->>sanitize_remote_error: pass raw probe_output
sanitize_remote_error->>sanitize_remote_error: remove CRs, trim lines, pick first two non-empty, count extras
sanitize_remote_error-->>remote_probe_error: return sanitized_summary + extras metadata
alt sanitized_summary non-empty
remote_probe_error->>ErrorHandler: deliver sanitized_summary (append "reproduce full output" if extras > 0)
else sanitized_summary empty
remote_probe_error->>ErrorHandler: deliver "command failed with exit code X" (+ trimmed-output hint if available)
end
ErrorHandler-->>Caller: final error message
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3){scripts/bosun,lib/**/*.sh}📄 CodeRabbit inference engine (AGENTS.md)
Files:
{scripts/**/*.sh,lib/**/*.sh,test/**/*.bats}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.sh📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
lib/commands.sh(2 hunks)
🔇 Additional comments (1)
lib/commands.sh (1)
1752-1755: Integration is clean and handles the fallback correctly.The call at line 1752 properly sanitizes
probe_output(which contains git stderr), and the fallback at line 1754 only triggers when stderr was pure whitespace—exactly what you want. The exit-code check at line 1749 correctly gates timeout handling separately before attempting sanitization. No issues here.
Summary
git shiplog setupnow surfaces remote-probe failures without drowning users in rawgit ls-remotestderr. The newsanitize_remote_errorhelper normalizes CRLF output, trims leading/trailing whitespace, and keeps only the first two meaningful lines (summarising the remainder as(+N more lines)). When we do trim lines we append a hint telling the user exactly which command to re-run for the full output.Before: multi-line Git “help” blobs and verbose transport traces spilled into the wizard, forcing users to scroll to find the actionable line.
After: the wizard shows a one-line summary (e.g.
fatal: could not read Username for ...; (+3 more lines) (trimmed; run 'git ls-remote ...' for full output)), with the original command included so the user can re-run it manually if they need detail.No behavioral change to setup logic—just cleaner, higher-signal error messaging.
Tests
make test(Dockerized)Deployment / Docs
make progress)