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
{{ message }}
Repository navigation
[BUG] Nested Components or Services breaks BOM validation #275
Thanks for the details @peschuster. Agree this is a bug in the library - so we'll work on a fix.
I'm also curious (so we can feedback to the Core CycloneDX group) what your Use Case is for nesting Components in bom.metadata.component? Would be great if you could share a real-world Use Case here.
@peschuster - reviewing in greater depth, and whilst I can't say that your example above contradicts the CycloneDX schema, I wonder whether your example is incorrect and should re-written.
From your example, I understand that:
Bom is describing Component app
app is has direct dependencies of comp_a and comp_b
comp_b has a direct dependency of comp_c
If my understanding is correct, then the expected way to model this in CycloneDX is as follows:
The nesting is not in bom.metadata.component, but in the list of components.
The use case for us is to keep the hierarchy of components on integration without the need for flattening the lists.
I see the root issue now - the validation in Bom.validate is not seeing the nested dependency (comp_c) when checking that we have a valid dependency tree.
changed the title [-][BUG] Support for nested Components in `bom.metadata.component`[/-][+][BUG] Nested Components or Services breaks BOM validation[/+]on Jul 27, 2022
@peschuster as you might see we are working to address the validation issue you have raised.
I did want to point out a bit of documentation which may or may not relate to how you are wishing to use CycloneDX for your reference.
With regards to Component.components (i.e. nested Components), the CycloneDX specification has this statement:
A list of software and hardware components included in the parent component. This is not a dependency tree. It provides a way to specify a hierarchical representation of component assemblies, similar to system -> subsystem -> parts assembly in physical supply chains.
@madpah the nesting is not about dependencies (but it can be, too)
It is mainly about bundling - like in node as described here: CycloneDX/cyclonedx-node-npm#13
Activity
madpah commentedon Jul 26, 2022
Hi @peschuster - thanks for raising this. Can you please:
cyclonedx-python-libyou are using?Thanks!
peschuster commentedon Jul 27, 2022
I am using version 2.7.0 of cyclonedx-python-lib.
Here is a short example that leads to this exception:
[-]Support for nested components?[/-][+][BUG] Support for nested Components in `bom.metadata.component`[/+]madpah commentedon Jul 27, 2022
Thanks for the details @peschuster. Agree this is a bug in the library - so we'll work on a fix.
I'm also curious (so we can feedback to the Core CycloneDX group) what your Use Case is for nesting Components in
bom.metadata.component? Would be great if you could share a real-world Use Case here.Thanks!
madpah commentedon Jul 27, 2022
@peschuster - reviewing in greater depth, and whilst I can't say that your example above contradicts the CycloneDX schema, I wonder whether your example is incorrect and should re-written.
From your example, I understand that:
appappis has direct dependencies ofcomp_aandcomp_bcomp_bhas a direct dependency ofcomp_cIf my understanding is correct, then the expected way to model this in CycloneDX is as follows:
Appreciate your feedback here.
FYI @jkowalleck
peschuster commentedon Jul 27, 2022
The nesting is not in
bom.metadata.component, but in the list of components.The use case for us is to keep the hierarchy of components on integration without the need for flattening the lists.
Here is the expected output for the example:
madpah commentedon Jul 27, 2022
Thanks for the quick response @peschuster.
I see the root issue now - the validation in
Bom.validateis not seeing the nested dependency (comp_c) when checking that we have a valid dependency tree.Will dig in further.
fix: properly support nested `components` and `services` #275
addressed JSON output for #275 including test addiitions
[-][BUG] Support for nested Components in `bom.metadata.component`[/-][+][BUG] Nested Components or Services breaks BOM validation[/+]aded XML output tests for Issue #275
madpah commentedon Jul 27, 2022
@peschuster as you might see we are working to address the validation issue you have raised.
I did want to point out a bit of documentation which may or may not relate to how you are wishing to use CycloneDX for your reference.
With regards to
Component.components(i.e. nested Components), the CycloneDX specification has this statement:This is taken from https://cyclonedx.org/docs/1.4/xml/#type_component.
Given your earlier description - I just wanted to make sure you were aware of this.
jkowalleck commentedon Jul 27, 2022
@madpah the nesting is not about dependencies (but it can be, too)
It is mainly about bundling - like in node as described here: CycloneDX/cyclonedx-node-npm#13
fix: properly support nested `components` and `services` #275
addressed JSON output for #275 including test addiitions
aded XML output tests for Issue #275
Merge pull request #276 from CycloneDX/fix/bom-validation-nested-comp…
madpah commentedon Aug 1, 2022
@peschuster https://pypi.org/project/cyclonedx-python-lib/2.7.1/ has been released.