Failed jobs do not sort to the top of lists in pipeline view

Summary

Failed jobs no longer sort to the top of lists in the Pipeline Jobs view.

Steps to reproduce

  1. Run a pipeline that has a failed RSpec test in the gitlab-org/gitlab project.

Example Project

https://gitlab.com/gitlab-org/gitlab/-/pipelines/252174334

What is the current bug behavior?

The failed job appears near the bottom of the list of other passing jobs, requiring me to scroll to find it.

What is the expected correct behavior?

The failed jobs should be at the top of the list, so they appear immediately when I open the group list.

Relevant logs and/or screenshots

In action, from the linked example pipeline:

unsorted_jobs

I see the jobs being fetched via GraphQL, but the status doesn't look like it comes back on those records so I'm not sure if we can add a sort there:

image

On the merge request view, failed jobs are sorted to the top when fetched via /pipeline/:id/stage.json?stage=test:

image

Possible fixes

  • Use the same endpoint to fetch jobs in both views
  • Consolidate result sorting logic across job endpoints in the backend
  • Explicitly sort returned job lists in the frontend
Edited by 🤖 GitLab Bot 🤖