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

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

Open oliverholliday opened this issue 4 years ago • 1 comments

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

oliverholliday avatar Jun 11 '20 07:06 oliverholliday

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.

bt701 avatar May 03 '24 07:05 bt701