Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 of 7 tasks
bolt-io opened this issue Nov 15, 2024 · 20 comments
Labels
Area: Release Area:RM RM task team bug regression This used to work, but a change in the service/tasks broke it. triage

Comments

@bolt-io
Copy link

bolt-io commented Nov 15, 2024

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'
@bolt-io bolt-io added bug regression This used to work, but a change in the service/tasks broke it. labels Nov 15, 2024
@bolt-io bolt-io changed the title [REGRESSION]: [REGRESSION]: FileTransform@2 v2.248.1 fails on linux machines due to an introduced new variable enabled by default Nov 15, 2024
@EshitaD
Copy link
Contributor

EshitaD commented Nov 18, 2024

Hi @bolt-io, we have overridden to the previous task version and are currently working on the fix.

@bolt-io
Copy link
Author

bolt-io commented Nov 18, 2024

Hi @bolt-io, we have overridden to the previous task version and are currently working on the fix.

Thanks for the update @EshitaD.

Regarding overriding to the previous task version, please bear in mind that people (like myself) will have updated pipelines to the new version format of:

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

The revert may break this task on non-windows machines as xmlTransformationRules: is no longer referenced and cause more friction than fix forward.

I have heard feedback that this effects only those with a null value for xmlTransformationRules, those explicitly specifying an empty string (xmlTransformationRules: '') are not effected by the new parameter introduction.

Hope this helps.

@v-schhabra v-schhabra added the Area:RM RM task team label Nov 18, 2024
@steve-inclusive
Copy link

We updated our pipeline template to use the new parameter and now all our deployment jobs are broken again because of the rollback. Please consider the consequences of making breaking changes.

@bolt-io
Copy link
Author

bolt-io commented Nov 18, 2024

The revert may break this task on non-windows machines as xmlTransformationRules: is no longer referenced and cause more friction than fix forward.

We updated our pipeline template to use the new parameter and now all our deployment jobs are broken again because of the rollback. Please consider the consequences of making breaking changes.

Tried to warn you 🤦

Who is approving these changes? This should be fundamental knowledge in programming

@jhubsharp
Copy link

Also impacted by the breaking change before and the regression thrown in. I'd implore people to consider undocumented breaking changes that disrupt processes for everyone using these pipeline tasks.

@EshitaD
Copy link
Contributor

EshitaD commented Nov 19, 2024

Sorry for the inconvenience. To prevent further regressions, we have rolled back the fix. We are currently working on a hotfix and will resolve it as soon as possible.

@martijn-nap
Copy link

Same here, any ETA when the hotfix will be live?

@jhubsharp
Copy link

It would be really helpful to know what the final plan is. Rolling back the rollback is just going to break things again. If the intended end state is to have things as they were Friday, can you let everyone know so we know there should only be one more breaking change?

Alternatively, doesn't the task have a version number to avoid this sort of thing?

@steve-inclusive
Copy link

Task versions can be pinned as follows, this is the approach we took initially to workaround the issue.

- task: [email protected]

When we realised that a new parameter 'enableXmlTransform' had been introduced, we adjusted our template to make use of it. This then broke things a second time, when the change was rolled back, after a number of days had elapsed.

Our template now has both the old and new parameters specified. Hopefully this will be future proof.

enableXmlTransform: false
xmlTransformationRules: ''

@EshitaD
Copy link
Contributor

EshitaD commented Nov 20, 2024

We have made code changes based on the operating system and are currently testing them. These changes will be merged by the end of the day.

@EshitaD
Copy link
Contributor

EshitaD commented Nov 21, 2024

Hi @bolt-io, could you please share me your org name?

@EshitaD
Copy link
Contributor

EshitaD commented Nov 21, 2024

@bolt-io, i mean could you please provide devops organisation name, eg: https://dev.azure.com/v-eduvvada

@bolt-io
Copy link
Author

bolt-io commented Nov 21, 2024

@bolt-io, i mean could you please provide devops organisation name, eg: https://dev.azure.com/v-eduvvada

@EshitaD, https://dev.azure.com/ukhydro

@leed-star
Copy link

leed-star commented Nov 21, 2024

@EshitaD

Hi, sorry but we are getting an error with the latest release.

The config transform was working yesterday, now getting error when building on Linux self hosted agent (windows works)

Starting: Transform Json
==============================================================================
Task         : File transform
Description  : Replace tokens with variable values in XML or JSON configuration files
Version      : 2.246.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: Transform Json

YAML:

...
- task: FileTransform@2
displayName: "Transform Json"
inputs:
folderPath: '$(System.DefaultWorkingDirectory)//'
enableXmlTransform: false
jsonTargetFiles: '
/angular.json'
...

Please advise on what we should do to fix this as it appears to be broken by this release. ADO site https://dev.azure.com/trublue

@EshitaD
Copy link
Contributor

EshitaD commented Nov 21, 2024

Hi @leed-star, We have merged the code changes, and the deployments have started. I will let you know once they are completed.

@mtolkamp-cfs
Copy link

mtolkamp-cfs commented Nov 22, 2024

@EshitaD any update on this? We are having issues using the Classic Pipelines. Is there way to specify the version in those?
We are currently limited to 1.* and 2.*
I've tried working around this by exporting the task, changing the version to 2.246.1, and re-importing, but when saving it, it changes the version back to 2.*

our company site: https://dev.azure.com/carsforsale/

@Venkatesh150720
Copy link

Hi @EshitaD Can you please provide the update on this issue. The task is throwing an error while using Linux agent. Thanks!

@EshitaD
Copy link
Contributor

EshitaD commented Nov 25, 2024

Hi @bolt-io @leed-star, Could you please verify and let me know if the changes are working for you?

@leed-star
Copy link

leed-star commented Nov 25, 2024 via email

@bolt-io
Copy link
Author

bolt-io commented Nov 26, 2024

@EshitaD working for me also on v2.249.1 without specifying enableXmlTransform and xmlTransformationRules in the task 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Release Area:RM RM task team bug regression This used to work, but a change in the service/tasks broke it. triage
Projects
None yet
Development

No branches or pull requests

9 participants