Azure-pipelines-agent: Bug caused by the message "Please use Download Build Artifact task for downloading Build Artifact type artifact" being added to download publish artifacts

Created on 6 Aug 2020  路  3Comments  路  Source: microsoft/azure-pipelines-agent

Agent Version and Platform

Version of your agent? 2.171.1

OS of the machine running the agent? Windows

Azure DevOps Type and Version

dev.azure.com

What's not working?

PR #2855 (Add a warning message to Download Pipeline Artifact task #2855) introduced a warning when not using the Publish Build articfact as it was intended to do. The warning is

`

[warning]Please use Download Build Artifact task for downloading Build Artifact type artifact. https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/download-build-artifacts?view=azure-devops

`

This was added to the Developer Community here https://developercommunity.visualstudio.com/content/problem/1103816/need-clarification-on-warning-issued-regarding.html

The warning was observed when using the PublishCodeCoverageResultsV2 task to publish code coverage results. Tested with the publish test results in isolation as well to check if that caused the warning but that task was ok.

Agent and Worker's Diagnostic Logs

See warning above

question

Most helpful comment

Thank Gordon,
For context I am using PublishPipelineArtifact in Job1 which is an Azure Agent, and then DownloadPipelineArtifact in Job2 on an OnPremise agent.

Since this change I now am getting this warning.
What was the intended purpose of the warning?

I am also confused as the message from the MSFT is

Pipeline artifacts are the next generation of build artifacts and are the recommended way to work with artifacts.

If so why the warning if I am using the recommended tasks?

All 3 comments

Thank Gordon,
For context I am using PublishPipelineArtifact in Job1 which is an Azure Agent, and then DownloadPipelineArtifact in Job2 on an OnPremise agent.

Since this change I now am getting this warning.
What was the intended purpose of the warning?

I am also confused as the message from the MSFT is

Pipeline artifacts are the next generation of build artifacts and are the recommended way to work with artifacts.

If so why the warning if I am using the recommended tasks?

Yup. Same issue here.

Still getting this warning even though I've switched to the newer tasks for both uploads and downloads. My builds are using windows-2019 and ubuntu 18.04 hosted agents.

The docs are clear but the warnings are annoying.

Looks like the PublishCodeCoverageResults@1 task is the culprit. So if you used the PublishCodeCoverageResults@1 task before the DownloadPipelineArtifact@2 and don't specify the artifactName when downloading artifacts, it attempts to download files from the published coverage results matching the globbing pattern.

Specifying the artifactName seems to work for me.

- task: DownloadPipelineArtifact@2
      displayName: 'Download Artifacts'
      inputs:
         buildType: 'current'
         artifactName: '$(artifactName)'
         itemPattern: '**'
         targetPath: "$(Build.ArtifactStagingDirectory)"
Was this page helpful?
0 / 5 - 0 ratings