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 task now returns SucceededWithIssues if there is nothing to transform #20835

Open
4 of 7 tasks
nickperkins opened this issue Feb 5, 2025 · 14 comments
Assignees
Labels
Area: Release awaiting deployment Related changes are waiting for deployment to be completed bug regression This used to work, but a change in the service/tasks broke it. triage

Comments

@nickperkins
Copy link

New issue checklist

Task name

FileTransform@2

Breaking task version

2.249.1

Last working task version

2.246.1

Regression Description

In the previous version, if there was nothing to transform in the file, an error message would appear but the task would return Succeeded
Image

Now if there is nothing to transform in the file, the error message appears but the task now returns SucceededWithIssues
Image

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-22.04

Relevant log output

<details>
  <summary>UNSUCCESSFUL RUN</summary>
  <pre> 2025-02-05T00:08:17.2161292Z ##[section]Starting: File transformation: appsettings.json
2025-02-05T00:08:17.2195145Z ==============================================================================
2025-02-05T00:08:17.2196642Z Task         : File transform
2025-02-05T00:08:17.2197981Z Description  : Replace tokens with variable values in XML or JSON configuration files
2025-02-05T00:08:17.2199358Z Version      : 2.249.1
2025-02-05T00:08:17.2203107Z Author       : Microsoft Corporation
2025-02-05T00:08:17.2204433Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/file-transform
2025-02-05T00:08:17.2205729Z ==============================================================================
2025-02-05T00:08:19.3347067Z Applying JSON variable substitution for **/appsettings.json
2025-02-05T00:08:20.3314853Z Applying JSON variable substitution for /__w/1/s/removedi/appsettings.json
2025-02-05T00:08:20.3360350Z ##[error]Error: Failed to apply JSON variable substitution. Changes are already present in the package.
2025-02-05T00:08:20.3392675Z ##[section]Finishing: File transformation: appsettings.json ] </pre>
</details>

<details>
  <summary>SUCCESSFUL RUN</summary>
  <pre>2025-02-02T07:04:20.6114722Z ##[section]Starting: File transformation: appsettings.json
2025-02-02T07:04:20.6141914Z ==============================================================================
2025-02-02T07:04:20.6143251Z Task         : File transform
2025-02-02T07:04:20.6144135Z Description  : Replace tokens with variable values in XML or JSON configuration files
2025-02-02T07:04:20.6145163Z Version      : 2.246.1
2025-02-02T07:04:20.6146091Z Author       : Microsoft Corporation
2025-02-02T07:04:20.6147005Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/file-transform
2025-02-02T07:04:20.6148049Z ==============================================================================
2025-02-02T07:04:22.3341889Z Applying JSON variable substitution for **/appsettings.json
2025-02-02T07:04:23.1457122Z Applying JSON variable substitution for /__w/1/s/removed/appsettings.json
2025-02-02T07:04:23.1489941Z ##[error]Failed to apply JSON variable substitution. Changes are already present in the package.
2025-02-02T07:04:23.1511458Z ##[section]Finishing: File transformation: appsettings.json</pre>
</details>

Full task logs with system.debug enabled

Repro steps

@nickperkins nickperkins added bug regression This used to work, but a change in the service/tasks broke it. labels Feb 5, 2025
@woeterman94
Copy link

For me the taks (and build) fails entirely if there is nothing to transform. Version 2.249.1.

Image

Behavior before (version 2.246.1)

Image

@Devvox93
Copy link

Devvox93 commented Feb 5, 2025

It depends whether you have continueOnError on true, but the main issue is that the task returns an error now where it didn't used to do that. This is either unintended or should have been a major version increase (because it's a breaking change in behavior).

@ppi-kosipenko
Copy link

This is breaking logic in our pipelines. The error was annoying before, but now its a showstopper.

@ppi-kosipenko
Copy link

When will this be addressed?

@EshitaD
Copy link
Contributor

EshitaD commented Feb 7, 2025

Hi All, we have fixed the issue by overriding the task version to 2.246.1 and are currently working on code changes.

@wouter-vanderauwera-fluvius

Hi All, we have fixed the issue by overriding the task version to 2.246.1 and are currently working on code changes.

How did you manage to do that?

@EshitaD
Copy link
Contributor

EshitaD commented Feb 7, 2025

@wouter-vanderauwera-fluvius We have a command to override the task version to the previously working version, and using that, we created a config change.

@v-schhabra v-schhabra added awaiting deployment Related changes are waiting for deployment to be completed and removed awaiting deployment Related changes are waiting for deployment to be completed labels Feb 10, 2025
@dhungelarun
Copy link

this is breaking our release pipeline. There doesn't seem to be way for us to selective choose the working version in classic release. I know we can do that in YAML by using task@version number. Anyone has any ideas?

@PedroC88
Copy link

PedroC88 commented Feb 12, 2025

Can this change be rolled back until there's a fix?... It's unreasonable to leave this broken for something that impacts so many users in production environments....

@msoler8785
Copy link

2.246.1 seems to have a bug with the XML transform task which causes it to run on non-windows platforms even if it isn't selected.

2025-02-17T18:36:52.9629048Z ##[debug]Evaluating: succeeded()
2025-02-17T18:36:52.9629727Z ##[debug]Evaluating succeeded:
2025-02-17T18:36:52.9630718Z ##[debug]=> True
2025-02-17T18:36:52.9631510Z ##[debug]Result: True
2025-02-17T18:36:52.9632258Z ##[section]Starting: File Transform: 
2025-02-17T18:36:52.9643879Z ==============================================================================
2025-02-17T18:36:52.9644260Z Task         : File transform
2025-02-17T18:36:52.9644501Z Description  : Replace tokens with variable values in XML or JSON configuration files
2025-02-17T18:36:52.9644851Z Version      : 2.246.1
2025-02-17T18:36:52.9645081Z Author       : Microsoft Corporation
2025-02-17T18:36:52.9645327Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/file-transform
2025-02-17T18:36:52.9645724Z ==============================================================================
...
2025-02-17T18:36:53.2982724Z ##[debug]xmlTransformationRules=-transform **\*.Release.config -xml **\*.config
2025-02-17T18:36:53.2986115Z ##[debug]xmlTargetFiles=undefined
2025-02-17T18:36:53.2987279Z ##[debug]jsonTargetFiles=appsettings.json
2025-02-17T18:36:53.3011429Z ##[debug]task result: Failed
2025-02-17T18:36:53.3051433Z ##[error]Error: Cannot perform XML transformations on a non-Windows platform.
2025-02-17T18:36:53.3062949Z ##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;correlationId=214b7a97-5a4e-4b97-958c-6eaa52fd79cf;]Error: Cannot perform XML transformations on a non-Windows platform.
2025-02-17T18:36:53.3066252Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: Cannot perform XML transformations on a non-Windows platform.
2025-02-17T18:36:53.3081944Z ##[section]Finishing: File Transform: 

@v-schhabra v-schhabra added the awaiting deployment Related changes are waiting for deployment to be completed label Feb 24, 2025
@EshitaD
Copy link
Contributor

EshitaD commented Feb 26, 2025

we have merged the PR, and deployments will start on Monday or Tuesday. I will let you know once the deployments are completed.

@PedroC88
Copy link

Is there an ETA for this to be generally available?

@xianglitheonly
Copy link

Hello Team, may I know if the deployments are done? Thanks!

@EshitaD
Copy link
Contributor

EshitaD commented Mar 11, 2025

Hi All, We have made the necessary code changes and have already triggered task deployments, which are completed up to Ring 2. The changes are expected to be rolled out to all rings by this weekend. I will let you know once the deployment is completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Release awaiting deployment Related changes are waiting for deployment to be completed 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