Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CLI update & download [IDE-123][IDE-124] #468

Merged
merged 6 commits into from
Jan 31, 2024

Conversation

bastiandoetsch
Copy link
Collaborator

@bastiandoetsch bastiandoetsch commented Jan 30, 2024

Description

We have received several reports that CLI updates under Windows don't work. This is due to a file lock.

This PR ensures two things:

  1. Independent of the number of projects, only one instance of the CLI is started in language server mode snyk language-server in the background.
  2. CLI download, whether initial or an update, comes first, before the CLI is started in the background. This ensures the download does not run into a file lock under Windows.

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

image

Opened 5 projects, and verified only one snyk-win.exe process:
image

@bastiandoetsch bastiandoetsch marked this pull request as ready for review January 30, 2024 16:23
@bastiandoetsch bastiandoetsch requested a review from a team as a code owner January 30, 2024 16:23
@bastiandoetsch bastiandoetsch changed the title fix: CLI update & download fix: CLI update & download [IDE-123][IDE-124] Jan 30, 2024
Copy link
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice commit.

}

fun scan() {
taskQueue.run(object : Task.Backgroundable(project, "Snyk: initializing...", true) {
override fun run(indicator: ProgressIndicator) {
// FIXME: this should be using content roots instead of basePath

Check warning

Code scanning / detekt

Flags a forbidden comment. Warning

Forbidden FIXME todo marker in comment, please fix the problem.
- automatic downloads setting is now checked centrally
- downloads should be done via the task service - SnykCliAuthenticationService now uses the task service, too
- fixed a potential NPE in SnykTaskQueueService
- removed superfluous test
- adjusted mocking
@bastiandoetsch bastiandoetsch merged commit 0696a57 into master Jan 31, 2024
8 checks passed
@bastiandoetsch bastiandoetsch deleted the fix/IDE-124_fix-CLI-update branch January 31, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants