Open tdruez opened 4 months ago
@tdruez I've set ordering of the package results from collect
to -version
. Just wondering: should the sort
parameter be a list of fields?
@JonoYang We want consistency across all endpoints. The sort
parameter on collect should work the same way it does on the packages endpoint.
https://github.com/nexB/purldb/blob/main/packagedb/api.py#L334
@tdruez I've merged #513 and I've deployed it to public instance of purldb. Let me know if there are more changes needed
In general, when multiple package entries are found in the PurlDB, we decided to use the most recent version for "package enriching" or data display in ScanCode.io and DejaCode.
When using the
packages
endpoint, one can use thesort=-version
filter for ordering, but this is not available on thecollect
endpoint.I think we should:
sort
parameter to thecollect
endpointorder_by
on thecollect
endpoint package QuerySet, to avoid returning a random order by the results. I would suggest always sorting by the most recent version, ie:-version
, to be coherent with the data we care to display first.