huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
44 stars 22 forks source link

Add option to Cancel Builds when awaited build failed #75

Closed atlesp closed 6 years ago

atlesp commented 6 years ago

Example:

Master build trigger child A and B.

Child A fails and the "Waiting for other builds to finish" breaks the master build and stops it. The Build B then just continue to run using a build agent.

I solve this now with the with having "Cancel external Builds if one task failed " both before and after the "Waiting for other builds to finish" task.
image

It would be cleaner with a setting on the wait for other builds to cancel the other builds if one fails.

huserben commented 6 years ago

Hi @atlesp

so you mean that we would have basically an option for the WaitTask that is "Cancel running task if one failed"?

atlesp commented 6 years ago

Hi @huserben Yes, just a shortcut for the cancel external builds that you just made. That one working very well 👍

huserben commented 6 years ago

Ok, yeah I see that that could be useful. I will add the functionality once I find the time, probably somewhen towards the end of the week.

Thanks for your input, i'll let you know once a new version would be available for verification.

huserben commented 6 years ago

Hi @atlesp

I'm currently implementing the option in the Trigger Build and Wait Tasks: grafik

Right now it is only available if you're failing the task (meaning the above checkbox has to be checked so that the option appears). Do you think that makes sense or should it be available all the time? My thinking was that if you want to cancel builds then something went wrong and you are in a "failed" state of your build(s). Making it available all the time would take a bit more time to add due to the current implementation.

This is how it will look like in the build itself: grafik

Let me know whether you would prefer the option to cancel the builds without failing the task itself or if its fine with the approach to only have the option if the user decides to fail the task.

huserben commented 6 years ago

HI @atlesp

I know updated the task to version 2.9.1 with the above mentioned option. Please let me know if this is ok for you or whether I should change.

atlesp commented 6 years ago

Thanks @huserben I have switched this on now on my build, and it seems to work fine.

Right now it is only available if you're failing the task (meaning the above checkbox has to be checked so that the option appears). Do you think that makes sense or should it be available all the time? This works for my use case at least :)

Is a canceled build handled as a failed one?

huserben commented 6 years ago

Hi, good to hear.

For your question:

Is a canceled build handled as a failed one?

So in VSTS/TFS there is a specific state for cancelled. In relation of the Build Tasks of mine, if you await a build and set the option to fail a task when it was not successful, it will fail the task if the state is cancelled (as I check if it was successful or not). Does this answer the question or did you mean something else?

atlesp commented 6 years ago

Perfect! Thanks for responding so fast to change requests.

huserben commented 6 years ago

No problem, please don't hesitate to create another issue if any question or problem arises or you have an idea for an extension.