"List pipeline jobs" GitLab API does not return an information about retired jobs anymore
"List pipeline jobs" GitLab API call does not return an information about retired jobs anymore. GitLab versions prior to 13.5 include all jobs into a response, starting from GitLab 13.5 retired jobs are omitted from a response.
This causes some problems, for instance:
- No way to determine (using API) whether a given task was retried or not, and how many times if it was.
- As retried tasks are not reachable they can not be cleaned up using API, a script which is responsible for removing retired artifacts can not do its work anymore.
- Dashboards which calculate fail rates do not show correct numbers anymore.
Steps to reproduce
- Retry any job in any pipeline.
- Get pipeline jobs via API: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-jobs
- The original job (which was retired) will be missing in a response.
There is a vey simple project which can be used for demonstrating this problem: https://gitlab.com/kutelev/retry-job
Pipeline which has a retired job. In a Web interface 2 jobs are shown: https://gitlab.com/kutelev/retry-job/-/pipelines/207336828/builds
API responds with just one: https://gitlab.com/api/v4/projects/22007522/pipelines/207336828/jobs
Job with ID 810672584 is omitted from a response.
What is the current bug behavior?
"List pipeline jobs" API call does not return an information about jobs which were retried.
What is the expected correct behavior?
An information about all pipeline jobs should be returned.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Results of GitLab application Check