Backend: Retry subsequent jobs if upstream job is retried
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=16873)
</details>
<!--IssueSummary end-->
### Problem
In a pipeline, a job retries in isolation, however, there are cases when a job is dependent on a result of previous jobs so retying a job in isolation will not achieve the desired goal
### Description
Currently, if someone retries a job, it is retried in isolation. If subsequent jobs depend on the results of that retried job, say via an artifact or image in the container registry, we should automatically retry all dependent jobs. Comments elsewhere have suggested that we want an option to specify which jobs should be retried or not, but I posit that we already have this declaration via artifacts. Unfortunately, artifacts don't encompass image dependencies yet. Perhaps we could augment dependencies to understand images and tags.
Also, by clever use of manual actions and `when: always`, perhaps triggering manual actions could automatically cause reruns of subsequent (already run) jobs to pick up new changes generated by the manual action, such as a new Docker image.
### Proposal
### Links / references
* Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/26360
* Mentioned in https://gitlab.com/gitlab-org/gitlab-ce/issues/20342#note_15889159 and https://gitlab.com/gitlab-org/gitlab-ce/issues/20342#note_20221907
/cc @grzesiek
issue