Pipeline duration does not include bridge jobs

Problem

Users want to see the correct duration metrics for child pipelines as described in: gitlab-org/quality/engineering-productivity/team#4 (closed). This should include time the child pipeline was running but not the time the pipeline was waiting to run.

Solution

When we calculate the pipeline duration we only consider builds. This code predates the introduction of bridge jobs with strategy:depend which can extend the pipeline duration.

Implementation

Change this line to:

builds = pipeline.processables.latest

With processables we are including both Ci::Build and Ci::Bridge. With this change a bridge that takes longer because the downstream pipeline runs using strategy:depend will have the duration reflected in its upstream pipeline.

Edited by Allison Browne (PTO 12/19-1/2)