Skip to content

Expose finished_at in job details JSON

What does this MR do and why?

This MR fixes a bug where the time a job has been running (including when it is complete), the running time, is always labelled Elapsed time in the job sidebar. This, however, is not intended following the change of !75811 (merged), and the running time should be labelled Elapsed time only when the job is running and default to the Duration text.

The bug is fixed by adding finished_at to the BuildDetailsEntity because it was missing there.

This should also bring back—or perhaps, show for the first time—the Finished field in the job page sidebar, which was added over a year ago (didn't find the exact MR easily). It denotes the relative date when the job finished.

I added a changelog entry because this fixes two problems and isn't technically a regression of !75811 (merged); that MR was not correctly tested on my part, I think.

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Go to a project (with CI)
  2. Trigger a pipeline
  3. Go to a running job
  4. See that the job running time is labelled as Elapsed time
  5. Wait for the job to finish
  6. See that the running time is now labelled as Duration, as intended per !75811 (merged)

Note: if you want to test both before and after in one instance, you should run gdk restart rails after switching because the JSON response is cached.

MR acceptance checklist

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

Related to #348264 (closed)

Edited by Kev

Merge request reports

Loading