Skip to content

Support az artifacts universal list command #30488

@larstobi

Description

@larstobi

Related command
The current az artifacts universal group only supports the download and publish commands.

❯ az artifacts universal --help

Group
    az artifacts universal : Manage Universal Packages.

Commands:
    download : Download a package.
    publish  : Publish a package to a feed.

Is your feature request related to a problem? Please describe.

When using Azure Pipelines, we often want to know if a package version exists in Azure Artifacts, either before downloading it or before publishing a new package. Trying to download a non-existent package version fails, and trying to publish an existing package version also fails.

It is possible to handle download failure in scripts, which is okay, but if what we want to do is publish a version using the UniversalPackage@0 task, and it already then that task will fail.

We have to rely on handling publish failure, instead of testing whether the version exists before publishing the version. When trying to download a package version, we have to rely on handling download failure if a version does not exist.

Describe the solution you'd like

I suggest implementing a command called az artifacts universal list that will take a package name as a parameter, and will list zero or more versions. It could potentially use the same API as the web interface that lets us list package versions. The list command could also support a parameter that only returns the selected (latest) version, just like the web ui does.

Describe alternatives you've considered

When publishing a new package version using the UniversalPackage@0 task, we have a solution where we attempt to download the artifact in a script before publishing it, and if the download was successful, then we don't publish a new version, but if the download failed, then we publish a new version. This is method is wasteful of pipeline agent's runtime, compute resources and developers' waiting time.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Artifactsaz artifactsAuto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.act-observability-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions