Skip to content

Add "Most Relevant" sort to container repository tags

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

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

  1. Add a new sort argument most_relevant to the ContainerRepositoryTagsSortEnum

  2. 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) }
  3. 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.

Edited by 🤖 GitLab Bot 🤖