ngetchell / PSGitLab

An interface for administering GitLab from the PowerShell command line.
MIT License
72 stars 42 forks source link

Pipelines and Jobs API #140

Open JVimes opened 6 years ago

JVimes commented 6 years ago

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.

felixfbecker commented 4 years ago

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

rzikm commented 4 years ago

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