-
-
Notifications
You must be signed in to change notification settings - Fork 29
Fix merge of definitions and declarations #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: andreas hilti <69210561+andreas-hilti@users.noreply.github.com>
a657cc5 to
601080f
Compare
| result.Vulnerabilities = vulnerabilitiesMerger.Merge(bom1.Vulnerabilities, bom2.Vulnerabilities); | ||
|
|
||
| if (bom1.Definitions != null && bom2.Definitions != null) | ||
| if (bom1.Definitions != null || bom2.Definitions != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitions were skipped if not all BOMs had them.
| } | ||
|
|
||
| if (bom1.Declarations != null && bom2.Declarations != null) | ||
| if (bom1.Declarations != null || bom2.Declarations != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, Declarations were skipped if not all BOMs had them.
| result.Declarations.Targets.Organizations = new ListMergeHelper<OrganizationalEntity>().Merge(bom1.Declarations.Targets.Organizations, bom2.Declarations.Targets.Organizations); | ||
| result.Declarations.Targets.Components = new ListMergeHelper<Component>().Merge(bom1.Declarations.Targets.Components, bom2.Declarations.Targets.Components); | ||
| result.Declarations.Targets.Services = new ListMergeHelper<Service>().Merge(bom1.Declarations.Targets.Services, bom2.Declarations.Targets.Services); | ||
| result.Declarations.Targets = new Targets(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Targets wasn't initialized.
|
|
||
| if (bomSubject != null) | ||
| { | ||
| if (result.Metadata == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metadata wasn't initialized.
| } | ||
| } | ||
|
|
||
| if (result.Dependencies == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependencies were not initialized.
Fixes a couple of issues discovered while working on merge functionality