diff --git a/plugins/evaluation-plugin/src/com/intellij/cce/actions/CompletionEvaluationStarter.kt b/plugins/evaluation-plugin/src/com/intellij/cce/actions/CompletionEvaluationStarter.kt index 028ab0c8ed69..c915855eccb9 100644 --- a/plugins/evaluation-plugin/src/com/intellij/cce/actions/CompletionEvaluationStarter.kt +++ b/plugins/evaluation-plugin/src/com/intellij/cce/actions/CompletionEvaluationStarter.kt @@ -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) } diff --git a/plugins/evaluation-plugin/src/com/intellij/cce/evaluation/BackgroundStepFactory.kt b/plugins/evaluation-plugin/src/com/intellij/cce/evaluation/BackgroundStepFactory.kt index 5834e1a4d8d2..481328592785 100644 --- a/plugins/evaluation-plugin/src/com/intellij/cce/evaluation/BackgroundStepFactory.kt +++ b/plugins/evaluation-plugin/src/com/intellij/cce/evaluation/BackgroundStepFactory.kt @@ -48,5 +48,9 @@ class BackgroundStepFactory( override fun featureSpecificSteps(): List = feature.getEvaluationSteps(config) - override fun featureSpecificPreliminarySteps(): List = feature.getPreliminaryEvaluationSteps() + override fun featureSpecificPreliminarySteps(): List = allPreliminarySteps(feature) } + +fun allPreliminarySteps(feature: EvaluableFeature<*>): List = listOfNotNull( + DisableDockerEel().takeIf { System.getenv("EVALUATION_DOCKER_LOCAL") == "true" }, +) + feature.getPreliminaryEvaluationSteps() diff --git a/plugins/evaluation-plugin/src/com/intellij/cce/evaluation/step/DisableDockerEel.kt b/plugins/evaluation-plugin/src/com/intellij/cce/evaluation/step/DisableDockerEel.kt new file mode 100644 index 000000000000..d430fe9b41fa --- /dev/null +++ b/plugins/evaluation-plugin/src/com/intellij/cce/evaluation/step/DisableDockerEel.kt @@ -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("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 + } + } + } +} \ No newline at end of file