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

load_inventory pipeline does not work with SCIO JSON output #609

Closed
JonoYang opened this issue Feb 15, 2023 · 3 comments
Closed

load_inventory pipeline does not work with SCIO JSON output #609

JonoYang opened this issue Feb 15, 2023 · 3 comments

Comments

@JonoYang
Copy link
Member

The load_inventory pipeline loads the JSON scan into a VirtualCodebase object, where the JSON scan data is mapped to a Codebase and Resource objects. VirtualCodebase requires that a root Resource be present in the scan in order for it to be created. When a Codebase is created from a scancode.io Project inputs, we strip the root from the paths of the Resources created, so the root Resource is not created. This is the main reason why the existing scan import code doesn't work.

A solution may be to have some functions that iterate through the JSON and create Packages and Resources as they appear in the scan and avoid using code that's specific to VirtualCodebase.

tdruez added a commit that referenced this issue Mar 3, 2023
@tdruez
Copy link
Contributor

tdruez commented Mar 3, 2023

A solution may be to have some functions that iterate through the JSON and create Packages and Resources as they appear in the scan and avoid using code that's specific to VirtualCodebase.

@JonoYang I've try an implementation based on your suggestion @ https://github.com/nexB/scancode.io/compare/609-load-inventory-scio
Can you give it a try? Feedback welcome ;)

@JonoYang
Copy link
Member Author

JonoYang commented Mar 3, 2023

@tdruez LGTM! I fetched your branch and I am able to load both scancode.io and scancode-toolkit scans using the load_inventory pipeline

tdruez added a commit that referenced this issue Mar 14, 2023
tdruez added a commit that referenced this issue Mar 14, 2023
Signed-off-by: Thomas Druez <[email protected]>
tdruez added a commit that referenced this issue Mar 15, 2023
tdruez added a commit that referenced this issue Mar 15, 2023
@tdruez
Copy link
Contributor

tdruez commented Mar 15, 2023

Added in #636

@tdruez tdruez closed this as completed Mar 15, 2023
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

2 participants