Parallel CI jobs sorted incorrectly in job detail list

Summary

CI jobs that are run in parallel (using parallel) automatically are numbered and sorted according to the number they have. In the pipeline overview the jobs are sorted as expected:

pipeline_overview

However in the job details, they are not sorted "naturally" but just by their textual representation:

job_details

This makes it quite cumbersome to navigate to the "next" shard/job for parallel jobs.

Steps to reproduce

Create a project with a .gitlab-ci.yml that has a job with parallel: 10 or higher.

Example Project

https://gitlab.com/ePirat/ParallelJobsSortIssueExample

A job showing the issue can be found here: https://gitlab.com/ePirat/ParallelJobsSortIssueExample/-/jobs/975737609

What is the current bug behavior?

Jobs are sorted "incorrectly":

  • build 1/20
  • build 10/10
  • build 11/20 …

What is the expected correct behavior?

Build should be sorted "naturally":

  • build 1/20
  • build 2/20
  • build 3/20 …

just like they are already in the pipeline overview.

Relevant logs and/or screenshots

See above.

Output of checks

This bug happens on GitLab.com

Possible fixes

Use the same method of sorting as on the pipeline overview page, where sorting works as expected.