Skip to content

Populate funding links and maintainers in direct-registry lookups - #84

Merged
andrew merged 1 commit into
git-pkgs:mainfrom
abhinavgautam01:feat/registries-funding-links
Oct 20, 2026
Merged

andrew merged 1 commit into
git-pkgs:mainfrom
abhinavgautam01:feat/registries-funding-links

Conversation

@abhinavgautam01

Copy link
Copy Markdown
Contributor

Closes #83

Problem

PackageInfo.FundingLinks and PackageInfo.Maintainers were only filled in by the ecosyste.ms backend. With NewRegistriesClient(), or for packages the hybrid client sends to a direct registry, both fields came back empty. Consumers building funding reports had to parse registry-specific metadata themselves or stick to one backend.

git-pkgs/registries#110 (closing git-pkgs/registries#34) added normalized FundingLinks and Maintainers fields to registries.Package, so the data is now available to copy across.

Change

  • RegistriesClient.BulkLookup copies pkg.FundingLinks into PackageInfo.FundingLinks.
  • RegistriesClient.BulkLookup maps pkg.Maintainers into PackageInfo.Maintainers using a new maintainersFromRegistry helper. Login, Name, Email, URL and Role are copied, and registries' internal UUID is dropped. Empty input returns nil, matching how the ecosyste.ms backend's convertMaintainers behaves.
  • The hybrid client passes each PackageInfo through whole, so packages it routes to a registry get both fields without further changes.
  • Updated the PackageInfo field comment, which said these fields were ecosyste.ms only.

What each registry provides, per git-pkgs/registries#110:

Registry FundingLinks Maintainers
npm funding field packument maintainers
hex Sponsor, Funding and similar links package owners
rubygems funding_uri not in package response
pypi Funding, Sponsor and similar project_urls not exposed

Other registries leave both fields nil, as before.

Dependency note

github.com/git-pkgs/registries is bumped from v0.9.3 to the #110 merge commit (v0.10.1-0.20261019065955-4d31fcfe8bf0), because no tagged release includes it yet (the latest tag is v0.10.0). Once registries cuts the next release, this can be switched to the tag, here or in a follow-up dependabot bump. github.com/git-pkgs/pom moves from v0.1.7 to v0.1.8 as an indirect dependency, because the newer registries requires it.

Tests

  • TestRegistriesClientBulkLookupCopiesFundingAndMaintainers runs one BulkLookup against a mock registry server with:
    • an npm package with mixed array funding (a URL string and an object with a url) plus a maintainer;
    • an npm package with no funding links and no maintainers, where both fields stay nil;
    • a RubyGems package with funding_uri.
  • TestMaintainersFromRegistry covers nil and empty input plus the full field mapping.
  • Locally, go build ./..., go vet ./..., go test -race ./... and golangci-lint run ./... pass, and go mod tidy leaves no diff.

@andrew
andrew merged commit 571774b into git-pkgs:main Oct 20, 2026
2 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.

Populate funding links in direct-registry lookups

2 participants