huserben / TfsExtensions

Extensions for TFS 2015+ such as custom Widgets (require TFS 2017) and Build Tasks
MIT License
44 stars 22 forks source link

Template parameter value containing comma ',' adds space after it #255

Open CaffreyYA opened 2 months ago

CaffreyYA commented 2 months ago

Hi, I have a pipeline that uses TriggerBuild@4 to trigger another pipeline, and I have it to send something like templateParameters: 'Foo:$Var'

And in some cases, $Var would contain comma, so it could be Foo:"A,B", but then on the receiver pipeline side, it gets "A, B" as the value of Foo parameter, instead of "A,B". And in our case, "A,B" and "A, B" are treated differently, so this is not working well because from the receiver side, it only gets "A, B" and it doesn't know if the original value contains the space or not.

I found this post from years back: https://github.com/huserben/TfsExtensions/issues/54 and it looks like

BuildConfiguration: chk,ret,BuildPlatform: x86,amd64,FileSpecification: CompilerAndLibraries

becomes

BuildConfiguration: chk, ret BuildPlatform: x86, amd64 FileSpecification: CompilerAndLibraries

is what introduced space whenever seeing a comma. I'm wondering if it could remove the space, if the original value does not contain it? So it becomes:

BuildConfiguration: chk,ret BuildPlatform: x86,amd64 FileSpecification: CompilerAndLibraries

huserben commented 2 months ago

Hi @CaffreyYA

you are right, it seems that this removal of the space was introduced while addressing #54.

I'll check out the code and see what could be done. However, this is not my main focus at the moment as I don't even use the task myself anymore. That means, I'm not sure when I'll get to check this out in more detail and when (if at all) I can provide a fix for this.

If this is a critical thing for you and you need it as soon as possible, you might be better off using another task or write a custom script for your case (I can try to be of support for this - just let me know).

I'll keep you posted as soon as I would have any update on this issue.