-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement Jetbrains IDEs heartbeating #6152
Conversation
|
Hi @atduarte! I just saw that the build fails because there are missing license headers. You can fix this by running
in a Gitpod workspace and committing the changes. |
9d58633
to
f4192e9
Compare
|
f4192e9
to
5fbfbb2
Compare
|
Just thinking out loud: What do you all think of moving this plugin closer to the IntelliJ IDE image. E.g. something like
for this Java plugin and the IDE images go to:
(still struggling with the different JetBrains terms—don't know if |
5fbfbb2
to
8d88ce4
Compare
|
8d88ce4
to
12d0a48
Compare
|
12d0a48
to
9c1e2c3
Compare
|
9c1e2c3
to
c541dfb
Compare
|
@corneliusludmann had to change the approach because of the way werft works. With this new approach, we publish the libs to the local maven repository and the plugin will fetch from there. Wdyt? Also moved to |
c541dfb
to
cb09a69
Compare
|
Codecov Report
@@ Coverage Diff @@
## main #6152 +/- ##
===========================================
+ Coverage 19.04% 33.72% +14.68%
===========================================
Files 2 135 +133
Lines 168 22708 +22540
===========================================
+ Hits 32 7659 +7627
- Misses 134 14366 +14232
- Partials 2 683 +681
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@corneliusludmann Could you review it? We need to check usual staff also, i.e. copyrights, leeway builds and so on. I am not sure how we should put plugins, each plugin as own component or has |
Hey @atduarte! I started to review your PR. 🙏 Regarding the CI build:
|
I missed #6152 (comment) first time. I liked the idea. I think we should call it |
@corneliusludmann sounds good. Will proceed with the changes. Thank you! @akosyakov I guess you are associating "IntelliJ" with "IntelliJ IDEA" but that's not entirely correct. The "IntelliJ Platform" is what powers all Jetbrains IDEs [1], and the plugin is using the "IntelliJ Platform Plugin SDK" [2]. That said, I believe the folder being |
Looks great! 🥳 /lgtm |
LGTM label has been added. Git tree hash: 31017ca447c057ec3e93de5fe108e004366246ae
|
@akosyakov You need to approve this as well because team-ide is not an owner of https://github.com/gitpod-io/gitpod/blob/291bcd9f259ae5e48ab73311e68a4970ea89a432/components/supervisor-api/OWNERS. (is it on purpose?) |
@csweichel Is it fine if we change ownership for supervisor-api and localapp-api to IDE? |
|
||
object AuthTokenService { | ||
private val logger = logger<AuthTokenService>() | ||
private const val SUPERVISOR_ADDRESS = "localhost:22999" |
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.
We should not hard code but fetch or access env vars, but fetch all info from supervisor. All env vars and ports are subject to change.
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.
Given that this is the address of the supervisor—needed to establish the connection—, how do you propose to get it without hard coding or access env vars?
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.
ah, right this only env var on which you can rely, the rest should be fetch from the supervisor.
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.
like here:
.build() | ||
|
||
val request = GetTokenRequest.newBuilder() | ||
.setHost(System.getenv("GITPOD_HOST").split("//").last()) |
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.
the same here, it should come from the supervisor info endpoint
@Suppress("MagicNumber") | ||
private val intervalInSeconds = 30 | ||
|
||
private val uri = "wss://${System.getenv("GITPOD_HOST").split("//").last()}/api/v1" |
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.
we should use the superviso info ednpoint to fetch all these data
I don't see the plugin using supervisor api to get configuration. Is it going to be addressed with the next PR? We should not read any Gitpod info from env vars or hardcode it. |
Does kotlin language support work for you? I cannot use find references and navigation? |
} catch (e: Exception) { | ||
// If connection fails for some reason, | ||
// remove the reference to the existing server. | ||
server.set(null) |
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.
it looks strange, usually reconneciton should be handled on transport level, client code should not care, create one instance and use
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.
Unfortunately, that's not the case. We could wrap the server and handle that separately, but I don't see a great benefit. Do you have any specific concerns?
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.
I need to check what we do under the hood, concern is that we leak underlying transport (web sockets) if the error is not about closing, but some application level error, like invalid json and so on.
/lgtm I looked through the code and left some comments. I think we can merge but they should be addressed with next PRs. I am also not sure about using Kotlin if the language support in VS Code does not work. /hold please remove hold if you want to merge it immediately |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akosyakov, corneliusludmann Associated issue: #5643 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What do you propose in regards to getting "CWM_HOST_STATUS_OVER_HTTP_TOKEN"?
I was surprised by the same thing. The good news is that you will be able to use IntelliJ IDEA soon 😅 I can switch the language to Java in a subsequent PR |
Is it configured by Intellij IDE then it is fine. It is about Gitpod env vars. We should use services to access them, env vars are implementation details.
Yes, we need a setup then to dogfood from IntelliJ rather soon. We don't need to switch to Java in this case, I prefer Kotlin as well. it is just we should have good DX for us as well. |
@akosyakov @corneliusludmann I suggest we merge as it is, making the changes in the next PR, since from what I understood the requests are not a blocker and I'll only be back next week (I'm working part-time on Monday, Wednesday, and Thursday mornings). |
/unhold |
ok, I added the follow up task to our epic |
Description
Create the IntelliJ backend plugin to provide support for Gitpod.
When installed in the headless IntelliJ running in a Gitpod workspace, this plugin monitors user activity of the client IntelliJ and sends heartbeats accordingly. Avoiding the workspace timing out.
Related Issue(s)
Addresses #5643
How to test
Manually tests are required.
./gradlew buildPlugin
.build/distributions/gitpod-intellij-plugin-1.0-SNAPSHOT.zip
to theplugins/
folder of the headless Jetbrains IDE.Release Notes
NONE
Documentation