[evaluation-plugin] LME-452 Quick-fix for the appeared problem with docker eel provider

GitOrigin-RevId: 6a6ed1b38343684387fde6fd69083e081c0b1dc9
This commit is contained in:
Roman Vasiliev
2025-09-02 10:24:26 +00:00
committed by intellij-monorepo-bot
parent 5564fe0c23
commit 76479bf81d
3 changed files with 44 additions and 2 deletions
@@ -17,6 +17,7 @@ import com.intellij.cce.evaluable.StrategySerializer
import com.intellij.cce.evaluation.BackgroundStepFactory
import com.intellij.cce.evaluation.EvaluationProcess
import com.intellij.cce.evaluation.FinishEvaluationStep
import com.intellij.cce.evaluation.allPreliminarySteps
import com.intellij.cce.evaluation.step.SetupStatsCollectorStep
import com.intellij.cce.evaluation.step.runInIntellij
import com.intellij.cce.util.ExceptionsUtil.stackTraceToString
@@ -93,7 +94,7 @@ internal class CompletionEvaluationStarter : ApplicationStarter {
}
protected fun runPreliminarySteps(feature: EvaluableFeature<*>, workspace: EvaluationWorkspace) {
for (step in feature.getPreliminaryEvaluationSteps()) {
for (step in allPreliminarySteps(feature)) {
println("Starting preliminary step: ${step.name}")
step.runInIntellij(null, workspace)
}
@@ -48,5 +48,9 @@ class BackgroundStepFactory(
override fun featureSpecificSteps(): List<EvaluationStep> = feature.getEvaluationSteps(config)
override fun featureSpecificPreliminarySteps(): List<EvaluationStep> = feature.getPreliminaryEvaluationSteps()
override fun featureSpecificPreliminarySteps(): List<EvaluationStep> = allPreliminarySteps(feature)
}
fun allPreliminarySteps(feature: EvaluableFeature<*>): List<EvaluationStep> = listOfNotNull(
DisableDockerEel().takeIf { System.getenv("EVALUATION_DOCKER_LOCAL") == "true" },
) + feature.getPreliminaryEvaluationSteps()
@@ -0,0 +1,37 @@
package com.intellij.cce.evaluation.step
import com.intellij.cce.evaluation.UndoableEvaluationStep
import com.intellij.cce.workspace.EvaluationWorkspace
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.extensions.impl.ExtensionPointImpl
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.registry.Registry
class DisableDockerEel : UndoableEvaluationStep {
override val name: String = "Disable Docker Eel"
override val description: String = "Quick-fix for ClassNotFoundException in docker environment"
private val disposable = Disposer.newDisposable()
private val registryKey = "vfs.fetch.case.sensitivity.using.eel"
private var registryValue: Boolean = false
override fun start(workspace: EvaluationWorkspace): EvaluationWorkspace {
Registry.get(registryKey).also { registryValue = it.asBoolean() }.setValue(false)
val ep = ApplicationManager.getApplication().extensionArea.getExtensionPointIfRegistered<Any>("com.intellij.eelProvider")
@Suppress("TestOnlyProblems")
(ep as? ExtensionPointImpl<*>)?.maskAll(emptyList(), disposable, true)
return workspace
}
override fun undoStep(): UndoableEvaluationStep.UndoStep {
return object : UndoableEvaluationStep.UndoStep {
override val name: String = "Undo Disable Docker Eel step"
override val description: String = "Restores original state"
override fun start(workspace: EvaluationWorkspace): EvaluationWorkspace {
Registry.get(registryKey).setValue(registryValue)
Disposer.dispose(disposable)
return workspace
}
}
}
}