Conversation
|
@ezopezo slack's dead so I guess I've gotta ping you here- this is the draft PR we discussed last week, I'm definitely still getting something wrong, i may need your help spotting the issue on our meeting later today. my amateur guess is I've messed something fundamental up with the SPDX package structure, or missed some key field in the capo json. still tracing things myself |
still trying to figure out why this isn't working
ezopezo
left a comment
There was a problem hiding this comment.
@ezopezo slack's dead so I guess I've gotta ping you here- this is the draft PR we discussed last week, I'm definitely still getting something wrong, i may need your help spotting the issue on our meeting later today.
my amateur guess is I've messed something fundamental up with the SPDX package structure, or missed some key field in the capo json. still tracing things myself
From the output of the integration tests I can see that your tests are attempting to access real base image in repository during the build:
2026-05-12 14:23:56,790 [ERROR] mobster.cmd.generate.oci_image: Contextual SBOM workflow failed.
Traceback (most recent call last):
File "/home/emravec/old/Documents/konflux/mobster/src/mobster/cmd/generate/oci_image/__init__.py", line 263, in _assess_and_dispatch_contextual_workflow
contextual_sbom = await self._execute_contextual_workflow(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
)
^
File "/home/emravec/old/Documents/konflux/mobster/src/mobster/cmd/generate/oci_image/__init__.py", line 190, in _execute_contextual_workflow
parent_image_sbom = await download_parent_image_sbom(parent_image_ref, arch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/emravec/old/Documents/konflux/mobster/src/mobster/cmd/generate/oci_image/contextual_sbom/contextualize.py", line 117, in download_parent_image_sbom
image_or_index = await Image.from_repository_digest_manifest(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
parent_image.repository, parent_image.digest
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/emravec/old/Documents/konflux/mobster/src/mobster/image.py", line 160, in from_repository_digest_manifest
manifest = await get_image_manifest(image.reference)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/emravec/old/Documents/konflux/mobster/src/mobster/oci/__init__.py", line 50, in get_image_manifest
raise SBOMError(f"Could not get manifest of {reference}: {stderr.decode()}")
mobster.error.SBOMError: Could not get manifest of quay.io/konflux-ci/syft@sha256:4ab0d32a67e22a27ea3ba4ad00a3a5aee008386ae4f0086c9a720401ab1aca45: Error response from registry: failed to fetch the content of "quay.io/konflux-ci/syft@sha256:4ab0d32a67e22a27ea3ba4ad00a3a5aee008386ae4f0086c9a720401ab1aca45": unauthorized: access to the requested resource is not authorized: map[]
This is not wanted, we want to mock and store these images ( builder / base ) via oci_client.create_image() in local storage. Check also how other helpers in test_contextual_parent.py are used (but might need an update for builder content!)
this is necessary to keep AnnotatedPackage/BuilderPkgMetadataItem generations lined up for the next commits AI used exclusively to fix my sloppy SBOMPackage conversions Assisted-By: claude-opus-4-6
forgot to commit+push this on friday, sorry
still trying to understand how the exact case is supposed to look in this scaffolding unfortunately Assisted-By: claude-opus-4-6, claude-sonnet-4-6
i think this is very close to what we need but adding the grandparent and parent stuff breaks it despite those origins still being correct Assisted-By: claude-opus-4-6
this causes the tests to pass, but i'm a little lost as to why
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #385 +/- ##
=======================================
Coverage 94.97% 94.97%
=======================================
Files 58 58
Lines 3921 3921
=======================================
Hits 3724 3724
Misses 197 197
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
OK, finally something workable here. @ezopezo & maybe @jedinym does this initial test accurately portray how this builder content should look? I have a couple notes here as well:
If by some miracle this test looks good as-is I can proceed to build out more, but I've been tripping over myself trying to understand what's going on here & how to represent it so I assume there are still some disconnects here and there. |
Nope capo's output only contains package metadata of the packages that are COPY-ied to final image. Let's draw general example and propose some integration test cases: Let's assume that builder_image:tag builder base image contain builder_package1 in /opt/app1 dir and builder_package1 in /opt/app2. Also imagine that base image of built component base_image:tag contains package base_package After build and capo scan, capo output should look like this; Quick reminder note: stuff from /opt/app2 in builder has never reached to capo output because it was never COPY-ied and thus never present in final image. Also content from base_image and installed in final image (component_only_package) is not relevant for capo. Now this is consumed by mobster and used for builder content contextualization. How? By matching purls from capo output against processed SBOM. Before this builder content resolution, parent content should be already resolved and SBOM should look like this (simplifying down to basic relevant relationships): After builder content contextualization the state of the SBOM should be; This is happy path scenario of course. I was thinking and I think this is other edge cases that should be covered:
|
This + the capo explainer made it click, thanks! I'm building out cases based on what you described & stuff like the oci-archive edgecase from the other PR. |
Oh and do not worry, if some things are not working as we described here in mobster - feel free to discuss it, let test fail (skip) and then we create a ticket for fixing that. |
|
I added tests that roughly map to what you specified - hopefully I'm not missing anything else? More notes:
|
|
Adding @jedinym as well and marking as ready for review - apologies for adding even more code review load, I just don't have confidence on what I'm doing here & wanna make sure both you and Erik as the process SMEs can catch the things I'm probably doing wrong |
Pre-merged with #376 as it requires that PR's functionality. Will rebase when merged.
Early pass for now, still working through what's actually going on here.