Skip to content

Fix duration for builds failed via Ci::Build#doom!

What does this MR do and why?

The duration of a build is finished_at - started_at. This method was marking a build as failed without setting finished_at, resulting in its duration appearing ever-growing.

In addition, track this failure reason in our metrics so have a better idea of how often it occurs over longer time frames.

Note that this bug should not have affected CI minute calculations, since

  1. the build becomes failed, which invalidates the token, which prevents a "zombie" runner from continuing to consume live minutes
  2. the state machine callbacks responsible for updating CI minutes on finish are not invoked for builds failed in this manner

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

The conditions under which Ci::Build#doom! are called are not easily reproducible.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hordur Freyr Yngvason

Merge request reports