In case of end users have the ability to run / stop builds a problem can occur.
Some configuration must have steps to restore / cleanup the machine before ending. That kind of steps shall be executed each time, whatever happen during the build.
That kind of steps are generally set as "Always execute".
The problem occur when an end user want to cancel a build. As the build have always executing steps, the stop can last a long time. Seeing that, the end user click on the stop button again and again, cancelling all cleaning steps.
Of course we still need to be able to forcibly stop a build to prevent locks.
Please introduce a new feature that will divide the build cancellation, and the stops.
A specified permission must be introduced to grant the cancel / force stop permission.
Here is a short description of the intended comportment:
* Can be clicked only once (or clicking again do nothing special)
* Steps set as "Always execute" cannot be canceled, if the cancel occurs during that step, the step will continue normally
* if the build is cancelling, remaining steps set as "Always execute" must be executed
Stop (force stop):
* All steps are stopped immediately (even the always execute steps)
* If the build is stopping, remaining steps set as "Always execute" should not be executed