-
Notifications
You must be signed in to change notification settings - Fork 19
suggestion: convert command initial #33
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
Conversation
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>
@houdini91 thanks for the contribution! Looking forward to checking it out. Just a couple of upcoming things I want to highlight because they might impact these changes:
Thanks again! We can discuss it further as a group in the SBOM tooling call on Monday |
Sure, could you share the meeting schedule? I can't seem to find it in the OpenSSF calendar. I'll review the lint PR to ensure I'm aligned with it. In my opinion, the changes mainly affect how the protobuf document can be stored, whereas the convert command currently operates on the in-memory object. Could you explain how you see this change impacting the implementation? |
@idunbarh can you invite Mikey to the bomctl working group meeting?
They also affect methods of interaction with the protoboms. One of the driving ideas for bomctl is to persist and save changes in the underlying database, and I see bomctl's interactions with the protobom types as being limited to parsing JSON data from remote URLs, translating between protobom and ent database representations, and writing a JSON file to disk. I think the convert logic might fit in as something like:
I think it would be cool to have both options, personally. Although I'm not sure how it would work with a "tree" of SBOMs referenced by the SBOM specified. |
@houdini91 it was great briefly meeting you in person at OSS NA last week. Puerco and you were talking about selection of the protobom migration date. The meeting is the SBOM Tooling Working Meeting and is Monday at 5pm Eastern. We should probably go ahead and bite the bullet and get this project formally sandboxed within the OpenSSF. Right now its considered an "experiment" of the OpenSSF Security Tooling WG. |
@jhoward-lm @idunbarh I try to amend this feature to reflect your suggestion to utilize the fetch command with output capabilities. May I ask what where you thinking should be the identifier of a sbom after it consumed by the database in order to pull and export it? (Serial?, subject name? Some running number? User provided label? all of the above?) |
In ent, it's all about the The pieces aren't all in place yet, but it will probably end up looking something like import (
"github.com/protobom/storage/backends/ent"
"github.com/protobom/storage/backends/ent/metadata"
)
func main() {
client := ent.NewClient()
document := client.Document.Query().
QueryMetadata().
Where(metadata.IDEQ("<serialNumber/unique ID>"))
// convert ent Document to protobom Document
// write file with protobom Writer/desired serializer
} Not 100% sure on the final syntax there, but something like that. Since it's probably a common operation, there would likely be a helper function written for it. |
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
I removed the convert command entirely. Let me know if I should open a new branch and PR to reflect this. I pushed an update to this PR to try and materialize this comment. Have a look and see if it matches what you were trying to convey Regarding the usage of Fetch:
I currently force explicitly setting the |
I just realized that if more than one SBOM URL positional argument can be provided, there isn't a way to correlate each of them to a particular We can either:
@idunbarh Thoughts? My preference would probably be the latter, but it won't really be possible until the ent changes are merged into the new protobom storage project. |
@jhoward-lm how do you envision this working? Would a user specify which to save/export based on the ID of the document? For example: Initial cmd: Then If so, would it be helpful to have a I'm not sure if Protobom already covers this, but in case it doesn't |
Initially, I thought the multi-file output support was planned to be achieved by adding an index before the file extension, based on what I saw in the code. However, there are actually 2 dimensions sbom lists: the URL list provided by the user and the sbom tree if found. Another approach could be to allow exporting a zip/tar or simple directory. This could be implemented by supporting an "output-bundle" or "output directory" option, or simply using the output file name and adding a .tar or .zip extension. We could remove the output capabilities from the fetch command altogether and wait for the export command. Lets Close the pr in this case and wait for storage changes. However, this would make operations like converting or pulling the bom tree a two-step process instead of one. I also agree that adding a "list" command could be a valuable addition. |
I closing the PR i don't think it relevant, as mention convert will be supported over the storage with store and retrieve basic flow and options. |
I closing the PR i don't think it relevant, as mentioned above convert will be supported over the storage with store and retrieve basic flow and options. |
Hello everyone,
As a contributor to the core Protobom library, I'm exploring the integration of a conversion command into bomctl, similar to the implementation found in https://github.com/bom-squad/sbom-convert. I hope this addition aligns with project guidelines and doesn't overstep any boundaries. Please feel free to review, suggest changes, or provide feedback on the proposed pull request.
The pull request introduces a Convert Command, which empowers users to seamlessly switch between SBOM formats.
To give it a try, execute the following command:
Here's the current command's usage:
Fixes # (issue)
Type of change
How Has This Been Tested?
Currently not tested TBD
Checklist