toolrunner _argStringToArray eats up escaped quotes
See original GitHub issuePlease check our current Issues to see if someone already reported this https://github.com/Microsoft/azure-pipelines-task-lib/issues
Environment
azure-pipelines-task-lib version:
Issue Description
toolrunner _argStringToArray eats up escaped quotes
Expected behavior
It should no remove escaped quotes
Actual behavior
toolrunner _argStringToArray eats up escaped quotes
Steps to reproduce
Server - Azure Pipelines task DotNetCoreCLI@2
- task: DotNetCoreCLI@2
inputs:
command: 'test'
arguments: '-- TestRunParameters.Parameter(name=\"EdiStagingFunctionsKey\",value=\"key2\")'
Other Inputs
- If we try passing quotes as a value even that is being eaten up by task-lib
Input:
-- TestRunParameters.Parameter(name=paramName,value=argwith"aquote)
Output-- TestRunParameters.Parameter(name=paramName,value=argwithaquote)
- If we use backslash then also quote is eaten up.
Input:
-- TestRunParameters.Parameter(name=paramName,value=argwith\"aquote)
Output-- TestRunParameters.Parameter(name=paramName,value=argwith\aquote)
Other Inputs:
Input: -- TestRunParameters.Parameter(name=\"EdiStagingFunctionsKey\",value=\"key2\")
Output: TestRunParameters.Parameter(name=\EdiStagingFunctionsKey\",value=\"key2\")
Note: Above the first escaped quotes are eaten up.
Input: TestRunParameters.Parameter(name="EdiStagingFunctionsKey",value="key2"
Output: TestRunParameters.Parameter(name=EdiStagingFunctionsKey,value=key2)
More details on the issue from customer - https://github.com/microsoft/azure-pipelines-tasks/issues/13130
Our Debug analysis is as below along with the flow: Issue Bug is with azure-task-lib _argStringToArray function - https://github.com/microsoft/azure-pipelines-task-lib/blob/master/node/toolrunner.ts#L88
Stack–> https://github.com/microsoft/azure-pipelines-task-lib/blob/master/node/toolrunner.ts#L88 https://github.com/microsoft/azure-pipelines-task-lib/blob/master/node/toolrunner.ts#L838 https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/DotNetCoreCLIV2/dotnetcore.ts#L170
/cc @nohwnd @ShreyasRmsft @phanikmmsft
Logs
##[debug]C:\Program Files\dotnet\dotnet.exe arg: test
TestRunParameters.Parameter(name=\"EdiStagingFunctionsKey\",value=\"key2\")
##[debug]C:\Program Files\dotnet\dotnet.exe arg: --logger trx --results-directory "C:\agent\_work\_temp" -- TestRunParameters.Parameter(name=\"EdiStagingFunctionsKey\",value=\"key2\")
##[debug]exec tool: C:\Program Files\dotnet\dotnet.exe
##[debug]arguments:
##[debug] test
##[debug] --logger
##[debug] trx
##[debug] --results-directory
##[debug] C:\agent\_work\_temp
##[debug] --
##[debug] TestRunParameters.Parameter(name=\EdiStagingFunctionsKey",value="key2")
"C:\Program Files\dotnet\dotnet.exe" test --logger trx --results-directory C:\agent\_work\_temp -- "TestRunParameters.Parameter(name=\EdiStagingFunctionsKey\",value=\"key2\")"
##[debug]Exit code 0 received from tool 'C:\Program Files\dotnet\dotnet.exe'
##[debug]STDIO streams have closed for tool 'C:\Program Files\dotnet\dotnet.exe'
##[debug]BuildConfiguration=release
##[debug]BuildPlatform=any cpu
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:16 (4 by maintainers)
Yeah, still interested in this being fixed.
Any updates on this issue please ?