Skip to content

packagist: Improve extract package metadata information algorithm

The current lister implementation lists very few metadata with the hard-coded /p/ base url (404 on mostly all packages). The packagist api implementation must have evolved since the initial implementation of the lister (and the first deployment on staging).

Following the upstream documentation [1], it's sensible to first use the /p2/ as it's performant from the packagist api side. It's then fallbacking to use /p2/+~dev url scheme, then the /p/ scheme and finally the /packages/ base url if previous result are either not found or empty (different than no modification since the last visit).

It keeps the initial implementation behavior of stopping immediately if a 304 NotModifiedSince is returned by the server.

[1] https://repo.packagist.org/apidoc

Refs. swh/meta#5001 (closed)

Edited by Antoine R. Dumont

Merge request reports