microsoft / tfs-cli

Cross-platform CLI for Microsoft Team Foundation Server and Visual Studio Team Services
MIT License
370 stars 131 forks source link

Uploading a build task with override fails #195

Open IngbertPalm opened 7 years ago

IngbertPalm commented 7 years ago

I'm trying yo upload a custom build task with the override option but it fails with a "already exists" message.

Here my command:

tfx build tasks upload --task-path ..\Tasks\SetAssemblyVersion --overwrite

and what I got as message:

2017-03-21T14:47:19.165Z : loader.load TFS Cross Platform Command Line Interface v0.3.49 Copyright Microsoft Corporation 2017-03-21T14:47:19.538Z : cache.getItem 2017-03-21T14:47:19.541Z : cache.getItem 2017-03-21T14:47:19.544Z : Validating task json... 2017-03-21T14:47:19.546Z : Json is valid. 2017-03-21T14:47:20.152Z : Error: Failed Request: Conflict(409) - The task definition with id '46ace2b6-e979-4c16-9435-926e0fcdf0c6', name 'SetAssemblyVersion' and version '1.0.2' already exists. 2017-03-21T14:47:20.152Z : at processResponse (C:\Users\IPA\AppData\Roaming\npm\node_modules\tfx-cli\node_modules\vso-node-api\RestClient.js:59:18) 2017-03-21T14:47:20.152Z : at C:\Users\IPA\AppData\Roaming\npm\node_modules\tfx-cli\node_modules\vso-node-api\RestClient.js:133:13 2017-03-21T14:47:20.152Z : at IncomingMessage. (C:\Users\IPA\AppData\Roaming\npm\node_modules\tfx-cli\node_modules\vso-node-api\HttpClient.js:39:17) 2017-03-21T14:47:20.152Z : at emitNone (events.js:91:20) 2017-03-21T14:47:20.152Z : at IncomingMessage.emit (events.js:185:7) 2017-03-21T14:47:20.152Z : at endReadableNT (_stream_readable.js:974:12) 2017-03-21T14:47:20.152Z : at _combinedTickCallback (internal/process/next_tick.js:74:11) 2017-03-21T14:47:20.152Z : at process._tickCallback (internal/process/next_tick.js:98:9) error: Error: Failed Request: Conflict(409) - The task definition with id '46ace2b6-e979-4c16-9435-926e0fcdf0c6', name 'SetAssemblyVersion' and version '1.0.2' already exists.

Expected behavior: Should override the existing build task.

Kind regards,

Ingbert

ahmedig commented 6 years ago

You should just increment the version number in the task.json and it will work without the overwrite.

Larswa commented 6 years ago

Still seeing the same thing. What is the point of having the --overvwrite argument if it does not work?

pabrams commented 5 years ago

It's even worse if it's not a custom build task, because we can't use any workaround as suggested by ahmedig.