Skip to content

[REGRESSION]: FileTransform@2 task now returns SucceededWithIssues if there is nothing to transform #20835

@nickperkins

Description

@nickperkins

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions