Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
628 stars 241 forks source link

[Bug] az pipelines variable delete does not work with —variable-name #1043

Open carlosonunez opened 4 years ago

carlosonunez commented 4 years ago

Describe the bug Running:

$: az pipelines variable delete —pipeline-name “foo” —name “var_name” # rest of parameters

does not work. However, running:

$: az pipelines variable delete —pipeline-id $id —name “var_name” # rest of parameters

does. This works as intended when one runs az pipelines variable create.

—pipeline-name seems to be a supported parameter when running az pipelines variable delete —help.

Upon looking at —debug, it seems that the client tries to do this:

DEBUG: urllib3.connectionpool: https://dev.azure.com:443 “GET /org_name/project_name/_apis/build/Definitions?name=foo

instead of this

DEBUG: urllib3.connectionpool: https://dev.azure.com:443 “GET /org_name/project_name/_apis/build/Definitions/$id?name=foo

To Reproduce Azure Cli Version: 2.8.0

Azure-Devops extension version: 0.18.0

Steps to reproduce the behavior:

  1. Create a pipeline; doesn’t matter how.
  2. Create a variable: AZURE_DEVOPS_EXT_PAT=pat az pipelines variable create —name foo —project project —org https://dev.azure.com/org —pipeline-name pipeline —value bar
  3. Delete that variable: AZURE_DEVOPS_EXT_PAT=pat az pipelines variable delete —name foo —project project —org https://dev.azure.com/org —pipeline-name pipeline

Expected behavior

The variable should get deleted.

daughey commented 10 months ago

I suspect this has been overlooked given the time from it being logged until now. It's still happening in 0.26.0. Any estimate on when it might be fixed? Or at the very least, when the documentation could be updated to remove the --pipeline-name parameter?