diff --git a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/BUILD.bazel b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/BUILD.bazel index 235c37d47a23..a69b11866949 100644 --- a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/BUILD.bazel +++ b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/BUILD.bazel @@ -28,7 +28,6 @@ jvm_library( "//platform/core-ui", "//python/ide/customization.shared", "//platform/platform-impl/update-checker", - "//platform/util/jdom", ] ) ### auto-generated section `build intellij.pycharm.community.ide.impl.promotion` end \ No newline at end of file diff --git a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/intellij.pycharm.community.ide.impl.promotion.iml b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/intellij.pycharm.community.ide.impl.promotion.iml index 4fcf121fe617..ee64d4dcecfb 100644 --- a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/intellij.pycharm.community.ide.impl.promotion.iml +++ b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/intellij.pycharm.community.ide.impl.promotion.iml @@ -22,6 +22,5 @@ - \ No newline at end of file diff --git a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/resources/intellij.pycharm.community.ide.impl.promotion.xml b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/resources/intellij.pycharm.community.ide.impl.promotion.xml index b418a7e98c6a..a5fe774c1ed5 100644 --- a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/resources/intellij.pycharm.community.ide.impl.promotion.xml +++ b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/resources/intellij.pycharm.community.ide.impl.promotion.xml @@ -101,10 +101,6 @@ - - diff --git a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/src/com/intellij/pycharm/community/ide/impl/promotion/communityToUnified/PyCommunityToUnifiedPromoService.kt b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/src/com/intellij/pycharm/community/ide/impl/promotion/communityToUnified/PyCommunityToUnifiedPromoService.kt index d90fb94580f6..ba86784dbfb9 100644 --- a/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/src/com/intellij/pycharm/community/ide/impl/promotion/communityToUnified/PyCommunityToUnifiedPromoService.kt +++ b/python/ide/impl/intellij.pycharm.community.ide.impl.promotion/src/com/intellij/pycharm/community/ide/impl/promotion/communityToUnified/PyCommunityToUnifiedPromoService.kt @@ -3,13 +3,14 @@ package com.intellij.pycharm.community.ide.impl.promotion.communityToUnified import com.intellij.ide.util.PropertiesComponent import com.intellij.openapi.application.ApplicationInfo -import com.intellij.openapi.application.PathManager import com.intellij.openapi.components.Service import com.intellij.openapi.components.service import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.updateSettings.UpdateStrategyCustomization -import com.intellij.openapi.updateSettings.impl.* -import com.intellij.openapi.util.JDOMUtil +import com.intellij.openapi.updateSettings.impl.PlatformUpdates +import com.intellij.openapi.updateSettings.impl.UpdateCheckerFacade +import com.intellij.openapi.updateSettings.impl.UpdateSettings +import com.intellij.openapi.updateSettings.impl.UpdateStrategy import com.intellij.openapi.util.registry.Registry import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -18,8 +19,6 @@ import kotlinx.coroutines.sync.withLock import kotlinx.coroutines.time.withTimeout import kotlinx.coroutines.withContext import org.jetbrains.annotations.ApiStatus -import java.nio.file.Files -import java.nio.file.Path import java.time.Duration /** @@ -101,37 +100,6 @@ internal class PyCommunityToUnifiedPromoService(val serviceScope: CoroutineScope }.getOrElse { null } } - private fun readMockUpdateIfEnabled(): PlatformUpdates.Loaded? { - return try { - if (!Registry.`is`("py.promo.use.test.update", false)) return null - val path: Path = Path.of(PathManager.getHomePath(), "py_promo_test.xml") - if (!Files.isRegularFile(path)) { - LOG.info("Mock PY promo update enabled, but file not found: $path") - null - } - else { - val text = Files.readString(path) - val currentBuild = ApplicationInfo.getInstance().build - val productCode = currentBuild.productCode - val node = JDOMUtil.load(text) - .getChild("product") - ?.getChild("channel") - ?: throw IllegalArgumentException("//channel missing") - val channel = UpdateChannel(node, productCode) - val newBuild = channel.builds.firstOrNull() - ?: throw IllegalArgumentException("//build missing") - val patches = newBuild.patches.firstOrNull() - ?.let { UpdateChain(listOf(it.fromBuild, newBuild.number), it.size) } - - return PlatformUpdates.Loaded(newBuild, channel, patches) - } - } - catch (t: Throwable) { - LOG.warn("Failed to read/parse mock PY promo update", t) - null - } - } - private suspend fun findAvailableUpdate(): PlatformUpdates.Loaded? { return withContext(Dispatchers.IO) { lock.withLock { @@ -140,14 +108,6 @@ internal class PyCommunityToUnifiedPromoService(val serviceScope: CoroutineScope return@withTimeout availableUpdate } - // Try mocked update if registry flag is enabled - readMockUpdateIfEnabled()?.let { mockUpdate -> - if (mockUpdate.newBuild.number.productCode == "PY") { - availableUpdate = mockUpdate - return@withTimeout mockUpdate - } - } - val updateCheckerFacade = service() val product = updateCheckerFacade.loadProductData(null) if (product == null) {