refactor: move 'crashes' commands under 'device crashes'#209
refactor: move 'crashes' commands under 'device crashes'#209
Conversation
…crashes - add device crashes list and device crashes get subcommands - mark root crashes command as deprecated (warns via stderr, hidden from help) - update root.go examples and README to use new device crashes path
WalkthroughThis change restructures crash report CLI commands by moving them under the 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cli/device_crashes.go (1)
15-39: ⚡ Quick winAvoid duplicating crash handler logic in both command paths.
Line 19-24 and Line 33-38 duplicate the same response/error handling already present in
cli/crashes.go(Line 20-38). During deprecation, this is easy to drift. Consider extracting sharedrunCrashesList/runCrashesGethelpers and wiring bothcrashesanddevice crashesto them.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cli/device_crashes.go` around lines 15 - 39, Extract the duplicated response handling into shared helpers—create runCrashesList(deviceId string) error and runCrashesGet(deviceId, id string) error that call commands.CrashesListCommand / commands.CrashesGetCommand, call printJson(response), check response.Status == "error" and return fmt.Errorf(response.Error) otherwise nil; then replace the inline bodies of deviceCrashesListCmd.RunE and deviceCrashesGetCmd.RunE to delegate to these helpers (and wire the existing crashes commands to use the same helpers) so the logic in the CLI is centralized and not duplicated.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@cli/device_crashes.go`:
- Around line 15-39: Extract the duplicated response handling into shared
helpers—create runCrashesList(deviceId string) error and runCrashesGet(deviceId,
id string) error that call commands.CrashesListCommand /
commands.CrashesGetCommand, call printJson(response), check response.Status ==
"error" and return fmt.Errorf(response.Error) otherwise nil; then replace the
inline bodies of deviceCrashesListCmd.RunE and deviceCrashesGetCmd.RunE to
delegate to these helpers (and wire the existing crashes commands to use the
same helpers) so the logic in the CLI is centralized and not duplicated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fe3a6d1d-49bc-4cb9-9300-1db348fe1813
📒 Files selected for processing (4)
README.mdcli/crashes.gocli/device_crashes.gocli/root.go
No description provided.