NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 252 forks source link

dotnet nuget update source needs to accomodate existing sources. #12251

Open ChristianSauer opened 1 year ago

ChristianSauer commented 1 year ago

NuGet Product(s) Involved

dotnet.exe

The Elevator Pitch

When running a CI piepline I often have to add custom nuget feeds. If the build machine is stateful that's extremely cumbersome due to the bad dotnet dotnet nuget update source command. it will fail if the source does not exist, but add will also fail if the source does exist. In short, its impossible to just update the source without worrying about the state of the build machine,

Either add a third command, e.g addOrUpdate oder add parameters both other commands to allow for existing / non existing sources.

Additional Context and Details

No response

KalleOlaviNiemitalo commented 1 year ago

Perhaps you could define those feeds in NuGet.Config in the solution folder (Config file locations and uses) and store that in version control. Are the custom nuget feeds specific to the CI environment and not to be used by developers?

ChristianSauer commented 1 year ago

@KalleOlaviNiemitalo I tried that, and it might be the best solution for the moment but I dislike this. Ideally my ci/cd file tells me at a glance what happens, and if I stuck a config file somewhere it's not really obvious. Furthermore, that file would need to reference env-variables specific to the CI/CD environment (Api token ) so it does not even work on developer pcs.

And yes the push feeds are specific. For pulling there is an global endpoint for the whole group (gitlab parlance). For pushing you are pushing to a specific project feed.