aboutcode-org / scancode-workbench

:bar_chart: ScanCode Workbench is a desktop app to review and conclude license and origin from code scans generated by ScanCode Toolkit.
https://github.com/nexB/scancode-workbench/releases/latest
Apache License 2.0
154 stars 70 forks source link

Build filetree with missing directories to support --only-findings scans #624

Closed OmkarPh closed 9 months ago

OmkarPh commented 10 months ago

Fixes #404 #393

Reference scans - allsamples-onlyfindings.json.txt allsamples-onlyfindings-noresources.json.txt

OmkarPh commented 9 months ago
  1. In the only-findings scan, the file-tree is not behaving correctly for nested directories (as the corresponding parent directories are missing?) should we populate missing parent directories ourself while importing the scan? Example resource: "postgresml-2.8.1/pgml-cms/docs/resources/benchmarks/mindsdb-vs-postgresml.md" this is not present in the file tree on the left. And the expand directory icon also hangs for some reason?

Thank you for pointing this out, there was an issue with handling files in batches (for large scans) I've fixed it. Should work fine now, see image

OmkarPh commented 9 months ago
  1. In your allsamples-onlyfindings-noresources.json.txt example, when we import this, nothing happens are there are no resources. I would like to see something to indicate that there was no resources in the scan and so we can't show anything.

Sure, I'll add a warning/error snackbar with this message But, should we abort importing such scans or load all views with empty data?

AyanSinhaMahapatra commented 9 months ago

But, should we abort importing such scans or load all views with empty data?

If there's no data at all (here I mainly mean no file data, as other codebase level attributes are atleast option-dependent) there's no use showing empty views, so it's fine if we abort importing and show the message there.

OmkarPh commented 9 months ago

Thanks for the feedback @AyanSinhaMahapatra I've updated the PR