job api: keep order of jobs in stage dropdown
While using the new api in !21971 (merged) I noticed that the order of the jobs is not the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/projects/jobs/_sidebar.html.haml#L24
Although the retried jobs are sent in the API in a separate array, in order to keep the same order we'd have to map things in the frontend to:
- first order by statuses
failed pending running manual canceled success skipped created
- then concat
retried
withlatest_statuses
ordered by ID
In order to prevent this logic being handled on the FE in this specific place, we should move it to the BE
The following discussion from should be addressed:
-
@filipa started a discussion: @SteveAzz would it be possible if BE would send the retried jobs and the
latest_statuses
in the same array?Because we won't be able to keep rendering them in the same order we are now, the retried ones will only be at the end.