Skip to content

Commit cfdff14

Browse files
mustard-mhroboquat
andauthored
Make JetBrains backend plugin compatible with 2025.1 (#20549)
* Update Platform Version of JetBrains Backend Plugin (EAP) to Tool: gitpod/catfood.gitpod.cloud * Make it build Tool: gitpod/catfood.gitpod.cloud * Fix rider Tool: gitpod/catfood.gitpod.cloud * Fix use-latest checkbox not working Tool: gitpod/catfood.gitpod.cloud --------- Co-authored-by: Robo Quat <[email protected]>
1 parent a68d7ef commit cfdff14

File tree

8 files changed

+46
-14
lines changed

8 files changed

+46
-14
lines changed

Diff for: .github/workflows/jetbrains-update-plugin-platform-template.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- [x] /werft with-large-vm
9191
- [x] /werft with-gce-vm
9292
- [x] with-integration-tests=jetbrains
93-
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'latest') }}
93+
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'true') }}
9494
9595
_This PR was created automatically with GitHub Actions using [this](https://github.com/gitpod-io/gitpod/blob/main/.github/workflows/jetbrains-update-plugin-platform-template.yml) template._
9696
commit-message: "Update Platform Version of ${{ inputs.pluginName }} to ${{ steps.latest-version.outputs.result }}"
@@ -134,7 +134,7 @@ jobs:
134134
- [x] /werft with-large-vm
135135
- [x] /werft with-gce-vm
136136
- [x] with-integration-tests=jetbrains
137-
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'latest') }}
137+
- [x] latest-ide-version=${{ contains(inputs.pluginId, 'true') }}
138138
139139
_This PR was created automatically with GitHub Actions using [this](https://github.com/gitpod-io/gitpod/blob/main/.github/workflows/jetbrains-update-plugin-platform-template.yml) template._
140140
commit-message: "Update Platform Version of ${{ inputs.pluginName }} to ${{ steps.latest-version.outputs.result }}"

Diff for: components/ide/jetbrains/backend-plugin/gradle-latest.properties

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
33
# for insight into build numbers and IntelliJ Platform versions.
44
# revert pluginSinceBuild if it's unnecessary
5-
pluginSinceBuild=243.15521
6-
pluginUntilBuild=243.*
5+
pluginSinceBuild=251.17181
6+
pluginUntilBuild=251.*
77
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
88
# See https://jb.gg/intellij-platform-builds-list for available build versions.
9-
pluginVerifierIdeVersions=2024.3
10-
# Version from "com.jetbrains.intellij.idea" which can be found at https://www.jetbrains.com/intellij-repository/snapshots
11-
platformVersion=243.15521.24
9+
pluginVerifierIdeVersions=2025.1
10+
# Version from "com.jetbrains.intellij.idea" which can be found at https://www.jetbrains.com/updates/updates.xml or exec `./gradlew printProductsReleases`
11+
platformVersion=251.17181.16

Diff for: components/ide/jetbrains/backend-plugin/src/main/kotlin/io/gitpod/jetbrains/remote/GitpodClientProjectSessionTracker.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.intellij.ide.BrowserUtil
99
import com.intellij.notification.NotificationAction
1010
import com.intellij.notification.NotificationType
1111
import com.intellij.openapi.Disposable
12-
import com.intellij.openapi.client.ClientSessionsManager
12+
import com.intellij.openapi.client.ClientProjectSession
1313
import com.intellij.openapi.components.service
1414
import com.intellij.openapi.components.serviceOrNull
1515
import com.intellij.openapi.diagnostic.thisLogger
@@ -35,10 +35,10 @@ import java.util.concurrent.CancellationException
3535
import java.util.concurrent.CompletableFuture
3636

3737
@Suppress("UnstableApiUsage", "OPT_IN_USAGE")
38-
class GitpodClientProjectSessionTracker(private val project: Project) : Disposable {
38+
abstract class AbstractGitpodClientProjectSessionTracker(private val project: Project) : Disposable {
3939

4040
private val manager = service<GitpodManager>()
41-
private val session = ClientSessionsManager.getProjectSession(project)
41+
abstract val session: ClientProjectSession?
4242

4343
private lateinit var info: Info.WorkspaceInfoResponse
4444
private val lifetime = Lifetime.Eternal.createNested()
@@ -226,7 +226,7 @@ class GitpodClientProjectSessionTracker(private val project: Project) : Disposab
226226
private fun trackEvent(eventName: String, props: Map<String, Any?>) {
227227
if (session == null) return
228228
manager.trackEvent(eventName, mapOf(
229-
"sessionId" to session.clientId.value
229+
"sessionId" to session?.clientId?.value
230230
).plus(props))
231231
}
232232
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License.AGPL.txt in the project root for license information.
4+
5+
package io.gitpod.jetbrains.remote.latest
6+
7+
import com.intellij.codeWithMe.ClientId
8+
import com.intellij.openapi.client.ClientProjectSession
9+
import com.intellij.openapi.client.ClientSessionsManager
10+
import com.intellij.openapi.project.Project
11+
import io.gitpod.jetbrains.remote.AbstractGitpodClientProjectSessionTracker
12+
13+
@Suppress("UnstableApiUsage")
14+
class GitpodClientProjectSessionTracker(val project: Project) : AbstractGitpodClientProjectSessionTracker(project) {
15+
override val session: ClientProjectSession? = ClientSessionsManager.getProjectSession(project, ClientId.current)
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) 2025 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License.AGPL.txt in the project root for license information.
4+
5+
package io.gitpod.jetbrains.remote.stable
6+
7+
import com.intellij.openapi.client.ClientProjectSession
8+
import com.intellij.openapi.client.ClientSessionsManager
9+
import com.intellij.openapi.project.Project
10+
import io.gitpod.jetbrains.remote.AbstractGitpodClientProjectSessionTracker
11+
12+
@Suppress("UnstableApiUsage")
13+
class GitpodClientProjectSessionTracker(val project: Project) : AbstractGitpodClientProjectSessionTracker(project) {
14+
override val session: ClientProjectSession? = ClientSessionsManager.getProjectSession(project)
15+
}

Diff for: components/ide/jetbrains/backend-plugin/src/main/resources-latest/META-INF/extensions.xml

+2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
<!--suppress PluginXmlValidity -->
77
<idea-plugin>
88
<extensions defaultExtensionNs="com.intellij">
9+
<projectService serviceImplementation="io.gitpod.jetbrains.remote.latest.GitpodClientProjectSessionTracker"
10+
client="controller" preload="true"/>
911
</extensions>
1012
</idea-plugin>

Diff for: components/ide/jetbrains/backend-plugin/src/main/resources-stable/META-INF/extensions.xml

+2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
<!--suppress PluginXmlValidity -->
77
<idea-plugin>
88
<extensions defaultExtensionNs="com.intellij">
9+
<projectService serviceImplementation="io.gitpod.jetbrains.remote.stable.GitpodClientProjectSessionTracker"
10+
client="controller" preload="true"/>
911
</extensions>
1012
</idea-plugin>

Diff for: components/ide/jetbrains/backend-plugin/src/main/resources/META-INF/plugin.xml

-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838

3939
<httpRequestHandler implementation="io.gitpod.jetbrains.remote.GitpodCLIService"/>
4040

41-
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodClientProjectSessionTracker"
42-
client="controller" preload="true"/>
43-
4441
<gateway.customization.name
4542
implementation="io.gitpod.jetbrains.remote.GitpodGatewayClientCustomizationProvider"/>
4643
<gateway.customization.metrics id="gitpodMetricsProvider"

0 commit comments

Comments
 (0)