Skip to content

proxy mirror stores gem/composer packages under rubygems/packagist, handlers use gem/composer #415

Open

Description

@andrew

Noticed by @pinguinfuss in #306.

internal/mirror/source.go:53 maps PURL types to ecosystems via purl.PURLTypeToEcosystem:

ecosystem := purl.PURLTypeToEcosystem(p.Type)

In github.com/git-pkgs/purl that function maps gem → rubygems and composer → packagist (the ecosyste.ms-style registry names). The protocol handlers store cached artifacts under gem and composer. So a package mirrored via proxy mirror and the same package cached via a client install land under different ecosystem keys in the DB and storage.

This affects anything that keys on packages.ecosystem: eviction/retention, analytics, the packages list filter, and dedup against already-cached artifacts.

Fix is probably to have mirror use the handler-side names directly rather than going through PURLTypeToEcosystem, or to add a proxy-local mapping. Existing mirrored rows under the old names would need handling (either a migration or dual-read).

Activity

  1. andrew commented on Oct 12, 2026

    @andrew
    ContributorAuthor

    Correction to the diagnosis above: on current main, mirroring pkg:gem/rake@13.2.1 and pkg:composer/psr/log@3.0.2 fails with unsupported ecosystem: rubygems and unsupported ecosystem: packagist. Neither artifact is downloaded, so this does not reproduce duplicate cache entries.

    Cache lookups use canonical package/version PURLs and filenames, then read the storage path recorded in the database. The different ecosystem spelling alone does not establish a cache miss. Analytics also already combines these aliases.

    Keeping this open for consistent ecosystem naming. Resolver alias support belongs in git-pkgs/registries, alongside the resolver work discussed in #414. The remaining package-filter mismatch needs verification before proposing data cleanup. There is no evidence yet that storage moves or a data migration are needed.

  2. added a commit that references this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions