Add "Most Relevant" sort to container repository tags
Proposal
In #336497 (closed), we added sorting by tag name to the container repository tag GraphQL endpoint.
Here we propose to add a sort by "Most Relevant". This would place latest
first, followed by semver
tags in descending order, and then everything else. This sort would not likely have a reverse sort.
Here is an example of a sorted result:
latest
v3.16.0-gitlab
...
v3.2.0-gitlab-ubi8
...
v2.10.0-gitlab-ubi8
...
013b6fbf81afd804f44bba874a79f681eee8d7eb
...
03aedc984d276672be5baf017b373731670edcc1-ubi8
...
1069-modify-containers-according-to-openshift-best-practices-fo
...
12-7-202001090505-e5c967cc40e-9bb76895a87
...
workhorse-use-gitlab-logger
Implementation guide
-
Add a new
sort
argumentmost_relevant
to theContainerRepositoryTagsSortEnum
-
Update the ContainerRepositoryTagsResolver with a custom sorting algorithm to sort as described in the description. We can make use of the
Gem
module to help with the semver sorting:tags.sort_by { |tag| Gem::Version.new(tag.name) }
-
Update the frontend to have the new sort option, possibly making it the new default.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.