Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable run condition is ignored on child steps if there is only one child step enabled in the parent step process. #8252

Closed
Clare-Octopus opened this issue Jul 14, 2023 · 3 comments
Assignees
Labels
kind/bug This issue represents a verified problem we are committed to solving

Comments

@Clare-Octopus
Copy link

Clare-Octopus commented Jul 14, 2023

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:

image

Reproduction

  1. Ensure you have an environment named Production and one named Test.

  2. Create a new project and set it up with a simple run a script parent step.

  3. Create three child run a script steps underneath it (use a write-host command to output some text for testing).

  4. On one of the child steps, have a variable run condition with this value -
    #{if Octopus.Environment.Name == "Production"}true#{/if}

  5. 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:

image

  1. Disable one of the child steps without the variable run condition in it, create a release, deploy it to the Test environment and see the child step being skipped as expected:

image

  1. Disable the other child step without the variable run condition in it (so you now only have one child step enabled in that parent step with the run condition variable included), deploy that to the Test environment and see that step being run even though it has not been deployed to the production environment:

image

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.

@Clare-Octopus Clare-Octopus added the kind/bug This issue represents a verified problem we are committed to solving label Jul 14, 2023
@Clare-Octopus Clare-Octopus changed the title Variable run condition is ignored on child steps if there is only one child step in the parent step process. Variable run condition is ignored on child steps if there is only one child step enabled in the parent step process. Jul 14, 2023
@benPearce1
Copy link

@octoreleasebot
Copy link

Release Note: Fix issue where step with single conditional action will be evaluated correctly.

@Octobob
Copy link
Member

Octobob commented Aug 22, 2023

🎉 The fix for this issue has been released in:

Release stream Release
2023.1 2023.1.11942
2023.2 2023.2.13111
2023.3 2023.3.8978
2023.4+ all releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

4 participants