Issues icon indicating copy to clipboard operation
Issues copied to clipboard

When applying a .NET configuration transformation to two files in the same path no transformation file is found.

Open IsaacCalligeros95 opened this issue 2 years ago • 1 comments

Team

  • [X] I've assigned a team label to this issue

Severity

Blocking one customer

Version

2022.3.7000

Latest Version

I could reproduce the problem in the latest build

What happened?

When applying a .Net configuration transformation from a file in the same path as another no transformation occurs

Works = api\web.development.config => web.config Works = web.config => api\web.development.config Fails = api\web.development.config => api\web.config (Output = The transform pattern "api\web.Development.config => api\web.config" was not performed as no matching files could be found)

Reproduction

  1. Create a package copying the folder structure above (web.config, api/web.config and api\web.development.config.
  2. Apply a .Net configuration transformation with the following rules api\web.development.config => web.config, web.config => api\web.development.config and api\web.development.config => api\web.config
  3. Set Octopus.Action.Package.EnableDiagnosticsConfigTransformationLogging variable to true for details file matching

Error and Stacktrace

Extracting package 'C:\SharedDrive\Files\[email protected]@5E3A0EEFD5B3D24F81CC60BF1FBBC092.zip' to 'C:\SharedDrive\Work\20220804010516-1981-224\packages'
10:35:17   Verbose  |       Performing variable substitution on 'C:\SharedDrive\Work\20220804010516-1981-224\Script.ps1'
10:35:17   Verbose  |       Recursively searching for transformation files that match *.config in folder 'C:\SharedDrive\Work\20220804010516-1981-224'
10:35:17   Verbose  |       Found config file 'C:\SharedDrive\Work\20220804010516-1981-224\packages\web.config'
10:35:17   Verbose  |       - checking against transform 'api\web.Development.config => api\web.config'
10:35:17   Verbose  |       - Skipping as file name 'web.config' does not match the target pattern 'api\web.config'
10:35:17   Verbose  |       - checking against transform 'Release'
10:35:17   Verbose  |       - skipping as neither transform 'web.Release.config' nor transform 'web.Release' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages'
10:35:17   Verbose  |       - checking against transform 'Dev'
10:35:17   Verbose  |       - skipping as neither transform 'web.Dev.config' nor transform 'web.Dev' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages'
10:35:17   Verbose  |       Found config file 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api\another.config'
10:35:17   Verbose  |       - checking against transform 'api\web.Development.config => api\web.config'
10:35:17   Verbose  |       - Skipping as file name 'another.config' does not match the target pattern 'api\web.config'
10:35:17   Verbose  |       - checking against transform 'Release'
10:35:17   Verbose  |       - skipping as neither transform 'another.Release.config' nor transform 'another.Release' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api'
10:35:17   Verbose  |       - checking against transform 'Dev'
10:35:17   Verbose  |       - skipping as neither transform 'another.Dev.config' nor transform 'another.Dev' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api'
10:35:17   Verbose  |       Found config file 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api\web.config'
10:35:17   Verbose  |       - checking against transform 'api\web.Development.config => api\web.config'
10:35:17   Verbose  |       - Skipping as file name 'web.config' does not match the target pattern 'api\web.config'
10:35:17   Verbose  |       - checking against transform 'Release'
10:35:17   Verbose  |       - skipping as neither transform 'web.Release.config' nor transform 'web.Release' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api'
10:35:17   Verbose  |       - checking against transform 'Dev'
10:35:17   Verbose  |       - skipping as neither transform 'web.Dev.config' nor transform 'web.Dev' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api'
10:35:17   Verbose  |       Found config file 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api\web.Development.config'
10:35:17   Verbose  |       - checking against transform 'api\web.Development.config => api\web.config'
10:35:17   Verbose  |       - Skipping as file name 'web.Development.config' does not match the target pattern 'api\web.config'
10:35:17   Verbose  |       - checking against transform 'Release'
10:35:17   Verbose  |       - skipping as neither transform 'web.Development.Release.config' nor transform 'web.Development.Release' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api'
10:35:17   Verbose  |       - checking against transform 'Dev'
10:35:17   Verbose  |       - skipping as neither transform 'web.Development.Dev.config' nor transform 'web.Development.Dev' could be found in 'C:\SharedDrive\Work\20220804010516-1981-224\packages\api'
10:35:17   Verbose  |       The transform pattern "api\web.Development.config => api\web.config" was not performed as no matching files could be found.
10:35:17   Verbose  |       Executing 'C:\SharedDrive\Work\20220804010516-1981-224\Script.ps1'

More Information

Slack thread - https://octopusdeploy.slack.com/archives/C020P7U9Z9S/p1659366169899599

Workaround

None, attempting to use wildcards, etc didn't resolve this issue.

IsaacCalligeros95 avatar Aug 04 '22 01:08 IsaacCalligeros95

Customer has recently experienced this, worked around this by moving transform file to base folder. Internal ticket link

SeanStanway-Octopus avatar Oct 25 '22 07:10 SeanStanway-Octopus