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

Add new argument package_adder to DatafileHandler.assemble() #3034

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

Add new argument package_adder to DatafileHandler.assemble() #3034

JonoYang opened this issue Jul 29, 2022 · 1 comment

Comments

@JonoYang
Copy link
Contributor

We want to reuse the code from the assembly() method of the different PackageHandlers in scancode.io, and the current method of associating Packages to Resources (in the assembly() methods), where we append package_uid to resource.for_packages, does not work there. We need to be able to pass in a function that performs the Package - Resource association, so we can use the assembly() methods in different contexts.

The package_adder argument is a function that takes in a package_uid, resource, and codebase. It is used in places where we want to associate a Resource to a Package using the package_uid.

@JonoYang JonoYang self-assigned this Jul 29, 2022
JonoYang added a commit that referenced this issue Jul 30, 2022
    * Add test for add_to_package

Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue Aug 1, 2022
    * Update CHANGELOG.rst

Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue Aug 2, 2022
    * Add test for add_to_package

Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue Aug 2, 2022
    * Update CHANGELOG.rst

Signed-off-by: Jono Yang <jyang@nexb.com>
pombredanne added a commit that referenced this issue Aug 2, 2022
Add package_adder argument to assemble() #3034

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@AyanSinhaMahapatra
Copy link
Member

This was added with #3035, closing!
Thanks @JonoYang!

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

No branches or pull requests

2 participants