Add dependency graph info to BoM - #244
Conversation
Signed-off-by: Manjunath Mandya Surendrakumar <manjunathms35@gmail.com>
|
this PR supersedes #243 |
|
@ManjunathMS35 regarding your TODO:
you might find this write-up/decision-paper from another CycloneDX project helpful: https://github.com/CycloneDX/cyclonedx-php-library/blob/master/docs/dev/decisions/BomDependencyDataModel.md |
Signed-off-by: Manjunath Mandya Surendrakumar <manjunathms35@gmail.com>
| return deplist | ||
| } | ||
|
|
||
| createPackageURL (pkg) { |
There was a problem hiding this comment.
❗ there is code to crate a PURL already. see
cyclonedx-node-module/model/Component.js
Line 43 in b8f6940
if you really want to use a PURL as the bom-ref's value, please incorporate the already existing PURL creation.
Reasons: if a bom-ref looks like a PURL, i would expect it to be the actual PURL of a Component, not a string that was crafted somehow else.
There was a problem hiding this comment.
This is the reason I wanted to implement the BomReference class and make use of creation of PURL in both Component and Bom. Is it okay to do something like this?
| Object.keys(pkg._dependencies) | ||
| .map(x => pkg.dependencies[x]) | ||
| .filter(x => x !== undefined && typeof (x) !== 'string') // remove cycles | ||
| .map(x => deplist.push(new Dependency(this.createPackageURL(x), this.createDependency(x, list)))) |
There was a problem hiding this comment.
❓
how do you handle, if this.createPackageURL() returns null? which is totally possible from the current algorithm used?
There was a problem hiding this comment.
Its not handled yet and as I said in the previous comment, creation of BomReference class will solve this issue.
|
@ManjunathMS35, thanks for working on this feature. it is appreciated. I am not too familiar with the JavaScript code base, so some of my latest comments might be not justified a 100% |
Even I am not familiar with best practices of JavaScript, I will try my best to answer your questions. |
|
will come back as soon as #247 was addressed. |
|
a good solution would be to "find" the component that is referenced in the already existing need to think more about the topic. will come back later. |
|
i think having dedicated Type for A constraint i see: In the current major version the new type must extend |
|
superseded by #296 |
This is related to the issue #61
Changes:
ToDo: