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.
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.