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

Add new add-on pipeline to "enrich" packages with the PurlDB #1328

Open
pombredanne opened this issue Jul 17, 2024 · 4 comments
Open

Add new add-on pipeline to "enrich" packages with the PurlDB #1328

pombredanne opened this issue Jul 17, 2024 · 4 comments

Comments

@pombredanne
Copy link
Member

Given detected, uploaded, inspected or resolved packages, I would like to have a way to "enrich" the packages with the PurlDB data. This would imply:

  • getting enhanced package data from the PurlDB for the PURLs in my project
  • running on-demand data collection for the PURLs that do not exist yet in the PurlDB
@pombredanne pombredanne changed the title Add new add-on pipeline to "enrich" the package with the PurlDB Add new add-on pipeline to "enrich" packages with the PurlDB Jul 17, 2024
tdruez added a commit that referenced this issue Jul 19, 2024
tdruez added a commit that referenced this issue Jul 19, 2024
tdruez added a commit that referenced this issue Jul 19, 2024
* Add a new enrich_with_purldb Pipeline #1328

Signed-off-by: tdruez <[email protected]>

* Add ability to filter by extra_data on list views #1328

Signed-off-by: tdruez <[email protected]>

---------

Signed-off-by: tdruez <[email protected]>
tdruez added a commit that referenced this issue Jul 19, 2024
Signed-off-by: tdruez <[email protected]>
@tdruez
Copy link
Contributor

tdruez commented Jul 22, 2024

Open for discussion:

  • I have a pkg:pypi/pytest discovered package (no version), the collect endpoint returns /api/collect/?purl=pkg:pypi/pytest return 123 entries. None is the empty version entry.

tdruez added a commit that referenced this issue Jul 23, 2024
When multiple entries are returned from the PurlDB

Signed-off-by: tdruez <[email protected]>
@tdruez
Copy link
Contributor

tdruez commented Jul 23, 2024

Following a discussion with @pombredanne, when calling the /api/collect/ from the enrich pipeline:

  • If an error (500, timeout) is raised: Log this as a project error.
  • If a single package entry is returned, set all the values on the discovered package instance.
  • If multple package entries are returned, set only a subset of non-version specific fields (exclude download URL for example) and log a warning message on the project.

tdruez added a commit that referenced this issue Jul 23, 2024
tdruez added a commit that referenced this issue Jul 23, 2024
tdruez added a commit that referenced this issue Jul 23, 2024
tdruez added a commit that referenced this issue Jul 23, 2024
@tdruez
Copy link
Contributor

tdruez commented Jul 24, 2024

The new enrich_with_purldb was merged and is now available. It leverages the PurlDB collect endpoint.
One improvement for this pipeline would be to add multiprocessing for the PurlDB requests, but before adding this layer of complexity, let's get some mileage of the current implementation.

@tdruez
Copy link
Contributor

tdruez commented Aug 7, 2024

See also aboutcode-org/purldb#513

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