PSGitLab icon indicating copy to clipboard operation
PSGitLab copied to clipboard

Pipelines and Jobs API

Open JVimes opened this issue 7 years ago • 2 comments

1. Implement GitLab's APIs for "Pipelines" and "Jobs"

2. Describe Your Environment

Operating System and PowerShell version:

Windows 10 PSVersion 5.1.15063.786

3. Expected Behavior

I'd like to call GitLab's Pipelines API and Jobs API.

4.Current Behavior

It doesn't seem that the GitLab Pipelines API or Jobs API have been implemented in PSGitLab.

5. Possible Solution

One idea is to add two new commands:

Get-GitLabPipelines - Implements GitLab's Pipeilnes API. Can pipe in the result of Get-GitLabProject, if that jives with how PSGitLab is designed, since the API requires project ID.

Get-GitLabJobs - Implements GitLab's Jobs API. Can pipe in the result of Get-GitLabProject, if that jives with how PSGitLab is designed, since the API requires project ID.

Another idea is to implement a generic command, where the user can call any GitLab API so long as they specify the correct URL snippet and parameters. PSGitLab could handle collecting the paginated output, unless the user requests individual pages. For new/unsupported GitLab APIs, this might tide users over until first-class PowerShell commands are written. I assume there's already some sort of call like this under the hood?

6. Context

I'm writing a script to find all projects that have pipelines/jobs, and generate a report on pass/fail of the CI builds.

JVimes avatar Jan 03 '18 00:01 JVimes

I'd love to query failed jobs from a pipeline and restart them with a cmdlet

felixfbecker avatar Feb 01 '20 20:02 felixfbecker

I implemented the Jobs API in this PR: https://github.com/ngetchell/PSGitLab/pull/228

rzikm avatar Sep 29 '20 21:09 rzikm