feat: verify CLI protocol version on LS start [IDE-1652]#391
feat: verify CLI protocol version on LS start [IDE-1652]#391nick-y-snyk wants to merge 4 commits into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This comment has been minimized.
This comment has been minimized.
| ProcessBuilder pb = new ProcessBuilder(cliPath, "language-server", "--protocolVersion"); | ||
| pb.redirectErrorStream(true); | ||
| Process proc = pb.start(); | ||
| String output = new String(proc.getInputStream().readAllBytes()).trim(); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a650f99 to
0936ad9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Adds verifyCliProtocolVersion() called from start() after path validation. Aborts with IOException + user-visible message when CLI version doesn't match REQUIRED_LS_PROTOCOL_VERSION. Non-fatal on unparseable output.
638f254 to
fd0c365
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Would it be possible to add a smoke test that actually downloads a real Snyk CLI binary and exercises |
… CLI binary Downloads the real CLI via LsDownloader and asserts verifyCliProtocolVersion() is non-fatal when --protocolVersion flag is unknown (not yet in released builds).
PR Reviewer Guide 🔍
|
Description
Adds
verifyCliProtocolVersion()called fromSnykLanguageServer.start()after the CLI path is validated. If the CLI reports a protocol version that doesn't matchREQUIRED_LS_PROTOCOL_VERSION, the plugin logs and shows a user-visible error and aborts LS startup. Non-parseable output is treated as non-fatal (logged, startup continues).Matches the equivalent gate added in VSCode extension PR #733. Part of IDE-1652.
Checklist
Screenshots / GIFs
N/A — no UI change.