Jenkins.NET icon indicating copy to clipboard operation
Jenkins.NET copied to clipboard

Add cancel commands

Open Goepfie opened this issue 4 years ago • 6 comments

I added the cancel and stop command for build jobs in queue and in progress respectively. Needed the functionality for a pet project and thought maybe somebody else might find it useful. Depending on server setup theuser might need special privileges to carry out the commands.

Disclaimer: StopBuild supresses an error that seems to be a false positive.

Thanks for your work! Library was helpful.

Goepfie avatar Feb 20 '21 03:02 Goepfie

Is there anything I can do to help get this merged? I have a situation where a Jenkins job can continue running (due to an underlying process), and the only way to stop and retry is to issue a cancel/stop/abort, whatever the terminology is, and then issue a retry.

I can checkout this merge request, and test it out in our environment to verify, if that's helpful.

jblackwood12 avatar Feb 07 '22 19:02 jblackwood12

The commit looks good, my main issue is that I don't use Jenkins anymore (for several years now) in favor of Kubernetes.

If I can find a containerized version of Jenkins that I can use for automated testing, I'd be happy to bring this project back to life.

null511 avatar Feb 07 '22 20:02 null511

I think there are some containerized Jenkins setups. Though I don't have much expertise in that area.

I have time tomorrow to do some manual testing on these changes. (assuming these changes allow for stopping a job that is running)

jblackwood12 avatar Feb 07 '22 21:02 jblackwood12

I was able to successfully Abort a job, using the StopAsync function that was added in this merge request.

aborted_job_confirmed

I did not attempt to test the cancelling of a queue item. However, the route looks correct, and the code looks good.

So I think this code can be merged.

jblackwood12 avatar Feb 08 '22 19:02 jblackwood12

Would it be helpful if I also manually tested the CancelItemAsync function?

jblackwood12 avatar Feb 11 '22 15:02 jblackwood12

Is it conceivable to merge in this commit without having to "bring this project back to life." ?

jblackwood12 avatar Feb 16 '22 18:02 jblackwood12