Sometimes we have a lot of pending deployments that require manual intervention (A). Meanwhile other deployments (B) are being executed. Developers tend to forget that they should approve or cancel (A) deployments.
Does (A) affect the (B) deployments? For example, does octopus deploy check (A) deployments before running (B) deployments? If so, when en how regularly?
If so, we’ll have to come up with a solution, eg cancel (A) deployments after X hours.
Is there a possibility to do this automatically?
Octopus deployments are processed using a task system. Each deployment is associated with a server-task, and each server-task has a ‘ConcurrencyTag’ which is made from a combination of TenantId/ProjectId/EnvironmentId. Each server-task also has a status property indicating whether it is queued, executing, cancelling or has failed, succeeded etc.
The concurrency logic is based around ‘active’ concurrency tags, so Octopus will only process tasks that are currently executing or in the process of cancelling. In the case of manual intervention steps, as soon as the deployment process encounters a manual intervention, the server-task for the deployment is put into a ‘Queued’ status. Therefore, other deployments can continue to be executed while Octopus waits for the manual intervention to be actioned.
So in your example, manual intervention A will not affect (or block) deployment B.
If you find yourself in a situation where you need deployments cancelled automatically (because developers are constantly forgetting to do it), Octopus is ‘API first’, so anything you can do via the UI, you can script directly against the API. There is some documentation and samples here that can help get you started.
For example, you could definitely create a script that runs after hours and cancels any queued deployment tasks that are waiting for manual intervention, where the ‘QueueTime’ is older than X days. To get an idea of how the API is being used, we find it useful to fire up Fiddler or checkout the network tab in Chrome while browsing the Octopus UI and approving/cancelling deployments. You will be able to see how we are using the API in these scenarios. You could then create your own custom script using the Octopus Client Library to access the API via PowerShell script.