Additional transforms not being picked up with a subdirectory target

Hello,

I’m a big fan of the ‘additional transforms’ feature but the implementation seems slightly brittle at present. I’ve just spent a few hours trying to get the following configuration to work:

// these two work fine
_ConfigFiles\#{Octopus.Environment.Name}\episerverlog.config => episerverlog.config
_ConfigFiles\#{Octopus.Environment.Name}\web.config => web.config

// these two never do anything
_ConfigFiles\#{Octopus.Environment.Name}\App_Data\Config\appsettings.config => App_Data/Config/appsettings.config
_ConfigFiles\#{Octopus.Environment.Name}\App_Data\Config\connectionstrings.config => App_Data/Config/connectionstrings.config

As soon as I move the appsettings.config and connectionstrings.config to the root, the transforms work as expected.It seems that OD doesn’t support a transform target which lives outside of the site root.

So my query is twofold:

  • Please introduce the ability to be able to target specific file directories in the additional transforms target
  • Please add some kind of log output for each of the ‘additional transforms’ specified, as with my example above it just fails silently.

Thanks!
Keith

In the month that it’s taken for my original post to be approved by moderators, I’ve had more success in getting this to work. The key is to be explicit about both the source and target directories. I still have a few instances where I’m getting inconsistent results using similar test cases, if I can put together a concrete test case then I’ll do so and post it here.

In the meantime I’d still love to see more verbose messaging about exactly where OD is looking for transforms which would really help with debugging!

Hi Keith,

We are very sorry about your original thread getting lost. The spam filter caught it and we were not aware until last night. I managed to find quite a number, take them out of the spam filter and have been answering what I can since. It was not intentional, and we never moderate messages, we want all messages to come through. We are very sorry this happened.

Could you show an example of what you were able to get to work vs the example you gave originally?

Also just a follow up question about the messaging. Currently we do not log if it can’t find a specific match, as we make the assumption you may not have all transforms for each package for every release.
In the specific case of a defined config file in your additional transforms, do you think a simple warning such as: Cannot find _ConfigFiles\Dev\App_Data\Config\appsettings.config so skipping would be enough?

Again we are very sorry for the delay.
Vanessa

Hi Vanessa,

No problem! These things happen and my query was not serious or urgent, and it’s given me time to make progress in the interim.

As stated, I don’t have a reproducible bug but have been stuck on quite a few gotcha’s that have to be dealt with when using the additional transforms (such as Visual Studio copying config files into /bin/ when ‘Copy always’ is selected and OD doing transforms there when it can’t find the intended transform target file), but these are all easily fixed once the issue has been diagnosed. To that end, your suggestion of adding a Cannot find target transform _ConfigFiles\Dev\App_Data\Config\appsettings.config, skipping message would be very useful for debugging, even just as a raw message.

In my limited experience, when given an additional transform example of the following, I would expect;
configs/source-#{Octopus.Environment.Name}.config => someotherfolder/target.config

  • If the source config doesn’t find a matching environment then fail, possibly with a debug message - this is usual

  • If the source config matches to an environment but then can’t find the target config, then fail with an error

Just my 2c worth.

Thanks,
Keith

Hi Keith,

I have added a GitHub issue which you can track here: https://github.com/OctopusDeploy/Issues/issues/1238
We will handle the messaging around this area better in the logs for the deployment.

Cheers!
Vanessa

Just following up on this, I have a concrete example of where the extra logging may be useful (and possibly a bug-report, too).

Given the following directory structure:

web\configfiles\ (target/base config files)
web\configfiles\STAGING (environment-specific source transformation configs)
web\configfiles\STAGING\SERVER1 (machine-specific source transformation configs)
web\configfiles\STAGING\SERVER2 (machine-specific source transformation configs)

And the following transforms:

configfiles\#{Octopus.Environment.Name}\*.config => configfiles\*.config
configfiles\#{Octopus.Environment.Name}\#{Octopus.Machine.Name}\*.config => configfiles\*.config

No transformations are made. It would be useful to see what OD is looking for and attempting. In order to get around this, I’ve found that I have to copy the target configs from web\configfiles into the root \web and explicitly call each config transform like so;

configfiles\#{Octopus.Environment.Name}\web.config => web.config
configfiles\#{Octopus.Environment.Name}\#{Octopus.Machine.Name}\web.config => web.config

then I have a PowerShell step which copies the transformed configs back to the web\configfiles directory.

HTH,
Keith

Hi Keith,

Thanks for the extra information. It will help with test cases when it is implemented.

Vanessa