2018.1 Deleting Nuget.Exe version from Tools does not remove the Configuration Parameter

Hi.
We've just removed several versions of Nuget.ComandLine and we're seeing that the Configuration Parameters, where the default setting wasn't used for nuget, a previously hidden parameter is still lingering:

We have lots of build configurations where the default option wasn't used and it's a manual job to fix.

The undeleteable parameter is removed by choosing a specific available version of nuget (in all of the build steps using the different nuget runners) and then choosing the default option afterwards. 

It's not possible to build a project until the Configuration Parameters is removed or has a value.

0
6 comments

Hi Harald,

Yes, if you were using that specific tool and you remove it, it's pretty much expected that this happens, because your build step requires it. Am I misinterpreting, that you were using version (for example) 3.4 instead of the 3.5 that is shown as missing, but even you use a different version still have that requirement? Because that would definitiely be a bug.

If you have a large number of such build configurations, the possible suggestions would be to:
-Have your projects in VCS, then change your settings from the Version Control to all using some script, manually, or kotlin code
-Use the REST API and iterate through the build configurations performing the changes with a script
-Run a mass replace in the files in the data directory where the projects are stored (<data_directory>/config/projects/<project_id>/buildTypes/<buildTypeId>.xml). This is basically the same as having the settings in VCS on XML, but has the issue that it requires to run it directly on the production machine (of course, run it before in test if you have a test environment)

0

Hi Denis.

Just to verify the outcome of the following action:
Removing a version of a tool from the Tool menu in TeamCity, does not result in setting a default value in the build steps that has set a custom version value. The menu option will only appear like it is using the default value.

So if the custom value is nuget version 3.5.0
The default value is nuget version 4.6.0
When the version 3.5.0 is removed, the custom value will persist even though the version 3.5.0 is removed.

0

Hi Harald,

sorry, I had this wrong. At least in 2018.1 if you remove the tool then TeamCity will set the build configurations to use the default one. The problematic here might be depending on how the builds are set up. We can to some extent change default build runners, are you using meta runners or some other parameters for this?

0

Hi Denis.

We are using the built in meta runners for nuget; the nuget installer, nuget pack and nuget publish

As shown in the example below

If a build step is using a nuget meta runner with a custom version numbering, and then the custom version is removed, the version number is updated to the default version for all of the build steps that are using that particular version.

But the change done by the administration interface, is only on the surface. It's not until you click on the dropdown box for Nuget.exe in each of the buildsteps  that the change is noticed in the build configuration. You only need to click on the dropdown, to get the "save" option and then the build configuration will remove the custom parameter for the nuget meta runners.

To reproduce:

Have two different nuget versions installed in TeamCity (f.ex. version 3.5.0 and 4.6.2). Choose 4.6.2 as the default version for nuget.exe.
In a build step using a nuget installer meta runner, change the nuget.exe version to 3.5. Save.

Go to the administration interface --> Tools
Choose to remove the 3.5 nuget version.
TeamCity will warn about projects that are using that particular nuget version, will be set to the default version. Choose to accept.

Go back to the build configuration where the nuget installer meta runner is.
Look at the parameters. There should be a yellow triangle warning about something is wrong. Go into Parameters, there should also be a row called teamcity.tool.NuGet.CommandLine.3.5.0, with the value <value is required>.

Go to the build step with the nuget installer.
The value in the NuGet.exe should be <Default (4.6.2)>
Click on the nuget version dropdown, the yellow save popup will say the changes are not yet saved. Click on the Save option.

Go back to the parameters, the row teamcity.tool.NuGet.CommandLine.3.5.0 will be gone.

0

Sorry for the delay, unfortunately with the holiday season it was hard picking up the colleagues to see what was going on. Could you please open an issue for the problem in our tracker here? https://youtrack.jetbrains.com/issues/TW

0

A quick follow up. In case you would like a workaround for this issue, you could configure a parameter on the root project for such unresolved references, something like:
teamcity.tool.NuGet.CommandLine.3.5.0 = %teamcity.tool.NuGet.CommandLine.4.6.0%

0

Please sign in to leave a comment.