glab ci cancel
Problem to solve
When using the CLI to create and monitor jobs, sometimes we might also want to cancel them (such as if we see an issue while using glab ci trace
). Currently there is no way to do this from the CLI, and you have to open the job in a browser to cancel it. It would be useful instead if jobs could be cancelled from the CLI.
Proposal
Add a glab ci cancel
command. At a minimum it should accept a job id, though I can imagine it might be useful to accept a pipeline ID and cancel all jobs in the pipeline.
Further details
In my specific case, I have a script which triggers a pipeline, an then streams the job output. If I detect an issue, I want to be able to CTRL+C and have the script cancel the job.