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
Currently, components that differ only in the property bom-ref are treated as equal.
This is for the reason, that bom-ref is actually just a decorative marker for interlinkage.
Anyway, there are external tools and processes that produce CycloneDX like this:
when these things are imported by this library, the components get deduplicated (since they are equal) - which causes issues with the dependency tree - and alternates the structure when exporting.
solution
bom-ref MUST be taken into account for the following processes
equality and comparison (__eq__, __lt__, __gt__, ...)
hashing (__hash__)
❗ Since BomRef will become a central part of hashing and comparison, we need to revisit the respective dunder methods on BomRef.
I was debugging my code for ages, not getting why some of my "LIBRARY"-Components, I have been adding successfully, where lost after adding other components - well just because they where regarded as the same component and then got overwritten with another component having a different bom-ref but same name.
Of course usually you'd have more properties assigned making them distinguishable over the hash, however, when you start with some basic code and add an "assumed-to-be-a-reference" it is a bit confusion when components get lost.
context
Currently, components that differ only in the property
bom-ref
are treated as equal.This is for the reason, that
bom-ref
is actually just a decorative marker for interlinkage.Anyway, there are external tools and processes that produce CycloneDX like this:
These are, schema-wise, valid CycloneDX.
the problem
when these things are imported by this library, the components get deduplicated (since they are equal) - which causes issues with the dependency tree - and alternates the structure when exporting.
solution
bom-ref
MUST be taken into account for the following processes__eq__
,__lt__
,__gt__
, ...)__hash__
)❗ Since
BomRef
will become a central part of hashing and comparison, we need to revisit the respective dunder methods onBomRef
.related
closes #753
The text was updated successfully, but these errors were encountered: