Skip to content

Commit

Permalink
Upgrade platform version of JetBrains Backend Plugin (EAP) (#20236)
Browse files Browse the repository at this point in the history
* Update Platform Version of JetBrains Backend Plugin (EAP) to

* Fix latest editor build

* Fixup

* revert year changes

* fix rider build

* 1

---------

Co-authored-by: Robo Quat <[email protected]>
  • Loading branch information
mustard-mh and roboquat authored Sep 23, 2024
1 parent cfe795c commit 6f7298d
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 17 deletions.
3 changes: 2 additions & 1 deletion components/ide/jetbrains/backend-plugin/BUILD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ packages:
- "build.sh"
env:
- JB_QUALIFIER=stable-rider
- NO_VERIFY_JB_PLUGIN=${noVerifyJBPlugin}
# Force skip plugin verification for Rider
- NO_VERIFY_JB_PLUGIN=true
config:
commands:
- ["mv", "build.gradle-stable.kts", "build.gradle.kts"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Code generated by gha-update-image/index-jb-platform-update.ts. DO NOT EDIT.
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild=242.19533
pluginUntilBuild=242.*
# revert pluginSinceBuild if it's unnecessary
pluginSinceBuild=243.15521
pluginUntilBuild=243.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions.
pluginVerifierIdeVersions=2024.2
pluginVerifierIdeVersions=2024.3
# Version from "com.jetbrains.intellij.idea" which can be found at https://www.jetbrains.com/intellij-repository/snapshots
platformVersion=242.21829.142
platformVersion=243.15521.24
2 changes: 1 addition & 1 deletion components/ide/jetbrains/backend-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginVersion=0.0.1
gitpodVersion=dev
# Supported environments: stable, latest (via https://github.com/stevesaliman/gradle-properties-plugin)
environmentName=stable-rider
environmentName=latest
# IntelliJ Platform Artifacts Repositories
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
pluginGroup=io.gitpod.jetbrains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@
package io.gitpod.jetbrains.remote

import com.jetbrains.ide.model.uiautomation.BeControl
import com.jetbrains.ide.model.uiautomation.BeMargin
import com.jetbrains.ide.model.uiautomation.DefiniteProgress
import com.jetbrains.rd.platform.codeWithMe.unattendedHost.metrics.Metric
import com.jetbrains.rd.ui.bedsl.dsl.*
import com.jetbrains.rd.ui.bedsl.dsl.util.BeMarginsBuilder
import com.jetbrains.rd.util.lifetime.Lifetime
import com.jetbrains.rd.util.reactive.Property
import com.jetbrains.rdserver.diagnostics.BackendDiagnosticsService
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.performance.MetricControlProvider
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.performance.createProgressBar

interface IBackendDiagnosticsService {
fun getMetric(name: String): com.jetbrains.rd.platform.codeWithMe.unattendedHost.metrics.Metric
}

abstract class AbstractGitpodMetricControlProvider : MetricControlProvider {
override val id: String = "gitpodMetricsControl"

abstract fun setMargin(element: BeControl, left: Int, top: Int, right: Int, bottom: Int): BeControl;

abstract fun getBackendDiagnosticsService(): IBackendDiagnosticsService

override fun getControl(lifetime: Lifetime): BeControl {
val backendDiagnosticsService = BackendDiagnosticsService.Companion.getInstance()
val backendDiagnosticsService = this.getBackendDiagnosticsService()
return verticalGrid {
row {
horizontalGrid {
Expand All @@ -49,7 +52,7 @@ abstract class AbstractGitpodMetricControlProvider : MetricControlProvider {
}
}

private fun createWorkspaceHeaderRow(ctx: VerticalGridBuilder, backendDiagnosticsService: BackendDiagnosticsService, lifetime: Lifetime) {
private fun createWorkspaceHeaderRow(ctx: VerticalGridBuilder, backendDiagnosticsService: IBackendDiagnosticsService, lifetime: Lifetime) {
val labelProperty = Property("")

val workspaceClassMetric = backendDiagnosticsService.getMetric("gitpod_workspace_class")
Expand Down Expand Up @@ -78,7 +81,7 @@ abstract class AbstractGitpodMetricControlProvider : MetricControlProvider {
}
}

private fun createCpuControl(ctx: VerticalGridBuilder, backendDiagnosticsService: BackendDiagnosticsService, lifetime: Lifetime) {
private fun createCpuControl(ctx: VerticalGridBuilder, backendDiagnosticsService: IBackendDiagnosticsService, lifetime: Lifetime) {
val cpuUsed = backendDiagnosticsService.getMetric("gitpod_workspace_cpu_used")
val cpuTotal = backendDiagnosticsService.getMetric("gitpod_workspace_cpu_total")
val cpuPercentage = backendDiagnosticsService.getMetric("gitpod_workspace_cpu_percentage")
Expand All @@ -100,7 +103,7 @@ abstract class AbstractGitpodMetricControlProvider : MetricControlProvider {
createProgressControl(ctx, lifetime, label, cpuPercentage, labelProperty, cpuPercentageProperty, progressBar)
}

private fun createMemoryControl(ctx: VerticalGridBuilder, backendDiagnosticsService: BackendDiagnosticsService, lifetime: Lifetime) {
private fun createMemoryControl(ctx: VerticalGridBuilder, backendDiagnosticsService: IBackendDiagnosticsService, lifetime: Lifetime) {
val memoryUsed = backendDiagnosticsService.getMetric("gitpod_workspace_memory_used")
val memoryTotal = backendDiagnosticsService.getMetric("gitpod_workspace_memory_total")
val memoryPercentage = backendDiagnosticsService.getMetric("gitpod_workspace_memory_percentage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.http.FullHttpRequest
import io.netty.handler.codec.http.QueryStringDecoder
import io.prometheus.client.exporter.common.TextFormat
import kotlinx.coroutines.*
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.jetbrains.ide.RestService
import org.jetbrains.io.response
import java.io.OutputStreamWriter
Expand Down Expand Up @@ -113,7 +116,9 @@ class GitpodCLIService : RestService() {
GlobalScope.launch {
getClientSessionAndProjectAsync().let { (session, project) ->
ClientId.withClientId(session.clientId) {
action(project)
runBlocking {
action(project)
}
sendOk(request, context)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ package io.gitpod.jetbrains.remote.latest
import com.jetbrains.ide.model.uiautomation.BeControl
import com.jetbrains.ide.model.uiautomation.DefiniteProgress
import com.jetbrains.rd.platform.codeWithMe.unattendedHost.metrics.Metric
import com.jetbrains.rd.ui.bedsl.dsl.*
import com.jetbrains.rd.ui.bedsl.dsl.VerticalGridBuilder
import com.jetbrains.rd.ui.bedsl.dsl.withMargin
import com.jetbrains.rd.util.lifetime.Lifetime
import com.jetbrains.rd.util.reactive.Property
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.performance.createProgressRow
import com.jetbrains.rdserver.unattendedHost.diagnostics.BackendDiagnosticsService
import io.gitpod.jetbrains.remote.AbstractGitpodMetricControlProvider
import io.gitpod.jetbrains.remote.IBackendDiagnosticsService

class GitpodMetricControlProvider: AbstractGitpodMetricControlProvider() {
override fun setMargin(element: BeControl, left: Int, top: Int, right: Int, bottom: Int) = element.withMargin(left, top, right, bottom)

override fun getBackendDiagnosticsService(): IBackendDiagnosticsService {
val obj = BackendDiagnosticsService.Companion.getInstance()
return object : IBackendDiagnosticsService {
override fun getMetric(name: String): Metric {
return obj.getMetric(name)
}
}
}

override fun createProgressControl(ctx: VerticalGridBuilder, lifetime: Lifetime, label: String, cpuPercentage: Metric, labelProperty: Property<String>, cpuPercentageProperty: Property<String>, progressBar: DefiniteProgress) {
createProgressRow(ctx, id, lifetime, label, cpuPercentage.statusProperty, labelProperty, cpuPercentageProperty, progressBar)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import com.jetbrains.ide.model.uiautomation.BeControl
import com.jetbrains.ide.model.uiautomation.BeMargin
import com.jetbrains.ide.model.uiautomation.DefiniteProgress
import com.jetbrains.rd.platform.codeWithMe.unattendedHost.metrics.Metric
import com.jetbrains.rd.ui.bedsl.dsl.*
import com.jetbrains.rd.ui.bedsl.dsl.VerticalGridBuilder
import com.jetbrains.rd.ui.bedsl.dsl.util.BeMarginsBuilder
import com.jetbrains.rd.ui.bedsl.dsl.withMargin
import com.jetbrains.rd.util.lifetime.Lifetime
import com.jetbrains.rd.util.reactive.Property
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.performance.createProgressRow
import com.jetbrains.rdserver.diagnostics.BackendDiagnosticsService
import io.gitpod.jetbrains.remote.AbstractGitpodMetricControlProvider
import io.gitpod.jetbrains.remote.IBackendDiagnosticsService

class GitpodMetricControlProvider: AbstractGitpodMetricControlProvider() {
override fun setMargin(element: BeControl, left: Int, top: Int, right: Int, bottom: Int): BeControl {
Expand All @@ -22,6 +25,15 @@ class GitpodMetricControlProvider: AbstractGitpodMetricControlProvider() {
return element
}

override fun getBackendDiagnosticsService(): IBackendDiagnosticsService {
val obj = BackendDiagnosticsService.Companion.getInstance()
return object : IBackendDiagnosticsService {
override fun getMetric(name: String): Metric {
return obj.getMetric(name)
}
}
}

override fun createProgressControl(ctx: VerticalGridBuilder, lifetime: Lifetime, label: String, cpuPercentage: Metric, labelProperty: Property<String>, cpuPercentageProperty: Property<String>, progressBar: DefiniteProgress) {
createProgressRow(ctx, id, lifetime, label, cpuPercentage.statusProperty, labelProperty, cpuPercentageProperty, progressBar)
}
Expand Down

0 comments on commit 6f7298d

Please sign in to comment.