Skip to content
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

feat: add merge command #143

Merged
merged 3 commits into from
Sep 5, 2024
Merged

Conversation

pkwiatkowski1
Copy link
Contributor

@pkwiatkowski1 pkwiatkowski1 commented Aug 26, 2024

Description

Added merge capability.

This first iteration of the merge command depends on the current state of protobom's merging capabilities by leveraging Union method on NodeLists and augment method for the new root node. All other operations for other types follow the same principle of if a field already exists don't update else update. Merging priority is determined by the left most specified document id.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Locally via several different imported sboms of both spdx and cylconedx types.
  • Added unit tests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@jhoward-lm
Copy link
Contributor

Your PR title needs to be a conventional commit so the changelog generates correctly, probably feat: add merge command

@pkwiatkowski1 pkwiatkowski1 changed the title Add merge command feat: merge command Aug 26, 2024
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merger.go Outdated Show resolved Hide resolved
internal/pkg/merge/merger.go Outdated Show resolved Hide resolved
internal/pkg/merge/merger.go Outdated Show resolved Hide resolved
@pkwiatkowski1 pkwiatkowski1 changed the title feat: merge command feat: add merge command Aug 29, 2024
cmd/merge.go Outdated Show resolved Hide resolved
cmd/merge.go Outdated Show resolved Hide resolved
cmd/merge.go Outdated Show resolved Hide resolved
cmd/root.go Outdated Show resolved Hide resolved
cmd/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merger.go Outdated Show resolved Hide resolved
internal/pkg/options/options.go Outdated Show resolved Hide resolved
@idunbarh
Copy link
Member

idunbarh commented Sep 4, 2024

Please update the README.md that includes the command instructions.

@pkwiatkowski1 pkwiatkowski1 marked this pull request as ready for review September 4, 2024 15:14
@pkwiatkowski1 pkwiatkowski1 requested a review from a team as a code owner September 4, 2024 15:14
Copy link

@mfrystacky mfrystacky left a comment

Choose a reason for hiding this comment

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

Review part 1

.golangci.yml Show resolved Hide resolved
README.md Show resolved Hide resolved
cmd/merge.go Outdated Show resolved Hide resolved
cmd/merge.go Show resolved Hide resolved
cmd/merge.go Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Outdated Show resolved Hide resolved
internal/pkg/merge/merge.go Show resolved Hide resolved
internal/pkg/merge/merge.go Show resolved Hide resolved
Copy link

@mfrystacky mfrystacky left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@jhoward-lm jhoward-lm left a comment

Choose a reason for hiding this comment

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

Looks good!

cmd/merge.go Outdated Show resolved Hide resolved
@pkwiatkowski1 pkwiatkowski1 force-pushed the add-merge-command branch 2 times, most recently from 3bf182b to 0533b86 Compare September 5, 2024 21:00
Signed-off-by: Patrick Kwiatkowski <[email protected]>
Signed-off-by: Patrick Kwiatkowski <[email protected]>
@ashearin ashearin merged commit def20bd into bomctl:main Sep 5, 2024
7 checks passed
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.

5 participants