Variable run condition is ignored on child steps if there is only one child step enabled in the parent step process. #8252
Labels
kind/bug
This issue represents a verified problem we are committed to solving
Severity
Blocking customers with variable run conditions that use child steps but there is a workaround.
Version
2023.2.12868, 2023.3.5049
Latest Version
None
What happened?
If you have a variable run condition on a child step in a project and you only have one child step enabled in the parent step Octopus will ignore the variable run condition on that child step:
Reproduction
Ensure you have an environment named
Production
and one namedTest
.Create a new project and set it up with a simple
run a script
parent step.Create three child
run a script
steps underneath it (use a write-host command to output some text for testing).On one of the child steps, have a variable run condition with this value -
#{if Octopus.Environment.Name == "Production"}true#{/if}
Create a release and deploy that project to any environment that is not Production (in this case
Test
)- see the step being skipped as expected:Test
environment and see the child step being skipped as expected:Test
environment and see that step being run even though it has not been deployed to the production environment:This proves that a variable run condition will be ignored if there is only one child step enabled with a variable run condition within a parent step.
Error and Stacktrace
No response
More Information
Reproduction (Internal) - https://octopus-operations.octopus.app/app#/Spaces-304/projects/misc/deployments/releases/1.10.141/deployments/Deployments-70932?activeTab=taskLog
Internal customer ticket - https://octopus.zendesk.com/agent/tickets/140981
Internal Slack Conversation - https://octopusdeploy.slack.com/archives/CNHBHV2BX/p1689333355460439
Workaround
The workaround here would be to place a
run a script
child step within the parent step and have it run a simple script:Write-Host "Hello"
Or something to that effect, this will mean you will always have two child steps enabled at any one time, therefore not triggering the bug.
The text was updated successfully, but these errors were encountered: