-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[New command] Command to cancel build pipeline #876
Comments
@atbagga - do we have an api for this? I think it is this - https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/delete?view=azure-devops-rest-5.1 |
@geverghe Hi am looking for Azure Dev Ops CLI command to cancel build pipeline. There's a delete CLI command but I think that's deleting the build. I haven't tried that command but I'll test and see. Thanks. |
So there are two elements - there is a build definition delete and there is a build delete. I think this build delete corresponds to canceling the build run. You can potentially give it a shot with az devops invoke to run this api till we build a command |
Looks like delete, as the verb indicates, deletes the run and therefore stops the run. However, I think your use case is just cancel. @atbagga is looking into the update API and will get back to you on the API that can be used via |
@jopham-sage The API for cancelling the build is documented here.
You can use the following command as a workaround for the time being until this issue is prioritised and we add a command in CLI for the same.
Content in patch.txt -
|
@atbagga I would like to take up this. I am planning to create a new |
@dhilmathy Sorry missed the update. If you are still up for it please share the detailed command signature and go ahead. |
Whats the status of this ? Is there any way to cancel or delete a run via cli ? |
@atbagga I am planning to introduce a new command called Command signature
Will submit a PR if above command seems fine for you. Thanks! |
@dhilmathy Sorry, I am not a maintainer in this repo anymore. |
@dhilmathy what's the status of this new command? I would use this to find a workaround for this outstanding feature request |
@dsfrederic, I'd created the command based on the proposal I'd made earlier. I am waiting for maintainers comment before raising PR. |
@atbagga @elbatk @mitsha-microsoft can any of you guys help us out? |
Thanks @dhilmathy for the PR. I see the project owners are added as PR reviewers. |
Had to fix the contents of the patch.txt file to make it valid json. the single quotes changed double quotes. After I did that, it worked:
Also had to add |
I just tried this command locally but it does not work as expected. The pipeline status is updated to "cancelling" but it does not cancel the jobs inside. The jobs are still running and taking up build agent machines. What's worse, after the pipeline status is updated to "cancelling", I cannot manually cancel them in the web UI. @dhilmathy @atbagga Can you confirm this behavior?
|
In my experience, that depends on your configuration fo the jobs, you have to make sure that the jobs contain the condition |
Is there a command line to cancel build pipeline? I know we can run the pipeline but I want to cancel it also. Thanks
The text was updated successfully, but these errors were encountered: