From 62c3a5f599c0b9fc37b535e6cae74de5837edd0f Mon Sep 17 00:00:00 2001 From: Bastian Doetsch Date: Mon, 5 Feb 2024 11:35:14 +0100 Subject: [PATCH] fix: don't cancel the progress when file existent and downloads disabled --- CHANGELOG.md | 4 ++++ src/main/kotlin/io/snyk/plugin/SnykPostStartupActivity.kt | 4 ++-- .../kotlin/io/snyk/plugin/services/SnykTaskQueueService.kt | 1 - .../io/snyk/plugin/services/SnykTaskQueueServiceTest.kt | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 858b3c2ac..3fd86a01b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Snyk Changelog +## [2.7.2] +### Fixed +- manually downloaded binaries were causing problems initiating scans + ## [2.7.1] ### Fixed - only start up language server after CLI update (fixes lock error on Windows) diff --git a/src/main/kotlin/io/snyk/plugin/SnykPostStartupActivity.kt b/src/main/kotlin/io/snyk/plugin/SnykPostStartupActivity.kt index 056d0e54d..9fdcf9fb2 100644 --- a/src/main/kotlin/io/snyk/plugin/SnykPostStartupActivity.kt +++ b/src/main/kotlin/io/snyk/plugin/SnykPostStartupActivity.kt @@ -81,12 +81,12 @@ class SnykPostStartupActivity : ProjectActivity { AnnotatorCommon.initRefreshing(project) if (!ApplicationManager.getApplication().isUnitTestMode) { - getSnykTaskQueueService(project)?.waitUntilCliDownloadedIfNeeded(EmptyProgressIndicator()) try { + getSnykTaskQueueService(project)?.waitUntilCliDownloadedIfNeeded(EmptyProgressIndicator()) getSnykTaskQueueService(project)?.connectProjectToLanguageServer(project) getAnalyticsScanListener(project)?.initScanListener() } catch (e: Exception) { - Logger.getInstance(SnykPostStartupActivity::class.java).error(e) + Logger.getInstance(SnykPostStartupActivity::class.java).warn(e) } } diff --git a/src/main/kotlin/io/snyk/plugin/services/SnykTaskQueueService.kt b/src/main/kotlin/io/snyk/plugin/services/SnykTaskQueueService.kt index a6bf9d20b..8e58e6b1a 100644 --- a/src/main/kotlin/io/snyk/plugin/services/SnykTaskQueueService.kt +++ b/src/main/kotlin/io/snyk/plugin/services/SnykTaskQueueService.kt @@ -290,7 +290,6 @@ class SnykTaskQueueService(val project: Project) { "Please put a Snyk CLI executable in ${pluginSettings().cliPath} and retry." SnykBalloonNotificationHelper.showError(msg, project) } - indicator.cancel() return } val cliDownloader = getSnykCliDownloaderService() diff --git a/src/test/kotlin/io/snyk/plugin/services/SnykTaskQueueServiceTest.kt b/src/test/kotlin/io/snyk/plugin/services/SnykTaskQueueServiceTest.kt index 94d0b0219..b2a81da68 100644 --- a/src/test/kotlin/io/snyk/plugin/services/SnykTaskQueueServiceTest.kt +++ b/src/test/kotlin/io/snyk/plugin/services/SnykTaskQueueServiceTest.kt @@ -128,6 +128,7 @@ class SnykTaskQueueServiceTest : LightPlatformTestCase() { val settings = setupAppSettingsForDownloadTests() settings.manageBinariesAutomatically = false val snykTaskQueueService = project.service() + every { isCliInstalled() } returns true snykTaskQueueService.scan()