Skip to content

feat: auto-create metadata.component with default values#66

Open
cdsbarrera wants to merge 5 commits intosiemens:mainfrom
cdsbarrera:fix/issue-65-metadata-component-autocreation
Open

feat: auto-create metadata.component with default values#66
cdsbarrera wants to merge 5 commits intosiemens:mainfrom
cdsbarrera:fix/issue-65-metadata-component-autocreation

Conversation

@cdsbarrera
Copy link

Description

Implements automatic creation of metadata.component with default values when it's missing from the BOM.

Changes

  • Added _insert_standard_bom_metadata_component_entry_if_missing() method to StandardBom class
  • Method creates a Component with default values: name='Unknown Name', version='0.0.0', type=APPLICATION
  • Added 5 comprehensive unit tests covering creation, preservation, and property access scenarios

Fixes #65

"""
if self.bom.metadata.component is None:
self.bom.metadata.component = Component(
name='Unknown Name',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the benefit of this, on the contrary as this defaults a certain value set, we'll end up with lots of SBOMs for the same Unknown Name@0.0.0 application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add metadata.component field if is missing

2 participants