Skip to content

Support WSL#523

Merged
attiasas merged 11 commits into
jfrog:masterfrom
attiasas:support_wsl
May 14, 2026
Merged

Support WSL#523
attiasas merged 11 commits into
jfrog:masterfrom
attiasas:support_wsl

Conversation

@attiasas
Copy link
Copy Markdown
Collaborator

@attiasas attiasas commented Apr 16, 2026

  • All tests passed. If this feature is not already covered by the tests, I added new tests.

feat: support WSL when using the JFrog IDEA plugin

Summary

This change makes the plugin behave correctly when the project lives on a Windows Subsystem for Linux (WSL) filesystem (\\wsl$\… / //wsl$/…): security scans run inside the detected distro via wsl.exe, paths are normalized across WSL UNC and IntelliJ spellings, and SARIF locations map to files the IDE can open. This depends on coordinated updates in ide-plugins-common and build-info (see below).

Depends on

Merge or release order should satisfy these dependencies before this plugin change ships.

Changes

  • ScanBinaryExecutor: Per-executor state instead of statics; WSL branch runs the analyzer under the distro (wsl.exe), Linux roots/temp/output, credential env via WSLENV, chmod for extracted binary; default analyzer manager version 1.31.1.
  • ScanUtils: WSL distro parsing from UNC paths; Linux home and arch inside the distro.
  • DescriptorPathUtils (new): WSL/IDE path equivalence, VirtualFile resolution, SARIF file:///…\\wsl$\{distro}\… on Windows when a distro is known.
  • SourceCodeScannerManager: Detect WSL from Windows project base path; wire applicability and binary executors with distro when applicable.
  • JFrogSecurityWarning / inspections / tree / scanners: Use new path utilities so findings, annotations, and descriptor discovery align with WSL paths.
  • build.gradle: Dependency versions aligned with the upstream PRs (including SNAPSHOTs while integrating); finalize released versions before release.

Testing

  • Unit tests: DescriptorPathUtilsTest, ScanBinaryExecutorTest (and full ./gradlew test / CI).
  • Manual on Windows: project under \\wsl$\<distro>\…, run scans, confirm navigation to source and stable UI/tree behavior.

@attiasas attiasas added improvement Automatically generated release notes safe to test Approve running integration tests on a pull request labels Apr 16, 2026
@Ahm-khd-seb
Copy link
Copy Markdown

@attiasas What is the estimated time of delivering this?

@attiasas
Copy link
Copy Markdown
Collaborator Author

attiasas commented Apr 30, 2026

@attiasas What is the estimated time of delivering this?

@Ahm-khd-seb Probably around next week

Should finish today (and then review + releases)

@attiasas attiasas requested a review from a team May 5, 2026 07:52
@attiasas attiasas added new feature Automatically generated release notes and removed improvement Automatically generated release notes labels May 5, 2026
Comment thread src/main/java/com/jfrog/ide/idea/scan/ScanBinaryExecutor.java Outdated
Comment thread src/main/java/com/jfrog/ide/idea/scan/ScanBinaryExecutor.java Outdated
Comment thread src/main/java/com/jfrog/ide/idea/scan/utils/ScanUtils.java
Comment thread src/main/java/com/jfrog/ide/idea/scan/utils/ScanUtils.java
Path targetPath = null;
Path archivePath = null;
try {
String linuxHome = ScanUtils.getWslLinuxHome(distro);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unhandled error - No guard if getWslLinuxHome throws — object reaches inconsistent state (binaryLinuxPath null while wslDistro is set)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's ok.
We have the notSupported attribute that is set and guard the shouldExecute func

null, new NullLog(), Long.MAX_VALUE, TimeUnit.MINUTES);
Map<String, String> credentialEnv = createCredentialEnv();
Map<String, String> wslEnv = createEnvWithCredentials();
wslEnv.put("WSLENV", String.join(":", credentialEnv.keySet()));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WSLENV credential forwarding: ensure only the intended variables are exported, not the full environment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

we want to forward all env, similar to other tools and without WSL

Comment thread src/main/java/com/jfrog/ide/idea/scan/ScanBinaryExecutor.java
Comment thread src/test/java/com/jfrog/ide/idea/scan/ScanBinaryExecutorTest.java Outdated
Comment thread src/main/java/com/jfrog/ide/idea/scan/utils/ScanUtils.java
Comment thread src/main/java/com/jfrog/ide/idea/scan/utils/ScanUtils.java Outdated
Comment thread src/main/java/com/jfrog/ide/idea/scan/ScanBinaryExecutor.java Outdated
@attiasas attiasas deployed to frogbot May 14, 2026 06:09 — with GitHub Actions Active
@attiasas attiasas requested a review from orto17 May 14, 2026 06:09
@github-actions
Copy link
Copy Markdown

👍 Frogbot scanned this pull request and did not find any new security issues.


@attiasas attiasas merged commit 1f7f22c into jfrog:master May 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Automatically generated release notes safe to test Approve running integration tests on a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants