You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Includes product update to be announced in the next stable release notes
What does this PR do?
When --print-effective-graph-with-errors is set, the legacy CLI can fail on individual projects during a multi-project scan. These changes catch those project failures and return them as failedResults instead of throwing, so downstream consumers can include them to annotate sboms. Changes made to both the single and multi plugin route and is robust against full and partial failure of manifest file/'s.
Where should the reviewer start?
get-deps-from-plugin.ts --> Wrap the plugin around a try/catch to ensure we always return something.
get-multi-plugin-result.ts --> We make sure to return failedResults to later parse into scanError.
What's the product update that needs to be communicated to CLI users?
Any background context you want to provide?
This is for the JPMC "fail-fast initative" --> the idea is to annotate sbom's with failures rather than print to stdout.
Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:
src/lib/plugins/get-multi-plugin-result.ts
⚠️
You've modified files in src/ directory, but haven't updated anything in test folder. Is there something that could be tested?
⚠️
There are multiple commits on your branch, please squash them locally before merging!
The check !options['fail-fast'] at line 188 prevents the CLI from returning the failedResults structure when every project in a multi-project scan fails. Instead, it falls through to throw a terminal error. This is inconsistent with the single-project path in get-deps-from-plugin.ts (line 114), which returns the failed result regardless of fail-fast. This prevents the generation of an 'incomplete SBOM' (the PR's stated goal) for users in multi-project environments where fail-fast might be a default or configured setting.
In the catch block, the code accesses error.message. If the caught error is not an object (e.g., a string or undefined thrown by a plugin), this will cause a TypeError, crashing the process instead of returning the failed results. The same issue exists in get-multi-plugin-result.ts at line 170. Using optional chaining (error?.message) would make this robust catch-all safer.
consterrMessage=error.message??'Something went wrong getting dependencies';
📚 Repository Context Analyzed
This review considered 7 relevant code sections from 7 files (average relevance: 1.04)
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
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.
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
When --print-effective-graph-with-errors is set, the legacy CLI can fail on individual projects during a multi-project scan. These changes catch those project failures and return them as failedResults instead of throwing, so downstream consumers can include them to annotate sboms. Changes made to both the single and multi plugin route and is robust against full and partial failure of manifest file/'s.
Where should the reviewer start?
get-deps-from-plugin.ts --> Wrap the plugin around a try/catch to ensure we always return something.
get-multi-plugin-result.ts --> We make sure to return failedResults to later parse into scanError.
What's the product update that needs to be communicated to CLI users?
Any background context you want to provide?
This is for the JPMC "fail-fast initative" --> the idea is to annotate sbom's with failures rather than print to stdout.