microsoft/azure-pipelines-tasks

[REGRESSION]: FileTransform@2 v2.248.1 fails on linux machines due to an introduced new variable enabled by default

bolt-io opened this issue · 21 comments

New issue checklist

Task name

FileTransform@2

Breaking task version

2.248.1

Last working task version

2.246.1

Regression Description

A change in #20602 which included the new variable enableXmlTransform with "defaultValue": true means that all pipelines running on non-windows platforms require updating! Please implement this in a transitive way so it still works with an empty xmlTransformationRules value. Minor changes should not having breaking changes.

    {
      "name": "enableXmlTransform",
      "type": "boolean",
      "label": "XML transformation",
      "required": false,
      "defaultValue": true,
      "helpMarkDown": "Config transforms will be run prior to the Variable Substitution.<br/>XML transformations are supported only for Windows platform."
    },
    {
      "name": "xmlTransformationRules",
      "type": "multiLine",
      "label": "XML Transformation rules",
      "defaultValue": "-transform **\\*.Release.config -xml **\\*.config",
      "required": false,
      "helpMarkDown": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile>  -xml <pathToSourceConfigurationFile>"
      "helpMarkDown": "Provide new line separated list of transformation file rules using the syntax: <br/>-transform <pathToTransformFile>  -xml <pathToSourceConfigurationFile>",
      "visibleRule": "enableXmlTransform == true"
    },

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Ubuntu

Relevant log output

Starting: Update appsettings
==============================================================================
Task         : File transform
Description  : Replace tokens with variable values in XML or JSON configuration files
Version      : 2.248.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/file-transform
==============================================================================
##[error]Error: Cannot perform XML transformations on a non-Windows platform.
Finishing: Update appsettings

Full task logs with system.debug enabled

UNSUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 
SUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

Run the following task on a linux box:


      - task: FileTransform@2
        displayName: 'Update appsettings'
        inputs:
          folderPath: '$(Build.SourcesDirectory)/'
          xmlTransformationRules:
          jsonTargetFiles: '**/appsettings*.json'