fix job viewing with detached pipelines
Created by: tommyknows
Description
For ci trace
and ci status
, the GetPipelines
function has been
used. However, GetPipelines
does not with detached pipelines.
To fix this, we're now using a new function GetLastPipeline
, which
first tries to get the last pipeline through the GetCommit
API and if
that should not return any results, it falls back to the old
GetPipelines
function.
Some parts of the codes have been refactored to use this new function instead of listing all pipelines and then grabbing the first elementt of that list.
GetPipelines
is now only used within the api
package itself, but I
kept it public for compatibility reasons.
Related Issue
Resolves #721 (closed)
How Has This Been Tested?
Locally to a private instance that has a detached pipeline on a Merge Request.
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)