Repository navigation
CM-77192: Fix IaC detection paths without a leading slash - #108
Open
aaron-butler-cy-int wants to merge 3 commits into
Open
aaron-butler-cy-int wants to merge 3 commits into
aaron-butler-cy-int wants to merge 3 commits into
Conversation
…of failing Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aaron-butler-cy-int
requested review from
avishaiamiel and
omer-roth
as code owners
November 26, 2026 14:31
…ST does Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The results tree failed to load (and stayed empty) when a detection path was not absolute. The tree shows paths relative to the project root with
File(filePath).relativeTo(projectRoot), which throwsIllegalArgumentException: this and base files have different rootswhen one path is absolute and the other is not.Seen in plugin 3.2.0 on IntelliJ IDEA 2026.1.1: an IaC detection for
Users/aaron.butler/git/NodeGoat/Dockerfile(no leading slash) against the root/Users/aaron.butler/git/NodeGoat.SastDetectionDetails.getFilepath(). A CLI change moved IaC to the async scan flow (same endpoint as SAST), which passes the backend's path through unmodified, so IaC paths now arrive the same way.IacDetectionDetails.getFilepath()now returns an absolute path (adds the leading slash when the path is not absolute), as SAST does. This also matters beyond the tree: the editor annotators, the result filters and the context menu compare the raw path, so a slash-less IaC path would never match.toProjectRelativePaththat never throws:Dockerfile);../Other/a.js);TreeView.createDetectionNodesuses it instead ofrelativeTo.The
relativeTocall predates the scan scope work (CM-35346, #63). The slash-less path comes from the scan result; it is not yet known whether the CLI 3.25.0 raise changed it. With the IDE working directory at/(a macOS app launch), such a path still resolves to a real file, so it passes the existing "file exists" filter and only the tree crashed.Jira
CM-77192
Testing
./gradlew test): newDetectionPathTestcovers the IaC path with and without the leading slash, andProjectRelativePathTestcovers the path from the report, relative paths, paths outside the project and a project without a root.🤖 Generated with Claude Code