-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: add workspaceRelationship
#7889
base: main
Are you sure you want to change the base?
feat: add workspaceRelationship
#7889
Conversation
@@ -26,7 +26,7 @@ | |||
"Name": "poco", | |||
"Identifier": { | |||
"PURL": "pkg:conan/[email protected]", | |||
"UID": "312753cebe80c0eb" | |||
"UID": "1c5e3b385e0d9c68" |
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.
Do you have any idea why UID is different now?
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 added workspaceRelationshi
p as 2:
trivy/pkg/fanal/types/package.go
Lines 17 to 21 in 542a380
RelationshipUnknown Relationship = iota | |
RelationshipRoot | |
RelationshipWorkspace // For maven `modules`. TODO use it for cargo and npm workspaces | |
RelationshipDirect | |
RelationshipIndirect |
to correct sorting:
trivy/pkg/fanal/types/package.go
Lines 233 to 240 in 927c6e0
switch { | |
case pkgs[i].Relationship != pkgs[j].Relationship: | |
if pkgs[i].Relationship == RelationshipUnknown { | |
return false | |
} else if pkgs[j].Relationship == RelationshipUnknown { | |
return true | |
} | |
return pkgs[i].Relationship < pkgs[j].Relationship |
So when we calc UID - we use 4
instead of 3
for IndirectRelationship (as example)
Description
Add
workspaceRelationship
.workspaceRelationship
will be used forcargo
,npm
,maven
, etc. packages.See #7802 for more details.
This PR also adds
workspaceRelationship
for maven modules.Related issues
pom.xml
files with modules when using SBOM formats #7802Checklist