-
-
Notifications
You must be signed in to change notification settings - Fork 27
feat: set devDependencies component.scope to excluded
#1374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: set devDependencies component.scope to excluded
#1374
Conversation
Signed-off-by: AradhyaTiwari10 <[email protected]>
Signed-off-by: AradhyaTiwari10 <[email protected]>
Signed-off-by: AradhyaTiwari10 <[email protected]>
Signed-off-by: AradhyaTiwari10 <[email protected]>
…etadata Signed-off-by: AradhyaTiwari10 <[email protected]>
Signed-off-by: AradhyaTiwari10 <[email protected]>
…roducible condition Signed-off-by: AradhyaTiwari10 <[email protected]>
Signed-off-by: AradhyaTiwari10 <[email protected]>
Signed-off-by: AradhyaTiwari10 <[email protected]>
component.scope to excluded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for the feature. solution looks promising.
just some small optimizations needed, and please revert the unintended changes that were not in the ticket's scope.
| bom.metadata.tools.components.add(toolC) | ||
| } | ||
| if (!this.reproducible) { | ||
| if (this.reproducible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an unintended change.
Please revert
| } else { | ||
| bom.serialNumber = Utils.BomUtility.randomSerialNumber() | ||
| bom.metadata.timestamp = new Date() | ||
| bom.metadata.properties.add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an unintended change.
Please revert
| } | ||
| // endregion metadata | ||
|
|
||
| // endregion metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an unintended change.
Please revert
| PackagePrivate = 'cdx:npm:package:private', | ||
| PackageDevelopment = 'cdx:npm:package:development', | ||
| PackageInstallPath = 'cdx:npm:package:path', | ||
| BomReproducible = 'cdx:reproducible', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be an unintended change.
Please revert
| component.scope = Enums.ComponentScope.Excluded | ||
| } else if (isOptional) { | ||
| component.scope = Enums.ComponentScope.Optional | ||
| } else if (data.dev === true || data.devOptional === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets have a const for the term data.dev === true || data.devOptional === true - list like isOptional.
Could you add this const and use it where possible?
This change updates SBOM generation to mark all components that appear only in devDependencies as "excluded", following the CycloneDX specification.
Details
Added a check for data.dev and data.devOptional flags in makeComponentWithPackageData.
Set component.scope = Enums.ComponentScope.Excluded for those components.
Ensures accurate differentiation between runtime (required) and development-only (excluded) dependencies.
Testing
All unit and integration tests pass (npm run test).
No lint errors except known deprecation warnings.
Related issue
Closes #1151