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

Base images SBOM script: support SPDX #201

Merged
merged 11 commits into from
Dec 16, 2024

Conversation

chmeliik
Copy link
Contributor

@chmeliik chmeliik commented Dec 9, 2024

@chmeliik
Copy link
Contributor Author

chmeliik commented Dec 9, 2024

Note: you really want to go commit by commit when reviewing this. The ones that really matter are:

  • implement spdx-update function
  • enable SPDX support
  • add SPDX tests
  • upgrade to python3.12

The rest is formatting, refactoring etc.

@chmeliik chmeliik requested review from tkdchen and mkosiarc December 9, 2024 13:39
@chmeliik
Copy link
Contributor Author

chmeliik commented Dec 9, 2024

Based on #163

* disable flake8 line-length check
  (it's useless, we have 'black' for formatting checks)
* drop unnecessary '# noqa' comments

Signed-off-by: Adam Cmiel <[email protected]>
This script will need some changes soon, those will be far easier to do
with type checking enabled.

Signed-off-by: Adam Cmiel <[email protected]>
Just move the code from main to a function and slightly simplify.
This is preparation for SPDX support.

Signed-off-by: Adam Cmiel <[email protected]>
Takes a list of base images in SPDX format, adds them to .packages,
updates .relationships correspondingly.

Signed-off-by: Adam Cmiel <[email protected]>
Auto-detect the format of the input SBOM. Call the right SBOM-update
function based on the format.

Signed-off-by: Adam Cmiel <[email protected]>
Also fix some minor formatting issues

Signed-off-by: Adam Cmiel <[email protected]>
Don't break up single lines into multiple lines

Signed-off-by: Adam Cmiel <[email protected]>
It's not a valid part of CycloneDX. Remove it from the example data.

Signed-off-by: Adam Cmiel <[email protected]>
Consolidate the test_main_* functions into a single parameterized test.
Completely equivalent to the previous tests, just with less duplication.

Signed-off-by: Adam Cmiel <[email protected]>
Previously, the container image used python3.9 while tests ran on
python(unknown but > 3.9).

Upgrade container to python3.12 and set tests to run on 3.12 explicitly.

Signed-off-by: Adam Cmiel <[email protected]>
@chmeliik chmeliik force-pushed the baseimage-sbom-script-spdx branch from afa8a92 to 19e0101 Compare December 10, 2024 10:43
@chmeliik
Copy link
Contributor Author

Dropped the line-length change - I noticed all the other scripts use 120 as well.

@chmeliik chmeliik merged commit c64330f into konflux-ci:main Dec 16, 2024
1 check passed
@chmeliik chmeliik deleted the baseimage-sbom-script-spdx branch December 16, 2024 09:01
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.

3 participants