azure-devops-yaml-schema icon indicating copy to clipboard operation
azure-devops-yaml-schema copied to clipboard

DownloadPackage@1 - incomplete documentation for version

Open mareklinka opened this issue 2 years ago • 0 comments

The documentation for the version input is wrong with regards to downloading latest version of a universal package.

Current docs:

Specifies the version of the package. Use latest to download the latest version of the package at runtime.

This fails when trying to download a universal package:

- task: DownloadPackage@1
  inputs:
    packageType: upack
    feed: feed
    definition: packagename
    version: latest

C:\hostedtoolcache\windows\ArtifactTool\0.2.304\x64\ArtifactTool.exe universal download [omitted] --package-version latest [omitted]
{"@t":"2024-01-25T13:24:19.5521953Z","@m":"The package version provided is invalid. Universal package versions must be lowercase SemVer 2.0 versions without build metadata. The package version must be under 128 characters, and major/minor/patch must each be less than or equal to 2147483647.","@i":"67cc01dd","@l":"Error","SourceContext":"ArtifactTool.Program","UtcTimestamp":"2024-01-25 13:24:19.552Z"}
##[error]An unexpected error occurred while trying to download the package. Exit code(20) and error({"@t":"2024-01-25T13:24:19.5521953Z","@m":"The package version provided is invalid. Universal package versions must be lowercase SemVer 2.0 versions without build metadata. The package version must be under 128 characters, and major/minor/patch must each be less than or equal to 2147483647.","@i":"67cc01dd","@l":"Error","SourceContext":"ArtifactTool.Program","UtcTimestamp":"2024-01-25 13:24:19.552Z"})

According to docs, the proper way of downloading the latest version of a universal package is to specify --version '*'. This works:

- task: DownloadPackage@1
  inputs:
    packageType: upack
    feed: feed
    definition: packagename
    version: '*'

C:\hostedtoolcache\windows\ArtifactTool\0.2.304\x64\ArtifactTool.exe universal download [omitted] --package-version * [omitted]
{"Version":"0.0.1",[omitted],"PackageSize":316794088}

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

mareklinka avatar Jan 25 '24 13:01 mareklinka