isaacabraham / vsts-fsharp

Azure Devops extension for F#-friendly tools
https://marketplace.visualstudio.com/items?itemName=isaacabraham.fsharp-helpers-extension
Apache License 2.0
13 stars 7 forks source link

Tasks use outdated node #41

Open wyrdfish opened 2 years ago

wyrdfish commented 2 years ago

Description

It seems that azure devops tasks will no longer work with node 6 in march 2022 so they are now displaying a warning in each pipeline run.

Repro steps

Run one of the tasks in a pipeline and read the log.

Expected behavior

no warning.

Actual behavior

a warning.

Details

2021-12-03T17:39:53.9247604Z ##[section]Starting: Setup Paket Credential Manager 2021-12-03T17:39:53.9372982Z ============================================================================== 2021-12-03T17:39:53.9373420Z Task : Paket Credential Manager 2021-12-03T17:39:53.9374079Z Description : Creates a credential manager for Paket to access internal NuGet feeds. 2021-12-03T17:39:53.9374470Z Version : 0.2.5 2021-12-03T17:39:53.9374744Z Author : Matthias Dittrich 2021-12-03T17:39:53.9375248Z Help : This task allows you to consume NuGet packages hosted in your own private feed by providing a credential manager. 2021-12-03T17:39:53.9375786Z ============================================================================== 2021-12-03T17:39:53.9560702Z ##[warning]This task uses Node 6 execution handler, which will be removed March 31st 2022. If you are the developer of the task - please consider the migration guideline to Node 10 handler - https://aka.ms/migrateTaskNode10 (check this page also if you would like to disable Node 6 deprecation warnings). If you are the user - feel free to reach out to the owners of this task to proceed on migration.

tfabris commented 2 years ago

@isaacabraham and @matthid -

Indeed, this is a problem for us too. We are using your setCredentialManager tool in our Azure DevOps Pipeline, but it will become deprecated soon, which will break our pipeline. I contacted Microsoft support about it, and they said that since it was your tool, I needed to contact you here. They said you needed to upgrade to Node 10 as described here: https://github.com/microsoft/azure-pipelines-tasks/blob/master/docs/migrateNode10.md

Is this something that can be updated? If not, what do you recommend that I do for a replacement? Right now we only have this one line in our YML file which produces the error: - task: setCredentialManager@0 This line is important because our build's "Paket Restore" will not function without it. So if we have to replace it with something else, what would that replacement look like for us?

Thanks!

Our error message looks like this:

2021-12-09T21:47:20.2679067Z ==============================================================================
2021-12-09T21:47:20.2679373Z Task         : Paket Credential Manager
2021-12-09T21:47:20.2679674Z Description  : Creates a credential manager for Paket to access internal NuGet feeds.
2021-12-09T21:47:20.2679948Z Version      : 0.2.5
2021-12-09T21:47:20.2680149Z Author       : Matthias Dittrich
2021-12-09T21:47:20.2680510Z Help         : This task allows you to consume NuGet packages hosted in your own private feed by providing a credential manager.
2021-12-09T21:47:20.2680961Z ==============================================================================
2021-12-09T21:47:20.2733464Z ##[warning]This task uses Node 6 execution handler, which will be removed March 31st 2022. If you are the developer of the task - please consider the migration guideline to Node 10 handler - https://aka.ms/migrateTaskNode10 (check this page also if you would like to disable Node 6 deprecation warnings). If you are the user - feel free to reach out to the owners of this task to proceed on migration.
tfabris commented 2 years ago

My interim solution was to use a different tool to configure the credential manager. I think this works, we'll see how it goes in the long run.

Old code (gives deprecation error message):

  # -----------------------------------------------------------------------------
  # Set up the credential manager, required for Paket to work.
  # -----------------------------------------------------------------------------
  - task: setCredentialManager@0
    displayName: Paket - Set credential manager

New code (seems to work I think):

  # -----------------------------------------------------------------------------
  # Set up the credential manager, required for Nuget and Paket to work.
  # -----------------------------------------------------------------------------
  - task: NuGetAuthenticate@0
    displayName: Nuget and Paket - Set credential manager
wyrdfish commented 2 years ago

This task no longer works at all on the latest windows-2022 agents as the required dotnet framework is not present.

I upgraded this authentication plugin https://github.com/slang25/Paket.CredentialProvider.Gen2Support to dotnet5 and install it into the plugin folder then call the standard NuGetAuthenticate@0 task.

ColinDabritzTrimble commented 2 years ago

We hit the same issue as above ^ with nuget requirements on other Microsoft Hosted agents. It appears this repo is not actively maintained. See the Microsoft Hosted Agents notice: https://github.com/actions/virtual-environments/issues/4871

There is a temporary work-around to explicitly add the "Use Dot Net Core" task to install the 2.x version you need: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops

Note this is a separate issue than the Node version issue described above. I'll open a separate instance for clarity. Update: Not really an issue as much as a pre-req. Note that once you specify the 2.x using a task, it can also mean you have to specify other versions you need.

We've gotten farther adding these steps to our Azure Devops YAML pipeline:

    - task: UseDotNet@2
      displayName: 'Use .NET Core sdk'
      inputs:
        packageType: sdk
        version: 2.x

    - task: UseDotNet@2
      displayName: 'Use .NET Core sdk'
      inputs:
        packageType: sdk
        version: 3.x