aboutcode-org / aboutcode-org/scancode.io

Improve pipeline creator UX to navigate CodebaseResource

Aberta
#369 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
215
Forks
203
Merge médio
4d 8h
PRs com merge (30d)
6

Descrição

In https://github.com/nexB/scancode.io/tree/app-package-files I am working toward adding details of installed files for a given package type. This is designed to run either as a secondary pipeline after another scan, or to later integrate as a step.

I found it difficult to navigate CodebaseResource for doing these operations:

- given a resource navigate up to its parent
- given a pathlib.Path get the corresponding resource
- OR given an absolute path string get the corresponding resource
- walk the filesystem project/codebase directory and be able to easily get to a corresponding CodebaseResource

Some ugly thing I did include this https://github.com/nexB/scancode.io/blob/app-package-files/scanpipe/pipelines/add_files_to_packages.py#L58

Basically the operations I am doing for PyPI packages consist in:
- iterate all DiscoveredPackage of type "pypi"
- given a METADATA file present in the codebase for an installed "pypi" package
- go to the parent dir (typically a .dist-info) and create a native distribution object that can parse all installed wheel metafiles
- for each installed file of this distribution, find its CodebaseResource. a distribution file will be a pathlib.Path
- Add the package to the CodebaseResource discovered_packages

We have a decent way for rootfs resources which are rooted by construction. But for other resources this is more involved.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.