aboutcode-org / aboutcode-org/commoncode

Issue importing a scancode.io JSON results into VirtualCodebase

Offen
#46 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
4
Forks
23
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

We're encountering the issue where we cannot walk a VirtualCodebase created from a scancode.io scan (prior to v31.0.0). When the scan is loaded into VirtualCodebase, and we call `walk()`, only the virtual_root is returned. This is due to the scancode.io Resource names not containing the extensions. The full filename is required for a VirtualCodebase to work since we keep the filenames of the children of each Resource (https://github.com/nexB/commoncode/blob/main/src/commoncode/resource.py#L671). If the filename isn't the complete filename, then the Resource will never find the child Resource when walking.

For example, in the problematic scan, the two resources at the root have the paths `example.zip` and `example.zip-extract`, but their names are both `example`. When loaded into a VirtualCodebase, the virtual_root has two children, but their names are both `example`, when it should be `example.zip` and `example.zip-extract`. Since `virtual_root/example` does not exist in `resources_by_path` of the VirtualCodebase, then we cannot continue the walk.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.