[Roadmap] feat(studio): Android Studio plugin Phase 1 MVP — thin-client IDE integration - #153
RanjithRagavan wants to merge 3 commits into
Conversation
71d03f7 to
66a791f
Compare
|
Note on the failing I'm happy to open a separate PR that pins all workflow actions to their commit SHAs (with |
…egration Implements Phase 1 of the Android Studio Integration roadmap item (google#152): - Tool window: server status, device picker (GET /api/devices), natural-language task dispatch (POST /api/run), live status polling (GET /api/sessions/{id}), task stop (POST /api/stop) - Settings page (Tools > ARTEMIS): server URL, default profile, device serial - Thin client over the same HTTP API as packages/artemis-client; no agent logic in the IDE; java.net.http + Gson, zero external dependencies - Kotlin models mirror the Python artemis-client payload shapes, including legacy field fallbacks - 25 unit/integration tests (model parsing, request building, submit/poll/ stop against a mock HTTP server, error paths) - Compatibility: since-build 231 (Android Studio Hedgehog+ / IntelliJ 2023.1+), no until-build cap; verified with buildPlugin + verifyPluginStructure
66a791f to
b23bd95
Compare
Self-review pass before upstream review: - ArtemisProtocolException now extends ArtemisApiException so parser failures surface as UI errors instead of IDE error reports - TaskPollingService stops the 2s polling loop when no active tasks remain; poll cycles serialized to prevent double completion notifications; server-unreachable status reported on transitions only - submit() mirrors client.py setdefault semantics for session_id; listDevices() accepts missing 'devices' key per the Python client; device_info accepted in JSON-string form - Clear stale error tooltip after server recovery - 30/30 tests green, buildPlugin passes
|
Rebased onto latest
Test count grew 25 → 30, all green; |
Found by live integration testing against a real ARTEMIS server: java.net.http defaults to HTTP/2 and sends an h2c upgrade attempt on the first request. Uvicorn does not support cleartext upgrade; while processing it the POST body is lost, so FastAPI rejects /api/run with 422 'body: Field required' and task submission always failed from the IDE (Python/curl clients were unaffected as they speak HTTP/1.1). Pinning HTTP_1_1 makes submit() succeed against the live server (verified end-to-end: task admitted, executed on emulator-5554).
|
Live integration test result (real server + emulator, not just mocks): caught and fixed a genuine transport bug — |
Summary
Implements Phase 1 of the Android Studio Integration roadmap item — a native IDE plugin (thin client) that brings ARTEMIS task dispatch and monitoring into Android Studio.
Part of #152 (Phases 2–3 — run configurations, breakpoint-aware runs, record mode — intentionally left as follow-ups).
@somew1nd @yaoyao-open-source would love your review when you have a moment — happy to adjust scope, directory placement, or packaging to fit the project's conventions.
What the plugin does
GET /api/devices, natural-language prompt dispatch viaPOST /api/run(flash/pro), live task list with 2 s polling viaGET /api/sessions/{id}, detail pane, and Stop viaPOST /api/stopArchitecture
Strict thin client: the plugin only speaks the same HTTP API as
packages/artemis-client(endpoint shapes mirrored field-for-field, including legacy fallbacks likesession_id/task_id/trace_id). No agent logic, no credentials surface in the IDE.java.net.http.HttpClient+ platform-bundled Gson — zero external dependencies, keeping the plugin small (~1.7 MB zip) and free of dependency conflicts.Compatibility
since-build="231", nountil-buildcap → Android Studio Hedgehog 2023.1.1 through current (Iguana/Jellyfish/Koala/Ladybug/Meerkat/Narwhal), and IntelliJ IDEA 2023.1+Testing
./gradlew test): model JSON parsing (canned payloads mirrored frompackages/artemis-client/tests),/api/runrequest building, and full submit → poll → stop integration against an in-process mock HTTP server, plus error paths (server down, HTTP 500, task rejection, 404 fallbacks)./gradlew buildPlugin→artemis-android-studio-plugin-0.1.0.zip✅./gradlew verifyPluginStructure✅android-studio-plugin/README.md;./gradlew runIdeworks for a sandbox smoke testandroid-studio-pluginwould be a natural follow-upLayout
All sources carry the repo-standard Apache 2.0 header.
Test plan
./gradlew test— 25/25 pass./gradlew buildPlugin+verifyPluginStructure— passartemis uiserver, dispatch a task (documented in plugin README)