Propagate failure_reason to job webhook.
Problem to solve
The job webhook doesn't include enough information about failed builds. I can send an API request to get the build trace but it doesn't include things like "ERROR: Job failed (system failure): Cannot connect to the Docker daemon at tcp://10.142.2.213:2376. Is the docker daemon running?" and I don't know where to get such information.
Further details
My end goal is to reduce the number of spurious CI failures by automatically analyzing the failure reason and build trace and retrying builds that are detected as spurious. Cf. https://github.com/coq/bot/issues/3
Proposal
I see that gitlab-runner!675 (merged) introduced the sending of failure_reason
to the GitLab API endpoint, whatever this is. I'd like this information to be propagated to the job webhook as well.
What does success look like, and how can we measure that?
Any solution allowing me to solve my end goal of automatically analyzing CI failures and restarting spurious ones (including "runner system failed" ones) would satisfy me. Alternatively, I would also be satisfied if GitLab was automatically retrying this kind of failed jobs.