Skip to content

Add semantic version sorting to tags

What does this MR do and why?

Contributes to #17801 (closed)

Problem

Tags sort by name can lead to unexpected results, because it uses string compason for sort.

v1.1.0
v1.10.0
v1.2.0

Solution

Use the semantic version sort for list of tags page.

Screenshots or screen recordings

Name sort Version sort
Screenshot_2022-08-10_at_18.22.14 Screenshot_2022-08-10_at_18.22.42

Version 2.4.10.0 does not go after 2.4.9.0 with sort by Name. However Version search correctly puts it into the right place.

How to set up and validate locally

  1. Find project with tags (or create tags v1.1.0, 'v1.10.0', 'v1.2.0')
  2. Go to tags page
  3. You should see tags sorted in decremental versions order (v1.10.0, v1.2.0, v1.1.0)

Or in GDK:

  1. Visit http://127.0.0.1:3000/gitlab-org/gitlab-shell/-/tags

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vasilii Iakliushin

Merge request reports

Loading