Proposal: Allow listing tags in reverse lexical order
skycaptain opened this issue · 1 comments
Currently, the end-8*
endpoints mandate that "the tags MUST be in lexical order." With version schemes like semver or calver, this means the most recent tags always end up on the last pages.
We use Renovate to update our container references. Renovate fetches all tags using the end-8b
endpoint of a registry and matches them against a defined version pattern. If we had the ability to request tags in reverse lexical order, tools like Renovate could start with the most recent tags and work backward. This would significantly reduce the number of API requests and, consequently, the load on the registry server.
The problem becomes even more complex with registry mirrors, such as Jfrog Artifactory, which limit the number of pagination iterations on API requests forwarded to the remote registry by themselves to manage server load. Consequently, only the most outdated tags are returned, depriving us of the most recent and relevant ones.
Allowing requests for tags in reverse lexical order would greatly enhance efficiency, lowering API request volumes and easing server loads. Systems that rely heavily on automated updates would greatly benefit from this change.
There was a discussion on this a few weeks ago and the consensus there was not to do this since it would result in a lot of potential breaking changes (e.g. pagination in the tag listing would need a rewrite to allow something other than a last=
field which would not be supported on preexisting registries). There's also a general concern that this wouldn't solve the underlying issue since the lexical order of tags is not a complete match for the date a tag is modified. The most recently pushed tag could be followed by an even longer list of old or unrelated tags.
In the long run, I think a redesign of the tag listing interface to include more details, like the full descriptor, possibly a tag history, and fields like the time the tag was last pushed, would be more useful for tools like Renovate. For now I'm going to close this, but we will be considering the use case in a future tag listing API.