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
617 stars 239 forks source link

[Bug] az pipelines [create|list] --folder-path is inconsistent in how it handles forward slashes #1016

Open oliverholliday opened 4 years ago

oliverholliday commented 4 years ago

When creating a pipeline the --folder-path parameter will sanitise / into \ and create the pipeline at the expected path.

When listing pipelines the --folder-path does not sanitise the path separators and returns no results if you use /.

I think this is confusing.

To Reproduce azure-cli 2.7.0 azure-devops 0.18.0

PS > az pipelines create --folder-path "pipeline/folder" --name "test" PS > Successfully created a pipeline with Name: test, Id: 420.

PS > az pipelines list --folder-path "pipeline/folder" -o tsv [No Output] PS > az pipelines list --folder-path "pipeline\folder" -o tsv test

Expected behavior

PS > az pipelines create --folder-path "pipeline/folder" --name "test" Successfully created a pipeline with Name: test, Id: 420.

PS > az pipelines list --folder-path "pipeline/folder" -o tsv test PS > az pipelines list --folder-path "pipeline\folder" -o tsv test

bt701 commented 1 month ago

I just hit this when using az pipelines list to search for things in scripts.

Annoyingly --folder-path and --name, must be supplied seperately, so when I wanted to find it, I thought hey I can call basename and dirname in bash, and just split it out. Which results in nothing, as now I need to convert to windows paths to have az pipelines list work.

I suspect it's not very much a high priority issue to resolve, but doesn't still exist for those who stumble upon this later.