-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Export command - Export SBOM from storage #75
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: Export command - Export SBOM from storage #75
Conversation
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@houdini91 Thanks for working on this PR! I think Let us know if you need anything. CC/ @ashearin and @jhoward-lm |
After giving it some thought, I think it makes more sense to me for this sub command to be called The reason is for parity with a potential |
I'm trying to mentally walk through how a user would use bomctl with multiple SBOMs or SBOMs with externalRefs to other SBOMs. I think its worth creating an ADR outlining a common philosophy for "piping" multiple SBOMs from this command. If the If the |
What are your thoughts for the naming convention of the files in that tree structure, or ways to specify multiple output file names and map them to the input URLs
It might not necessarily have to be a single input or output SBOM, thinking along the lines of how tools like |
In my opinion, large stdout and stdin strings are useful when using pipes but not very practical when printed directly to the terminal. I also agree that the save command should be renamed to export. IMHO one if the use case is exporting an SBOM to a third-party system or generating a report. In such cases, outputting a collection/tree of SBOMs files may be useful and more natural to some systems. I was under the impression that creating a unified SBOM should be the responsibility of the merge command, not the export/save command. |
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Sorry for the delay, i was yet on another small vacation.
Changed
I Patched the code with both these suggestions, what do you think?
Open Q: |
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.
Need to run golangci-lint locally and address findings
Co-authored-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com> Signed-off-by: mikey strauss <mdstrauss91@gmail.com>
Co-authored-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com> Signed-off-by: mikey strauss <mdstrauss91@gmail.com>
Co-authored-by: jhoward-lm <140011346+jhoward-lm@users.noreply.github.com> Signed-off-by: mikey strauss <mdstrauss91@gmail.com>
@houdini91 we talked about this PR today at the community meeting. It looks like its in good shape. There are two requests and then we're good to merge.
I realize this PR been open for a while, thank you for being patient with us! |
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@idunbarh @jhoward-lm I think i fixed all your comments. I ran a local test and it worked as expected.
|
Current Status of usage.
|
I decided to set the default format string to
This might be related to protobom/protobom#213. |
Having the default as Also for the last linting issue I think changing the linting rules to allow the max cyclomatic complexity to 13 is reasonable (or take an exception and suppress error). |
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.
Final suggestions to address lint findings and resolve conflicts with list
PR
I think the complexity rule is there for a reason to keep our code easy to read and understand, so I would prefer to avoid modifying the golangci-lint configs if at all possible. The fix should be pretty simple, just create a private function for the first switch statement, something like func getFormatMap(encoding string) (map[string]formats.Format, error) {
switch encoding {
case formats.JSON:
return JSONFormatMap(), nil
case formats.TEXT:
return TVFormatMap(), nil
case formats.XML:
return XMLFormatMap(), nil
default:
return formats.EmptyFormat,
errUnknownEncoding
}
} |
Lint passed Fhew...! |
We're so close! Looks like there is one commit that is not signed, which is blocking us from merging. Can you squash and sign? We'll merge after that. It will be great to get this command and round out the initial functionality. Thank you for all of the time spent on this :-D |
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.
Just some last minute suggestions to leverage the ent client debugging if you get time.
EDIT: these can be done in a follow on issue if time is a factor
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
11b2c17
to
7d2049d
Compare
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@idunbarh @jhoward-lm Squashed offending commit, my bad. |
Signed-off-by: Ian Dunbar-Hall <ian.dunbar-hall@lmco.com>
Export SBOMs Command
Description
Suggestion for a
Save
Command, Considering @jhoward-lm Comment.Typically, users populate the database using the fetch command. This new command will allow users to save SBOMs to their local filesystem.
Usage suggestion.
Issues
Option 1: Output as tar archive
Option 2: Append index to file path
Option 3: Do not support multiple SBOM IDs in the command
Open to other suggestions
Type of change
How Has This Been Tested?
Waiting for feedback before implementing tests.