-
Notifications
You must be signed in to change notification settings - Fork 684
add nowsh reason to help debug failure #2755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes introduce structured error codes for Wave Shell connection failures. Eight new NoWshCode constants are defined to categorize specific failure modes: disabled, permission error, user declined, domain socket error, connection server start error, install error, post-install start error, and install verify error. The WshCheckResult struct is extended with a NoWshCode field to carry these codes. The tryEnableWsh function is modified to populate NoWshCode across all error paths. Concurrently, telemetry infrastructure is updated to support reporting these error codes through a new "conn:nowsh" event type and a ConnWshErrorCode field in the TEventProps struct. Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/remote/conncontroller/conncontroller.go (1)
682-733: NoWshCode is consistently populated across all error paths.All failure scenarios in
tryEnableWshnow correctly set the appropriateNoWshCode, enabling structured debugging of WSH connection issues.Minor observation: Lines 730-732 have identical success returns that could be consolidated, but this is a stylistic nitpick and doesn't affect correctness.
🔎 Optional: Consolidate success returns
if needsInstall { conn.Infof(ctx, "connserver needs to be (re)installed\n") err = conn.InstallWsh(ctx, osArchStr) if err != nil { conn.Infof(ctx, "ERROR installing wsh: %v\n", err) err = fmt.Errorf("error installing wsh: %w", err) return WshCheckResult{NoWshReason: "error installing wsh/connserver", NoWshCode: NoWshCode_InstallError, WshError: err} } needsInstall, clientVersion, _, err = conn.StartConnServer(ctx, true) if err != nil { conn.Infof(ctx, "ERROR starting conn server (after install): %v\n", err) err = fmt.Errorf("error starting conn server (after install): %w", err) return WshCheckResult{NoWshReason: "error starting connserver", NoWshCode: NoWshCode_PostInstallStartError, WshError: err} } if needsInstall { conn.Infof(ctx, "conn server not installed correctly (after install)\n") err = fmt.Errorf("conn server not installed correctly (after install)") return WshCheckResult{NoWshReason: "connserver not installed properly", NoWshCode: NoWshCode_InstallVerifyError, WshError: err} } - return WshCheckResult{WshEnabled: true, ClientVersion: clientVersion} - } else { - return WshCheckResult{WshEnabled: true, ClientVersion: clientVersion} } + return WshCheckResult{WshEnabled: true, ClientVersion: clientVersion} }
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
pkg/remote/conncontroller/conncontroller.gopkg/telemetry/telemetrydata/telemetrydata.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Build for TestDriver.ai
🔇 Additional comments (5)
pkg/telemetry/telemetrydata/telemetrydata.go (2)
36-38: LGTM!The new
"conn:nowsh"event name is correctly added to track WSH connection failures, aligning with the telemetry emission inconncontroller.go.
109-122: LGTM!The new
ConnWshErrorCodefield is appropriately added to capture the error code for WSH connection failures. The formatting improvements with blank lines grouping related fields enhance readability.pkg/remote/conncontroller/conncontroller.go (3)
50-59: LGTM!The NoWshCode constants are well-organized and provide comprehensive coverage of all WSH failure modes. Using descriptive string values (rather than numeric iota) is appropriate for telemetry readability.
673-679: LGTM!The
NoWshCodefield complements the existingNoWshReasonby providing a structured, machine-readable error code alongside the human-readable reason.
795-801: LGTM!The telemetry emission correctly captures the
NoWshCodewhen WSH fails to enable, providing valuable debugging data. The event name and props align with the definitions intelemetrydata.go.
No description provided.