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
Auto-generate bom-refs for models that currently get none (licenses, organizations, contacts, …) #1084
BomRefDiscriminator guarantees that components, services and vulnerabilities always get a unique, non-empty bom-ref in the serialized output. Many other models can carry a bom-ref as well, but when none is set, none is written. This is the contract described in #861, which was never finished.
Related: #1068 (citation bom-refs are not collected by BomRefDiscriminator.from_bom()). In the discussion there, the same gap was found for the models listed below. Adding a model to from_bom() also means a value is generated when it has none, because discriminate() assigns one to every collected BomRef without a value. This issue covers that generation and its effect on the output.
Proposal
Generate a bom-ref at serialization time, as is already done for components, services and vulnerabilities, for:
@jkowalleck, before opening a PR we should decide on a design decision:
discriminate() gives a generated value to every BomRef that has none. That is a problem when the same object is reused in several places (e.g. one DisjunctiveLicense on two components). The license has a single BomRef, so the same generated bom-ref is written twice, and XML schema validation rejects duplicate bom-refs (unique identity-constraint 'bom-ref'). BOMs that are valid today could become invalid after an upgrade.
Options:
A. Generate only for owners that appear once in the BOM. A shared owner (and everything below it) is left alone.
Activity
wiebe-vandendriessche commentedon Nov 26, 2026
@jkowalleck, before opening a PR we should decide on a design decision:
discriminate()gives a generated value to everyBomRefthat has none. That is a problem when the same object is reused in several places (e.g. oneDisjunctiveLicenseon two components). The license has a singleBomRef, so the same generatedbom-refis written twice, and XML schema validation rejects duplicate bom-refs (unique identity-constraint 'bom-ref'). BOMs that are valid today could become invalid after an upgrade.Options:
from_bom()(BomRefDiscriminator.from_bom() does not collect citation bom-refs (CycloneDX 1.7) #1068) but skip refs with no value, so only explicit values are de-duplicated.I lean towards A. Which would you prefer? I'll follow your choice and note it in the PR.
jkowalleck commentedon Nov 27, 2026
converting to a discussion, so we can work in discussion threads on each individual aspect.