-
-
Notifications
You must be signed in to change notification settings - Fork 7
60 feat retrieve SBOM from image manifest if it exists #66
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: develop
Are you sure you want to change the base?
60 feat retrieve SBOM from image manifest if it exists #66
Conversation
Move hardcoded values to enum classes Add tests for new sbom methods
I am a bot, here is the pushed image/manifest for this PR:
|
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.
Pull Request Overview
This PR introduces a new SBOM (Software Bill of Materials) generation approach that attempts to retrieve SBOM data directly from image manifests using Docker buildx imagetools before falling back to the existing Syft-based method. The changes also refactor hardcoded strings into enum classes for better maintainability.
- Adds new SBOM generation methods that prioritize manifest-based retrieval over container scanning
- Introduces enum classes for CI test names, results, and platforms to replace hardcoded strings
- Deprecates the existing
generate_sbom
method in favor of the newmake_sbom
approach
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
ci/ci.py | Core implementation of new SBOM methods and enum classes for better code organization |
tests/test_ci.py | Updated tests to use new enum classes and added comprehensive test coverage for new SBOM methods |
tests/sbom_buildx_formatted_blob.txt | Test fixture containing formatted SBOM output for validation |
test_build.py | Updated to use new enum classes for consistent status handling |
Dockerfile | Added docker-buildx-plugin dependency required for new SBOM functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ci/ci.py
Outdated
badge.write_badge(f"{self.outdir}/badge.svg", overwrite=True) | ||
with open(f"{self.outdir}/ci-status.yml", "w", encoding="utf-8") as file: | ||
file.write(f"CI: '{self.report_status}'") | ||
file.write(f"CI: '{self.report_status.value}'\n") |
Copilot
AI
Oct 4, 2025
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.
The newline character should be removed from this line. The original code without the newline was correct, and adding it may cause issues with YAML parsing if this file is meant to be consumed as valid YAML.
file.write(f"CI: '{self.report_status.value}'\n") | |
file.write(f"CI: '{self.report_status.value}'") |
Copilot uses AI. Check for mistakes.
ci/ci.py
Outdated
""" | ||
start_time = time.time() | ||
sbom: str | CITestResult = self.get_sbom_buildx_blob(tag) | ||
if isinstance(sbom, str) and sbom != CITestResult.ERROR: |
Copilot
AI
Oct 4, 2025
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.
This comparison is incorrect. sbom
is a string but CITestResult.ERROR
is an enum instance. The comparison should be sbom != CITestResult.ERROR.value
to compare the string value.
if isinstance(sbom, str) and sbom != CITestResult.ERROR: | |
if isinstance(sbom, str) and sbom != CITestResult.ERROR.value: |
Copilot uses AI. Check for mistakes.
I am a bot, here is the pushed image/manifest for this PR:
|
I am a bot, here is the pushed image/manifest for this PR:
|
Depends on linuxserver/docker-jenkins-builder#352 now so we can properly test across a range of images. |
New
Adds methods for retrieving SBOM from manifest, will fall back to use syft if it fails.
make_sbom
get_sbom_syft
get_sbom_buildx_blob
parse_buildx_sbom
format_package_table
Added tests for new methods.
test_parse_buildx_sbom
test_format_package_table
test_get_sbom_buildx_blob
test_make_sbom
Changed
Moved repeating hardcoded values into enum classes.
CITests
CITestResult
CIReportResult
Platform
Deprecated
generate_sbom