-
Notifications
You must be signed in to change notification settings - Fork 8
feat: adding apps_list and apps_terminate #142
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
WalkthroughThis PR adds two new JSON-RPC methods: Changes
Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 (2)
server/server.go (1)
476-483: Consider reusing existing command types for JSON unmarshalling.
AppsTerminateParamsandAppsListParamshave identical structures tocommands.AppRequestandcommands.ListAppsRequestrespectively. You could unmarshal directly into those types to reduce duplication, as the JSON tags match.That said, the current approach provides layer separation between JSON-RPC params and command requests, which is also valid.
docs/jsonrpc_README.md (1)
259-273: Minor: duplicate request ID in examples.The
apps_terminatecurl example uses"id":21which is also used by thedevice_infoexample above (line 241). Consider using a unique ID like"id":23for clarity, though this doesn't affect functionality.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/jsonrpc_README.mdserver/server.go
🧰 Additional context used
🧬 Code graph analysis (1)
server/server.go (1)
commands/apps.go (4)
AppRequest(8-11)TerminateAppCommand(35-53)ListAppsRequest(56-58)ListAppsCommand(61-73)
🪛 markdownlint-cli2 (0.18.1)
docs/jsonrpc_README.md
148-148: Unordered list indentation
Expected: 2; Actual: 1
(MD007, ul-indent)
148-148: Hard tabs
Column: 1
(MD010, no-hard-tabs)
149-149: Unordered list indentation
Expected: 2; Actual: 1
(MD007, ul-indent)
149-149: Hard tabs
Column: 1
(MD010, no-hard-tabs)
150-150: Unordered list indentation
Expected: 4; Actual: 2
(MD007, ul-indent)
150-150: Hard tabs
Column: 1
(MD010, no-hard-tabs)
151-151: Unordered list indentation
Expected: 4; Actual: 2
(MD007, ul-indent)
151-151: Hard tabs
Column: 1
(MD010, no-hard-tabs)
154-154: Unordered list indentation
Expected: 2; Actual: 1
(MD007, ul-indent)
154-154: Hard tabs
Column: 1
(MD010, no-hard-tabs)
155-155: Unordered list indentation
Expected: 2; Actual: 1
(MD007, ul-indent)
155-155: Hard tabs
Column: 1
(MD010, no-hard-tabs)
156-156: Unordered list indentation
Expected: 4; Actual: 2
(MD007, ul-indent)
156-156: Hard tabs
Column: 1
(MD010, no-hard-tabs)
264-264: Hard tabs
Column: 1
(MD010, no-hard-tabs)
265-265: Hard tabs
Column: 1
(MD010, no-hard-tabs)
272-272: Hard tabs
Column: 1
(MD010, no-hard-tabs)
273-273: Hard tabs
Column: 1
(MD010, no-hard-tabs)
⏰ 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). (2)
- GitHub Check: build_on_linux
- GitHub Check: build_on_windows
🔇 Additional comments (4)
server/server.go (3)
191-194: LGTM!The new method routing follows the established pattern and is correctly placed in the dispatcher switch statement.
742-763: LGTM!The handler follows the established pattern from
handleAppsLaunchand correctly validates params, unmarshals, constructs the command request, and handles errors consistently.
765-783: LGTM!The handler correctly treats
deviceIdas optional by not requiring params, matching the documented behavior. This is consistent with howhandleDevicesListhandles optional parameters.docs/jsonrpc_README.md (1)
147-156: LGTM!The documentation for
apps_terminateandapps_listfollows the established format and accurately reflects the handler implementations. The parameter requirements match the code (bundleId required for terminate, deviceId optional for both).
Summary by CodeRabbit
apps_terminateRPC method enables remote termination of running applications on specified devices using device ID and bundle identifier parametersapps_listRPC method enables discovery of installed applications on devices with optional device ID-based filtering✏️ Tip: You can customize this high-level summary in your review settings.