Skip to content
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

Find the DESCRIBES relationship by looking through attached packages #189

Merged
merged 4 commits into from
Jun 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ntia_conformance_checker/sbom_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ def check_dependency_relationships(self):
if rel.relationship_type == RelationshipType.DESCRIBES
]

#A set of all package spdx_ids for quick lookup
DanielOjalvo marked this conversation as resolved.
Show resolved Hide resolved
spdx_id_set = set([package.spdx_id for package in self.doc.packages])
jspeed-meyers marked this conversation as resolved.
Show resolved Hide resolved

# Check if any of the "DESCRIBES" relationships describe a Package
describes_package = any(
"Package" in rel.related_spdx_element_id for rel in describes_relationships
rel.related_spdx_element_id in spdx_id_set for rel in describes_relationships
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is certainly superior. Thank you!

)

return describes_package
Expand Down