getappmap / appmap-intellij-plugin

MIT License
38 stars 9 forks source link

Send project content roots to local AppLand JSON-RPC service #673

Closed jansorg closed 7 months ago

jansorg commented 7 months ago

Closes https://github.com/getappmap/appmap-intellij-plugin/issues/667

This PR implements JSON-RPC message v2.configuration.set. It send the project's content roots as property projectDirectories. Nested content roots are removed from the list sent to the JSON-RPC service.

For spring-petclinic the following message is generated:

{
  "jsonrpc": "2.0",
  "method": "v2.configuration.set",
  "params": {
    "projectDirectories": [
      "/sources/spring-petclinic-2023-08-31"
    ],
    "appmapConfigFiles": [
      "/sources/spring-petclinic-2023-08-31/appmap.yml"
    ]
  }
}

Only appmap-analysis is failing on CI, I don't know what's causing this failure.

github-actions[bot] commented 7 months ago

AppMap runtime code review

Summary Status
Failed tests :white_check_mark: All tests passed
API changes :zero: No API changes
Security flaws :white_check_mark: None detected
Performance problems :white_check_mark: None detected
Code anti-patterns :white_check_mark: None detected
New AppMaps :zero: No new AppMaps
ahtrotta commented 7 months ago

Also, if you update @appland/components to 4.16.1 in appland-navie, then you'll be able to see the context in the right-hand side panel in the Navie chat interface.

jansorg commented 7 months ago

I've updated to 4.16.1. The latest JSON-RPC binary doesn't seem to support v2 yet, but still replies with a 204 status. I can't detect a bad request this way.

jansorg commented 7 months ago

I've fixed the fallback handling, which is now used if the response status != 2xx or if the JSON-RPC response contains an error. I've successfully tested the fallback with @appland/appmap-v3.136.0.

jansorg commented 7 months ago

The change looks good. I had to run/restart IntelliJ three times for the context to appear to be working though. I'm not sure what that was about. Maybe the CLI hadn't updated?

It's possible that the CLI wasn't updated yet. The download progress should have been shown in the status bar and the JSON-RPC server would relaunch after the startup.

appland-release commented 7 months ago

:tada: This PR is included in version 0.65.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: