Skip to content

Use git-pkgs/enrichment for the enrichment API - #588

Merged
andrew merged 3 commits into
git-pkgs:mainfrom
simonchrz:refactor/shared-enrichment
Oct 25, 2026
Merged

andrew merged 3 commits into
git-pkgs:mainfrom
simonchrz:refactor/shared-enrichment

Conversation

@simonchrz

Copy link
Copy Markdown
Contributor

Closes #562.

internal/enrichment is now a thin adapter over github.com/git-pkgs/enrichment. It builds PURLs from the proxy's ecosystem names, normalizes licenses for display and reports retracted versions as yanked. The API response shapes are unchanged.

Before Now
EnrichPackage, GetLatestVersion via registries RegistriesClient.GetPackage (git-pkgs/enrichment#86)
EnrichVersion RegistriesClient.GetVersion
BulkEnrichPackages RegistriesClient.BulkLookup
CheckVulnerabilities via OSV VulnerabilityClient.Check
Service.IsOutdated, Service.CategorizeLicense enrichment.IsOutdated, enrichment.CategorizeLicense

Changes in behaviour:

  • License categories in the API and the web UI normalize the license first, so mit, Apache 2.0 and GPLv3 are categorized instead of falling through to unknown.
  • Vulnerability fixed versions come from the affected range of the queried package.
  • A package the registry doesn't have still answers 404 (registries.ErrNotFound maps to nil).

go.mod points at a pseudo-version of enrichment main until #86 is in a release. I'll switch it to the tag then.

simonchrz and others added 3 commits October 24, 2026 15:55
internal/enrichment now adapts the shared module instead of calling
registries and OSV itself. License categories in the API and the web UI
come from enrichment.CategorizeLicense, which normalizes the license
first. Vulnerability fixed versions come from the affected range of the
queried package.
@andrew
andrew merged commit c6ccbcb into git-pkgs:main Oct 25, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

Use git-pkgs/enrichment instead of internal/enrichment

2 participants