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

for_packages field not populated for Package Resources #2929

Open
JonoYang opened this issue Apr 28, 2022 · 2 comments
Open

for_packages field not populated for Package Resources #2929

JonoYang opened this issue Apr 28, 2022 · 2 comments

Comments

@JonoYang
Copy link
Member

I am scanning electron v 3.1.11 from npm (https://www.npmjs.com/package/electron) and I do not see any values in the for_packages field for the scanned Resources, other than the package.json Resource. I expect that all of the files neighboring package.json would also have their for_packages field set.

@JonoYang
Copy link
Member Author

It doesn't appear that assign_package_to_resources isn't being entered in https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/npm.py#L85 . I've put a print statement in that method and no messages show up when I run a scan.

JonoYang added a commit that referenced this issue Apr 29, 2022
Signed-off-by: Jono Yang <jyang@nexb.com>
@JonoYang
Copy link
Member Author

@pombredanne

I've noticed that in packagedcode.npm.BaseNpmHandler.assemble that it made no calls to assign_package_to_resources, so I've made that change in my branch (https://github.com/nexB/scancode-toolkit/blob/37db949e9918932b7cc6454936f829dfb22bd213/src/packagedcode/npm.py#L56), however, it doesn't seem like we are entering the assign_package_to_resources method on packagedcode.npm.BaseNpmHandler.

@JonoYang JonoYang self-assigned this May 2, 2022
JonoYang added a commit that referenced this issue May 2, 2022
    * Properly assign Package resources to correct package
    * Update test results

Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue May 2, 2022
Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue May 3, 2022
Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue May 3, 2022
Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue May 3, 2022
    * Yield dependencies properly

Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang added a commit that referenced this issue May 3, 2022
    * Set the for_packages field for the package manifest resource whenever we are in the situation where we scan a single file that is a package manifest

Signed-off-by: Jono Yang <jyang@nexb.com>
pombredanne added a commit that referenced this issue May 4, 2022
JonoYang added a commit that referenced this issue May 4, 2022
    * Update test expectations

Signed-off-by: Jono Yang <jyang@nexb.com>
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

1 participant