Fix triggered jobs duration
Created by: tommyknows
Description
This commit fixes a bug where a glab ci status
would panic if there is
a job within that CI pipeline that is not triggered yet. In such a case,
the StartedAt field is not populated, which triggered a panic.
To fix this, we use time.Now()
if StartedAt
is nil, which means that
the job will be displayed with a duration of 0.
Related Issue
Resolves #727 (closed)
How Has This Been Tested?
Locally to a private gitlab instance which has triggered jobs.
Screenshots (if appropriate):
(failed) • 03m 47s test test
(success) • 01m 00s test my
(success) • 09m 37s test super
(success) • 00m 23s test jobs
(manual) • not started test triggered
https://privateinstance.com/myproject/-/pipelines/1
SHA: ...
Pipeline State: failed
? Choose an action: [Use arrows to move, type to filter]
View Logs
Retry
> Exit
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms)