Skip to content

Package Resources are not associated to packages in application Packages scan step update #476

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

Closed
JonoYang opened this issue Jul 27, 2022 · 1 comment

Comments

@JonoYang
Copy link
Member

In updating the application Packages scanning step in the scan_codebase pipeline for #447, I noticed that the CodebaseResources of a Package are not associated with the Packages that was scanned. Looking a little deeper, I see that the Package Resources in scancode.io cannot be properly associated to the Package they are from by using the .assemble() methods from packagedcode's Package handlers. This is because of how for_packages is implemented on the CodebaseResource model in scancode.io and the Resource model in commoncode. In scancode.io, for_packages on the CodebaseResource model is a property that collects the purls for Packages that have been related to that CodebaseResource. In scancode-toolkit/commoncode, for_packages on the Resource model is a list that contains package_uid strings for the Package the Resource is from.

When you run the .assemble() methods from packagedcode Package handlers on a CodebaseResource object, it attempts to append package_uid strings to the for_packages field. This does not properly work since CodebaseResource.for_packages is a property, not an attribute that can be used the same way.

@JonoYang
Copy link
Member Author

This issue has been fixed, following an update to scancode-toolkit where the code has been modified to be able to accept different functions that adds a package to a resource. aboutcode-org/scancode-toolkit#3035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant