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

Add initial support for generating SPDX SBOM documents (COMPOSER-2274) #930

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

thozza
Copy link
Member

@thozza thozza commented Sep 13, 2024

This PR depends on osbuild/osbuild#1818

  • Add a simple sbom package for working with SBOM documents.
  • Extend the dnfjson Solver.Depsolve() to support requesting SBOM documents for depsolved transactions.

@thozza
Copy link
Member Author

thozza commented Sep 18, 2024

The PR is ready for review.

@thozza
Copy link
Member Author

thozza commented Sep 19, 2024

The osbuild-composer test failures are expected (and not blocking), since the PR needs code changes to be integrated in osbuild-composer.

pkg/dnfjson/dnfjson.go Outdated Show resolved Hide resolved
pkg/dnfjson/dnfjson.go Outdated Show resolved Hide resolved
Update the ref to a version, which supports SBOM documents.

Signed-off-by: Tomáš Hozza <[email protected]>
Add a new `sbom` package for working with SBOM documents. It provides a
very simple wrapper struct, which currently supports only SPDX standard.
The SBOM document is for now stored in a raw JSON form, to not have to
convert the raw data from and to the specific in-memory representation
on the worker.

The idea is to provide a bit of an abstraction from the specific SBOM
implementation, so that in the future, it would be possible to create
`sbom.Document` from SBOM documents of various standards and also
serialize it back to various SBOM standards.

Signed-off-by: Tomáš Hozza <[email protected]>
Extend the `Solver.Depsolve()` method to allow requesting SBOM document
for the depsolved transaction. In case an SBOM document is requested, a
pointer to `sbom.Document` instance is returned with the depsolve
result.

Signed-off-by: Tomáš Hozza <[email protected]>
Since the number of the `Solver.Depsolve()` return values is slowly
getting out of hands, introduce a `DepsolveResult` struct containing all
of the return values. `Depsolve()` now returns a pointer to
`DepsolveResult`.

Signed-off-by: Tomáš Hozza <[email protected]>
Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

TY! LGTM

Copy link
Contributor

@schuellerf schuellerf left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thozza thozza added this pull request to the merge queue Sep 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2024
@achilleas-k achilleas-k added this pull request to the merge queue Sep 19, 2024
Merged via the queue into osbuild:main with commit 88b5895 Sep 19, 2024
17 of 19 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.

4 participants