azure-devops-cli-extension icon indicating copy to clipboard operation
azure-devops-cli-extension copied to clipboard

[Feature Request] `az pipelines release create` Expose an parameter to specify instanceReference.name

Open idear1203 opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I cannot create a project..

Issued code: https://github.com/Azure/azure-devops-cli-extension/blob/2bd72a1d76cc00a84b348f573e9f8e14dfb42c5b/azure-devops/azext_devops/dev/pipelines/release.py#L47

Currently, we can only specify version_id though --artifact-metadata-list but we cannot specify name. And the payload looks like below:

{"artifacts": [{"alias": "SomeAlias", "instanceReference": {"id": "1234567"}}], "definitionId": 123}

This leads to ugly release run name - usually we have a build number in the release name but the release triggerred from CLI doesn't have such build number. Snapshot is as below. The first release run is submitted through portal and its name contains a build number (the redacted part). However, the second release run sumitted through az pipelins release create doesn't contain build number part.

image

Our release pipeline has a "Release name format" setting as below:

New Release Train -$(Build.BuildNumber)-$(rev:r)

Describe the solution you'd like A clear and concise description of what you want to happen. e.g. If you want a new command to be added, what would it do?

The command should expose some parameter that allows me to pass instanceReference.name so that the following payload can be constructed:

{"artifacts": [{"alias": "SomeAlias", "instanceReference": {"id": "1234567","name":"someBuildNumber"}}], "definitionId": 123}

Additional context Add any other context or screenshots about the feature request here.

idear1203 avatar Mar 04 '22 07:03 idear1203

Any news about this item? We have the same problem where the release names aren't created correctly. So without that, this is pretty useless.

az pipelines release create --artifact-metadata-list build=$BUILDID config=$CONFIGID --org $ORGANISATION --project $PROJECT --definition-id $RELEASE_DEFINITIONID

image

However, when you don't specify for example the primary artifact (build in our case), it uses the latest buildId version, and then the release name is created perfectly:

az pipelines release create --artifact-metadata-list config=$CONFIGID --org $ORGANISATION --project $PROJECT --definition-id $RELEASE_DEFINITIONID

image

jeffvannijlen avatar Feb 28 '23 08:02 jeffvannijlen

I too would like to use this command so that I can create a useable release.

aarondandy avatar Oct 02 '23 19:10 aarondandy