Artifacts from SucceededWithIssues pipeline fail to download using DownloadPipelineArtifactV2
See original GitHub issueRequired Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: DownloadPipelineArtifactV2
Environment
-
Server - Azure Pipelines
-
Agent - Private Agent queue name: Default OS of the machine running the agent and the agent version: Windows, agent version 2.158.0
Issue Description
When I use DownloadPipelineArtifact@2
in my multi-stage yaml pipeline to download an artifact from a previous pipeline, it works well, if the previous Pipeline status is Succeeded
.
If for some reason, the pipeline status is SucceededWithIssues
the task will fail.
The issue seems to be in the plugin (https://github.com/microsoft/azure-pipelines-agent/blob/master/src/Agent.Plugins/PipelineArtifact/PipelineArtifactPluginV2.cs) line (253 and 257) as it’s using BuildResult.Succeeded
to filter builds.
Yaml
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: 'ProjectId'
definition: '4'
specificBuildWithTriggering: true
buildVersionToDownload: 'latest'
tags: '1.0.0'
artifactName: 'release'
targetPath: '$(Pipeline.Workspace)\test'
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Top GitHub Comments
I do have the same problem. Previously, when I was using
DownloadBuildArtifactsV0
task instead of this new oneDownloadPipelineArtifactV2
, I proposed a PR to allow to download artifact from partially succeeded builds (see #8660).And actually I would even like now to be able to download artifacts from failed builds, as long as they have a tag for instance that allows me to know whether a specific artifact has been published or not.
What I have in mind is a new task parameter that allows to determine builds to consider thanks to their job status thanks to a minimum value:
Succeeded
(default behavior),PartiallySucceeded
orFailed
.If it makes sense, I can provide pull requests for both the task and the plugin in order to manage that.
@jahsu-MSFT, done on both PR: #11664 & https://github.com/microsoft/azure-pipelines-agent/pull/2560.