Fix namespace detection from distro IDs#3770
Open
AyanSinhaMahapatra wants to merge 4 commits intodevelopfrom
Open
Fix namespace detection from distro IDs#3770AyanSinhaMahapatra wants to merge 4 commits intodevelopfrom
AyanSinhaMahapatra wants to merge 4 commits intodevelopfrom
Conversation
In docker image/other rootfs scans with SCIO we are always scanning for system packages before we scan for application packages, and we were not being able to use the distro information as this was being detected in application package scans happening later. So in this commit we are also adding os-release file parser to system package handler. Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Update debian, rpm and alpine package assembly to get distro identifier and then set this properly to created package, dependency and package_uid instances. Reference: #3443 Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Reference: #3726 Reference: package-url/purl-spec#171 Reference: package-url/purl-spec#159 Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
5e60b05 to
4c9e044
Compare
pombredanne
requested changes
May 8, 2024
Member
pombredanne
left a comment
There was a problem hiding this comment.
Thanks!
But this still does not match the PURL spec at https://github.com/package-url/purl-spec/blob/master/PURL-TYPES.rst#apk
pombredanne
requested changes
May 9, 2024
| pretty_name = distro.pretty_name and distro.pretty_name.lower() or '' | ||
|
|
||
| # TODO: It is misleading to use package data fields | ||
| # name and namespace to store distro/os infomration, |
| # we should consider using extra_data fields instead. | ||
|
|
||
| if distro_identifier == 'debian': | ||
| namespace = 'debian' |
Member
There was a problem hiding this comment.
Are you sure there is no namespace?
pombredanne
requested changes
May 28, 2024
Member
pombredanne
left a comment
There was a problem hiding this comment.
I think we always need a default repo... here alpine for apk
For RPMs, we have and should be able to derive the distro from the vendor or distribution RPM metadata and map that to a proper namespace
| "api_data_url": null, | ||
| "datasource_id": "alpine_apkbuild", | ||
| "purl": "pkg:alpine/[email protected]" | ||
| "purl": "pkg:apk/[email protected]" |
Member
There was a problem hiding this comment.
Suggested change
| "purl": "pkg:apk/[email protected]" | |
| "purl": "pkg:apk/alpine/[email protected]" |
Member
|
@AyanSinhaMahapatra gentle ping... I would like to merge this soon enough |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update debian, rpm and alpine package assembly to get
distro identifier and then set this properly to
created package, dependency and package_uid instances.
Fixes #3443
Tasks
Run tests locally to check for errors.