Fixes issue of empty CBOM creation when no SonarQube rule is activated #388
Fixes issue of empty CBOM creation when no SonarQube rule is activated #388medha-14 wants to merge 2 commits into
Conversation
Signed-off-by: medha-14 <medha140904@gmail.com>
|
I’ve addressed the issue with the empty |
There was a problem hiding this comment.
Thanks for the contribution, @medha-14! 🙌
LGTM!
One friendly nudge: if it's feasible, a small regression test asserting "no CBOM file is written when aggregators are empty" would lock this in. I noticed there aren't any existing tests for OutputFileJob / ScannerManager (the static aggregators make it a bit awkward to test cleanly), so this is a nice-to-have rather than a blocker — happy to merge as-is.
Approving. Thanks again!
Signed-off-by: medha-14 <medha140904@gmail.com>
|
@n1ckl0sk0rtge Thanks for the review. I have added the tests, please have a look and let me know if anything else is needed. I’d be happy to iterate further on this if needed. |
san-zrl
left a comment
There was a problem hiding this comment.
Hi @medha-14,
Thanks again for submitting this PR. Before merging could you remove the change of the user.dir system property in the test?
The test already uses an absolute path for the temporary folder
String cbomBaseName = tempDir.resolve("cbom").toAbsolutePath().toString();
Absolute paths don't depend on user.dir: When you pass an absolute path to new File(), Java doesn't use the working directory at all - it uses the path exactly as provided.
The user.dir manipulation is redundant. It is only necessary if relative paths were used.
fixes #265