Auto-retry job when failed with a known infrastructure error

Extract the logic we have in triage-ops for labeling master-broken infrastructure incidents to gitlab_quality-test_tooling

Use this logic in CI/CD pipelines (similar to what we have worked on in !168921 (merged) or !168541 (merged))