Steps (appear only!) randomly ignore run conditions - After upgrade to 2020.4.2

I have two steps that have a run condition that looks for the value of a variable set in a previous step.

This has worked with 2019.9.10 LTS but the first time the project ran after an upgrade to 2020.4.2 not all of the steps adhered to the run condition.

Step 2 called “Set Deployment Flags” sets a variable to “True”

Steps 4 and 5 will deploy based on this variable. Step 4 skipped based on that variable’s value but the second step ran ignoring the run condition (same run condition for both steps).

Can I get some help determining if it’s an issue with the new version or if it’s a bug in our logic?
done in powershell…
step 2.

$DeploymentType = “ProductionCgiBin”
Set-OctopusVariable -name “DeploymentType” -value $DeploymentType

step 4. - This worked…
run condition:
Variable: only run when the variable expression is true
Variable expression:
#{if Octopus.Action[Set Deployment Flags].Output.DeploymentType== “ProductionCgiBin”}true#{/if}

Step 5. This was ignored.
run condition:
Variable: only run when the variable expression is true
Variable expression:
#{if Octopus.Action[Set Deployment Flags].Output.DeploymentType== “ProductionCgiBin”}true#{/if}

The logs for step 4. say…
step runs on a variable run condition which was evaluated as false; skipping.

The logs for step 5 don’t mention the run condition and just does the actions.

Hi Thomas,

Thanks for getting in touch, and welcome! I’m sorry to hear you’re hitting this unexpected change of behavior since your upgrade. That’s certainly strange and you look to have it configured perfectly. I haven’t had any luck reproducing this behavior in my 2020.4.2 instance, however, and both steps with the same run condition apply that run condition.

Could you enable verbose logging by adding two variables in your project (OctopusPrintVariables and OctopusPrintEvaluatedVariables, both with a value of True), create and deploy a new release and send the resulting log? That will give us more information to look at and see if we can figure out what’s causing this.

Feel free to mark this thread as private or email the log to us at support@octopus.com and I can pick it up from there.

I look forward to hearing back and getting to the bottom of this!

Best regards,

Kenny

1 Like

Hi Kenneth,

It looks like a change has been made to the way the skipping for a parent step (rolling deployment) is displayed.

Below is a direct comparison. I think the skipping is now located in each of the child steps. It’s disconcerting because you get green ticks for the skipped steps.

Before upgrade:

before

after:
after

This has caused a bit of unnecessary clenching - can it be changed back or is this done for another reason?

Hi Thomas,

Thanks for the update and the screenshot! That really helped understand this issue in better detail. Firstly the change in how these steps are displayed (with the parent with children underneath) in this case with run conditions is intentional as of 2020.2.4 when we introduced the ability to define run conditions on child steps. Though the skipped and success dashes and ticks is not correct.

I’ve been able to reproduce this, where the first child step is marked as skipped due to the run condition, and the following child steps are not run as expected, but are marked as successful. This is certainly misleading, and after some investigation it looks like you’re hitting a variant of the following known bug.

Good news is we have a PR to fix this so hopefully it will be included in a new release soon (no ETA though).

Don’t hesitate to reach out with any further questions!

Best regards,

Kenny

1 Like