terraform-provider-octopusdeploy icon indicating copy to clipboard operation
terraform-provider-octopusdeploy copied to clipboard

`octopusdeploy_deployment_process.run_script_action` Capitalizes Boolean values

Open edgarschaap-omnia opened this issue 2 years ago • 1 comments
trafficstars

Describe the bug When creating octopus_deployment_process resource, within the step block and then run_script_action block, defined booleans for Octopus.Action.* properties end up being capitalized.

Steps to reproduce

  1. Create a simple octopusdeploy_deployment_process resource with a run_on_server property set to either true or false and for one more example Octopus.Features.SubstituteInFiles feature enabled.
  resource "octopusdeploy_deployment_process" "project_deployment_process" {
    project_id = octopusdeploy_project.project.id
    step {
      condition           = "Success"
      name                = "Slack - Notify Deployment Started"
      package_requirement = "LetOctopusDecide"
      start_trigger       = "StartAfterPrevious"
  
      run_script_action {
        condition         = "Success"
        name              = "Slack - Notify Deployment Started"
        run_on_server     = true
        is_required       = true
  
        features          = [ "Octopus.Features.SubstituteInFiles" ]
        script_source     = "Inline"
        script_syntax     = "PowerShell"
        script_body       = <<-EOT
                                function Slack-Rich-Notification ($notification)
                                {
                                    # ...
                                };
                            EOT
      }
    }
  }
  1. During the plan everything seems fine:
    ...
      
    + features                           = [
                  + "Octopus.Features.SubstituteInFiles",
                ]
      
    ...     

    + run_on_server                      = true

    ...
  1. Verifying created configuration on Octopus Deploy, Executed Location is set to Run on each deployment (most likely default false for run_on_server) instead of octopus deploy server image
  2. Comparing this step creation when done manually vs through terraform the json configuration stored in octopus deploy sql server we see that manual creation stores this in lowercase, while through terraform it is capitalized:

image

Also seems the case for other Octopus.Action.* boolean properties:

image

But not for values outside of the Octopus.Action.* properties scope, for instance the run_script_action.is_required property :

image

Expected behavior When I set the run_script_action.run_on_server property, through terraform, I expect same behaviour when creating this step manually, so the value for Octopus.Action.RunOnServer in the JSON configuration should be stored in lower case and other Octopus.Action.* booleans as well.

Logs and other supporting information During the initial creation, the tf plan doesn't show any wrong signs, however, when changing configure for instance for run_on_server from true to false we can see that the value is stored capitalized as well:

- "Octopus.Action.RunOnServer" = "True" -> null

Screenshots Already included in previous parts

Environment and versions:

  • OS: [ Windows Server 2022 ]
  • Octopus Server Version: [v2023.2 (Build 12643)]
  • Terraform Version: [1.3.5]
  • Octopus Terraform Provider Version: [0.12.4]

edgarschaap-omnia avatar Jul 13 '23 08:07 edgarschaap-omnia