azure-pipelines-tasks: Stop using the setAuthForSourcesInTempNuGetConfig in all package downloading scenarios, such as nuget install, restore, because it completely breaks PackageSourceMapping
Note
Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo
For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks
If you have an issue or request for the Azure Pipelines service, use developer community instead:
https://developercommunity.visualstudio.com/spaces/21/index.html )
Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: Tasks/DotNetCoreCLIV2/restorecommand.ts, but really all commands in this list https://github.com/microsoft/azure-pipelines-tasks/search?q=setAuthForSourcesInTempNuGetConfig
list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks
Environment
-
Server - Azure Pipelines or TFS on-premises?
-
If using TFS on-premises, provide the version: N/A
-
If using Azure Pipelines, provide the account name, team project name, build definition name/build number: N/A
-
-
Agent - Hosted or Private:
-
If using Hosted agent, provide agent queue name: N/A
-
If using private agent, provide the OS of the machine running the agent and the agent version: N/A
-
Issue Description
[Include task name(s), screenshots and any other relevant details]
NuGet recently release a supply chain feature called PackageSourceMapping. That feature uses the package source keys from a NuGet.Config.
See details here: https://devblogs.microsoft.com/nuget/introducing-package-source-mapping/ and https://docs.microsoft.com/en-us/nuget/consume-packages/package-source-mapping.
Azure DevOps has many tasks that rewrite the config and add a feed- prefix, but unfortunately this breaks all source mapping configurations.
See https://github.com/NuGet/Home/issues/11406
Please stop relying on rewriting the nuget.config for these operations.
Task logs
https://github.com/microsoft/azure-pipelines-tasks/search?q=setAuthForSourcesInTempNuGetConfig
[Enable debug logging and please provide the zip file containing all the logs for a speedy resolution]
Troubleshooting
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
Error logs
[Insert error from the logs here for a quick overview]
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 17
- Comments: 31 (12 by maintainers)
Hello,
I just want to sum up the suggestion by @nkolev92 for reference:
Replace the normal dotnet restore task
with a separate Nuget authenticate and a Powershell
dotnet restoretask:Would be nice if anyone fixes this issue as it is annoying and time consuming to fix it. I spent three days searching for a solution until I found this issue and noticed a little note at the end of the documentation for Source Mapping that it is not recommended to use the task which is supposed to do the job (
DotNetCoreCLI@2withrestorecommand) but it’s not able to do it properly…I just hit this wall as well. Pretty annoying that only after extensively searching I come across this issue. If the task(s) are considered dead, already for 2 years (!!), just obsolete them and give proper warnings. Even inject warnings when you detect there are
packageSourceMappingconfigurations present in the nuget config could help people find the right solution.Just to be clear - Are we saying people should, in general, not ever use DotNetCoreCLIV2 task anymore and replace it by cmd/bash/pwsh calls? (and maybe NuGetV0/NuGetCommandV2? others?)
Our team is still discussing internally how we’ll handle this. We are trying to discontinue any work on the heavyweight tasks and encourage adoption of the authenticate tasks
I am not sure if there is another ticket for this but I have a case using devops artifacts with nuget where dotnet restore fails but DotNetCoreCLI with
restorecommand works?This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
FWIW, I think it was actually @magleaso’s suggestion: https://github.com/microsoft/azure-pipelines-tasks/issues/15542#issuecomment-982018356
Thank you!
Please let us know if there’s anything we can do to help from NuGet side.
fyi @aortiz-msft @jondouglas