Skip to content

fix(purl): preserve Packagist repository URLs - #5815

Merged
michaelkedar merged 1 commit into
google:masterfrom
kappa9999:agent/5683-packagist-repository-purl
Aug 10, 2026
Merged

fix(purl): preserve Packagist repository URLs#5815
michaelkedar merged 1 commit into
google:masterfrom
kappa9999:agent/5683-packagist-repository-purl

Conversation

@kappa9999

@kappa9999 kappa9999 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Overview

Preserve non-default Packagist repositories when converting between OSV ecosystems and Package URLs.

Fixes #5683

Details

The active Go PURL registry treated Packagist as a generic slash-separated ecosystem. That preserved the Composer namespace and package name, but discarded the repository suffix from ecosystems such as Packagist:https://packages.drupal.org/8. The reverse parser likewise ignored the repository_url qualifier.

This change:

  • registers a dedicated Packagist generator/parser;
  • writes the ecosystem suffix as the standard repository_url qualifier;
  • restores that qualifier to the OSV ecosystem during PURL parsing;
  • keeps unqualified Packagist behavior unchanged; and
  • relies on packageurl-go for canonical qualifier escaping.

The production worker enrichment path has a focused Drupal regression case, and the PURL package has a generation/parse round-trip test.

Testing

$ cd go
$ go test ./purl ./internal/worker/pipeline/purl
ok  github.com/google/osv.dev/go/purl
ok  github.com/google/osv.dev/go/internal/worker/pipeline/purl

gofmt -d reports no differences for the changed Go files.

AI-assisted contribution: Codex was used for code and test drafting, repository inspection, diff review, and local validation.

@google-cla

This comment was marked as resolved.

@kappa9999
kappa9999 marked this pull request as ready for review August 7, 2026 16:04
@michaelkedar

Copy link
Copy Markdown
Member

/gcbrun

@michaelkedar michaelkedar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks

@michaelkedar
michaelkedar merged commit 9ff08a6 into google:master Aug 10, 2026
27 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.

DRUPAL generated PURLs incorrect

2 participants