-
Notifications
You must be signed in to change notification settings - Fork 46
Use Syft for generating SBOM #3994
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
75cdeed to
19e9f65
Compare
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.
Thank you very much!
I think we have to refactor the overview of open-source packages after this PR, but I think it's great that it contains the actual license :)
We're currently in merge freeze. I'd suggest to merge this by the end of the week :)
b8f10c4 to
b1a13cf
Compare
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.
I'm not sure how comfortable I am with merging this. Yes, this is "just" the SBOM for our project and no load bearing functionality for the project itself. But it will run in our pipeline for every release and every commit/push on develop. I'd rather like to understand it a little more.
When running syft locally – whether I have the venv activated or not – I get a different structure of the json manifest (1.33.0-1 installed via pacman, though syft --version reports [not provided], which I hope is not critical, the behaviour should be the same). I made sure to have a cleanly installed virtual environment.
Also, I'm astounded by your version referencing packages for a venv with python3.13:
- "sourceInfo": "acquired package info from installed python package manifest file: /.venv/lib/python3.13/site-packages/aiosignal-1.4.0.dist-info/METADATA, /.venv/lib/python3.13/site-packages/aiosignal-1.4.0.dist-info/RECORD, /.venv/lib/python3.13/site-packages/aiosignal-1.4.0.dist-info/top_level.txt",
+ "sourceInfo": "acquired package info from installed python package manifest file: /.venv/lib/python3.11/site-packages/aiosignal-1.3.1.dist-info/METADATA, /.venv/lib/python3.11/site-packages/aiosignal-1.3.1.dist-info/RECORD, /.venv/lib/python3.11/site-packages/aiosignal-1.3.1.dist-info/top_level.txt",Meanwhile I fail to install all dependencies when specifying python3.13
[…]
INFO: pip is looking at multiple versions of integreat-cms[dev-pinned,pinned] to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 1.3.4 Requires-Python >=3.7,<3.11; 1.3.5 Requires-Python >=3.7,<3.11; 1.3.5.dev4 Requires-Python >=3.7,<3.11; 1.3.6 Requires-Python >=3.7,<3.12; 1.3.6.dev1 Requires-Python >=3.7,<3.12; 1.3.7 Requires-Python >=3.7,<3.12; 1.4.0 Requires-Python >=3.7,<3.12; 1.4.0.dev0 Requires-Python >=3.7,<3.12; 1.4.0a0 Requires-Python >=3.7,<3.12; 1.4.0a1 Requires-Python >=3.7,<3.12; 1.4.0b0 Requires-Python >=3.7,<3.12; 1.4.0b1 Requires-Python >=3.7,<3.12; 1.4.1 Requires-Python >=3.7,<3.12; 1.4.2 Requires-Python >=3.7,<3.12; 1.4.3 Requires-Python >=3.7,<3.12; 1.4.3b0 Requires-Python >=3.7,<3.12; 1.4.3b1 Requires-Python >=3.7,<3.12; 1.4.4 Requires-Python >=3.7,<3.12; 1.4.5 Requires-Python >=3.7,<3.12; 2.0.0a0 Requires-Python >=3.7,<3.12; 2.0.0a1 Requires-Python >=3.7,<3.12; 2.0.0a3 Requires-Python >=3.7,<3.12; 2.0.0b0 Requires-Python >=3.7,<3.12
ERROR: Could not find a version that satisfies the requirement pytest-testmon==1.4.5; extra == "dev-pinned" (from integreat-cms[dev-pinned,pinned]) (from versions: 0.4.9, 0.5, 0.6, 0.7, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.9.0, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.9, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 0.9.18, 0.9.19, 1.0.0a1, 1.0.0a2, 1.0.0a3, 1.0.0a4, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0rc0, 1.3.0rc2, 1.3.0rc3, 1.3.0, 1.3.1, 1.3.3, 2.0.0b1, 2.0.0b2, 2.0.0, 2.0.1, 2.0.2, 2.0.5, 2.0.6, 2.0.7b1, 2.0.7b3, 2.0.7, 2.0.8, 2.0.9, 2.0.10.dev0, 2.0.11, 2.0.12, 2.0.13, 2.0.14.dev0, 2.0.14, 2.0.15, 2.1.0.dev2, 2.1.0, 2.1.1.dev0, 2.1.1, 2.1.3, 2.1.4)
[notice] A new release of pip is available: 25.2 -> 25.3
[notice] To update, run: pip install --upgrade pip
ERROR: No matching distribution found for pytest-testmon==1.4.5; extra == "dev-pinned"
I'm attaching the full diff I get here: syft.patch
Interesting, I don't. Except for timestamps and metadata:
I've been developing on 3.13 since I opened #3837 in August.
In the end I suppose thats a question for #3837, right? ^^ |
Not really sure whats going on in your env. I see quite a lot of .exe files, which does not look that useful 👾
You can also take a look at the lunes-cms repo, where it is already deployed. The result is included in the latest release: https://pypi.org/project/lunes-cms/2025.11.0/#files |
ad114ef to
e325d18
Compare
|
Sorry, for the potentially naive question but I don't understand why you commit a SBOM that has been generated locally by you with python3.13, when the environment on CircleCI still uses python 3.11? The SBOM we include in the package is the one generated on CircleCI, correct? Do we need it committed in the repo at all? |
No, having the file in the repo is not strictly necessary. Its mostly a placeholder for development purposes, for example for the license view. Alternatively, it could be generated when executing the run.sh. I suggest to commit it and update it from time to time, for example when dependencies are bumped. |
|
One known side effect of this PR is going to be that the page of open source breaks ( |
|
@hannaseithe and I discussed yesterday that I remove the json file from this PR and we update it later from the latest test.pypi.org release. |
e325d18 to
ec47e4f
Compare
|
The PR is updated. |
Did you also mean to remove the sha256 or is keeping it intentional? |
Intentional, as it will no longer be generated with Syft. |
Which key is missing? |
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.
KeyError at /open-source-licenses/ 'externalRefs'
Details
packages = data["packages"]
for package in packages:
package["versionInfo"] = (
package["versionInfo"] if package["versionInfo"] else "N/A"
)
package["url"] = self.create_url_from_reference_locator(
package["externalRefs"][0]["referenceLocator"]
^^^^^^^^^^^^^^^^^^^^^^^
…
)
return {
"packages": packages,
}
|
Thanks, I was just looking 😂 at the same moment. Let me see how we can fix that. |
ec47e4f to
a4caa18
Compare
|
Still needs a translation, but the problem should be fixed. |
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.
Thank you very much! This seems to fix the issue for me! 🚀
I think it could be helpful to the second reviewer if we could rebase this branch again, so everything is update :)
a4caa18 to
8eccbd3
Compare
8eccbd3 to
99d6e7a
Compare
But now the SBOM is still there. Only the hash file is gone. I am confused. EDIT: Or is it that you want to keep this as a standin for testing purposes, until we overwrite it with the SBOM from the released package? |
Yes, exactly this. Its already committed to the develop branch. I see no point in removing it temporarily as it breaks the dev setup for the license view. |
hannaseithe
left a comment
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 looks good to me now. Thank you :)
99d6e7a to
b54bd9d
Compare
Short description
Use Syft for generating SBOM. Syft can also fetch license information for used Python packages.
Proposed changes
Side effects
Faithfulness to issue description and design
🚀
How to test
Run the pipeline ... or commands in your shell.
Pull Request Review Guidelines