Bug in Configuration Transformations in Step Templates using Custom Expression

I have a “Deploy a NuGet package” Step Template created with three parameters: PackageName (single-line), DeploymentPath (single-line), and ApplyWebConfigTransformations (checkbox).

The ApplyWebConfigTransformations parameter is bound to the “XML transforms” field of the “Configuration transforms” feature. The expression text field displays just fine when swapping from the checkbox to the Custom Expression, but once saved and reloaded, the text field no longer displays.

PS. At one point in time, the Post-deployment script (C#) was lost on two out of the four templates I have, however, I haven’t been able to reproduce this issue.

I am using version 3.0.5.2124 on Server and Tentacles, and the Tentacles have Calamari version 3.0.1.376…

Here’s the Step Template export:

{
  "Id": "ActionTemplates-22",
  "Name": "Deploy WebApi",
  "Description": null,
  "ActionType": "Octopus.TentaclePackage",
  "Version": 5,
  "Properties": {
    "Octopus.Action.Package.NuGetFeedId": "feeds-builtin",
    "Octopus.Action.EnabledFeatures": "Octopus.Features.CustomDirectory,Octopus.Features.CustomScripts,Octopus.Features.ConfigurationTransforms",
    "Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles": "False",
    "Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings": "False",
    "Octopus.Action.Package.DownloadOnTentacle": "False",
    "Octopus.Action.Package.NuGetPackageId": "#{PackageName}",
    "Octopus.Action.CustomScripts.Deploy.ps1": "",
    "Octopus.Action.Package.CustomInstallationDirectory": "#{DeploymentPath}",
    "Octopus.Action.CustomScripts.PreDeploy.csx": "var deploymentPath = Octopus.Parameters[\"Octopus.Action.Package.CustomInstallationDirectory\"];\nvar filesToDelete = new[]\n{\n    System.IO.Path.Combine(deploymentPath, @\"App_Data\\app_offline_template.htm\"),\n    System.IO.Path.Combine(deploymentPath, @\"App_Data\\Documentation.htm\")\n};\nvar directoriesToDelete = new[]\n{\n    System.IO.Path.Combine(deploymentPath, @\"bin\"),\n    System.IO.Path.Combine(deploymentPath, @\"Public\"),\n    System.IO.Path.Combine(deploymentPath, @\"Views\")\n};\n\nforeach (var file in filesToDelete)\n{\n    if (System.IO.File.Exists(file))\n    {\n        System.IO.File.Delete(file);\n    }\n}\nforeach (var directory in directoriesToDelete)\n{\n    if (System.IO.Directory.Exists(directory))\n    {\n        System.IO.Directory.Delete(directory, true);\n    }\n}",
    "Octopus.Action.CustomScripts.PostDeploy.csx": "var deploymentPath = Octopus.Parameters[\"Octopus.Action.Package.CustomInstallationDirectory\"];\nvar filesToDelete = new[]\n{\n    System.IO.Path.Combine(deploymentPath, @\"Web.Debug.config\"),\n    System.IO.Path.Combine(deploymentPath, @\"Web.Release.config\")\n};\n//var directoriesToDelete = new[]\n//{\n//};\n\nforeach (var file in filesToDelete)\n{\n    if (System.IO.File.Exists(file))\n    {\n        System.IO.File.Delete(file);\n    }\n}\n//foreach (var directory in directoriesToDelete)\n//{\n//    if (System.IO.Directory.Exists(directory))\n//    {\n//        System.IO.Directory.Delete(directory, true);\n//    }\n//}"
  },
  "SensitiveProperties": {},
  "Parameters": [
    {
      "Name": "PackageName",
      "Label": "Package Name",
      "HelpText": "",
      "DefaultValue": "WebApi.",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "DeploymentPath",
      "Label": "Deployment Path",
      "HelpText": null,
      "DefaultValue": "C:\\inetpub\\web-api",
      "DisplaySettings": {
        "Octopus.ControlType": "SingleLineText"
      }
    },
    {
      "Name": "ApplyWebConfigTransformations",
      "Label": "Apply Web Config Transformations",
      "HelpText": null,
      "DefaultValue": "True",
      "DisplaySettings": {
        "Octopus.ControlType": "Checkbox"
      }
    }
  ],
  "$Meta": {
    "ExportedAt": "2015-07-25T01:20:55.148Z",
    "OctopusVersion": "3.0.1.2063",
    "Type": "ActionTemplate"
  }
}

Hi Jesse

Thanks for getting in touch (and the detailed bug report!)

We’re looking at a very similar issue right now ( https://github.com/OctopusDeploy/Issues/issues/1788 ) so we’ll make sure your case works as a part of that fix. If you watch that issue we should have a fix out in the next day or two.

Regards

Damian

Hi Jesse,
Comparing with the build of 2.6 it looks like this bug existed previously and so is not a regression bug as I had originally thought as with the GH issue that Damain made reference to. I have created a new ticket (https://github.com/OctopusDeploy/Issues/issues/1794) to track this item as it may take a little longer to fix.
Apologies for any inconvenience but the underlying value should still be saved, it looks to be a largely UX issue with the portal.
I will keep you updated with this issue as it progresses.
Cheers,
Robert

Thanks for the followup Damian and Robert.

This issue appears to have been fixed in OD 3.0.13.2383 (see issue 1861 - https://github.com/OctopusDeploy/Issues/issues/1861).