Skip to content

chore(language-server): integrate LS - #7046

Open
team-ide-user wants to merge 1 commit into
mainfrom
chore/automatic-upgrade-of-ls
Open

chore(language-server): integrate LS#7046
team-ide-user wants to merge 1 commit into
mainfrom
chore/automatic-upgrade-of-ls

Conversation

@team-ide-user

@team-ide-user team-ide-user commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Changes since last integration of Language Server

commit 46b2bf4f1f5a5d1cb0ae518c0065541dd6737ca1
Author: Bastian Doetsch <bastian.doetsch@snyk.io>
Date:   Tue Jul 28 14:36:52 2026 +0200

    fix: stabilize scan-dedup cancellation race in Test_SeveralScansOnSameFolder_DoNotRunAtOnce [IDE-2099] (#1382)
    
    ## Summary
    Fixes the flaky `Test_SeveralScansOnSameFolder_DoNotRunAtOnce` (IDE-2099), observed failing on `smoke (1, windows-latest)` with 2 finished scans instead of 1.
    
    Root cause: OSS/IaC scan deduplication cancelled a superseded scan by sending on an **unbuffered** `cancel` channel that had to be received by a `go Listen(...)` goroutine. If that goroutine had not yet been scheduled when the next scan called `CancelScan()`, the send blocked up to the 5s safety timeout — long enough for the superseded scan's execution to finish, so the dedup count was 2.
    
    Fix: register the context `CancelFunc` on `ScanProgress` via `SetCancelFunc` (before `go Listen(...)` and before inserting into `runningScans`, under the scanner mutex), and have `CancelScan` invoke it **directly** while guarded by the `ScanProgress` mutex — removing the goroutine-readiness dependency entirely. The legacy unbuffered-channel path is preserved for any caller that does not set a cancel func. Applied at both call sites (`infrastructure/oss/cli_scanner.go`, `infrastructure/iac/iac.go`).
    
    ## Changes
    - `internal/scans/scan_progress.go`: add `cancelFunc` field + `SetCancelFunc` (mutex-guarded); `CancelScan` calls it directly when set.
    - `infrastructure/oss/cli_scanner.go`, `infrastructure/iac/iac.go`: call `SetCancelFunc(cancel)` before starting `Listen`.
    - `internal/scans/scan_progress_test.go`: regression test (immediate cancel without a running listener) + concurrency race test for `SetCancelFunc`/`CancelScan` under `-race`.
    
    ## Test plan
    - [x] `go test ./internal/scans/... ./infrastructure/oss/... ./infrastructure/iac/... -race` — green
    - [x] New regression test fails without the fix (5s block), passes with it
    - [x] `make test` full unit suite — 203 ok, 0 failures; `go build ./... && go vet ./...` clean; golangci-lint 0 issues
    - [ ] CI smoke on windows-latest
    
    _Produced by an automated flake-fix loop._

M	infrastructure/iac/iac.go
M	infrastructure/oss/cli_scanner.go
M	internal/scans/scan_progress.go
M	internal/scans/scan_progress_test.go

@team-ide-user
team-ide-user requested a review from a team as a code owner July 28, 2026 12:42
@team-ide-user
team-ide-user enabled auto-merge July 28, 2026 12:42
@snyk-io

snyk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown
Contributor
Warnings
⚠️

"chore: automatic integration of language server 46b2bf4f1f5a5d1cb0ae518c0065541dd6737ca1" is too long. Keep the first line of your commit message under 72 characters.

Generated by 🚫 dangerJS against ead727f

@snyk-pr-review-bot

Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected
📚 Repository Context Analyzed

This review considered 4 relevant code sections from 4 files (average relevance: 0.98)

🤖 Repository instructions applied (from AGENTS.md)

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.

1 participant