Loading
feat(pipelines): add list pipelines of the current user
Adds PipelinesService.ListUserPipelines for GET /pipelines, which lists pipelines across all projects that were triggered by the authenticated user.
References
GitLab API docs: https://docs.gitlab.com/api/pipelines/#list-pipelines
Changes
ListUserPipelines(opt *ListUserPipelinesOptions, options ...RequestOptionFunc) ([]*UserPipeline, *Response, error)is added toPipelinesServiceInterfaceand implemented on the service.ListUserPipelinesOptionshasCreatedAfter,CreatedBefore,Cursor,OrderBy,Sort,SourceandPerPage. It does not embedListOptions, because the endpoint supports keyset pagination only. The next page URL is inResponse.NextLink.UserPipelinemodels the response, includingProject(BasicProject),StartedAt,FinishedAt,Duration,QueuedDuration,DetailedStatusandMergeRequest.UserPipelineMergeRequestmodels the slim merge request (iid,title,web_url). It is only returned for visible merge request pipelines.- A new route,
pipelines. testing/pipelines_mock.gois regenerated withmake generate.
Testing
TestListUserPipelines covers every query parameter, the decoded response, the next page link and a failing request option. TestListUserPipelines_Unauthorized covers a 401. make reviewable passes.
Closes #2322 (closed)