Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
383 stars 1.24k forks source link

Error in file detection, message shown for overwriting file just created #1498

Open JamesEarle opened 4 years ago

JamesEarle commented 4 years ago

In creation of a pipeline you receive a message that says

"A yaml file azure-pipelines.yml already exist in the repository root"

This is the azure-pipelines file we just created. This message shouldn't be shown when we are using a file we just created.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

yonzhan commented 4 years ago

pipelines

geverghe commented 4 years ago

@JamesEarle - could you provide some more information on your scenario and expectation? Did you create an Azure Pipelines yaml file and then run az pipelines create command? Or are you running az pipelines create a second time? If you are running az pipelines create for the first time in a repo where a pipeline yaml does not exist, you will not get this message.

In az pipelines create command, during repo analysis, we check if there is an existing pipeline where the check is based on availability of an azure-pipelines.yml file in the repo. If available, you will see the option of re-using this pipeline. If you proceed to create a new pipeline, we go ahead and create a pipeline with the name azure-pipelines.yml and prior to commit we check for potential conflict. This is when we give the warning, in case of conflict, that a yaml file with the same name already exists in the repo and that you might want to change name.

JamesEarle commented 4 years ago

@geverghe I followed the instructions in the document and saw that when I'm creating a pipeline after changing the existing file name, I still receive an error that the azure-pipelines.yml file still exists, which indicated to me that this must be the file we are creating or just created.

This is not the first time I am running this command, but I have experienced this message each time I have run it.

The command I ran is

az pipelines create --name "my-pipeline-cli" -p arm-deploy --repository arm-deploy --repository-type tfsgit --branch master

I ran this from the arm-deploy directory after I had renamed the azure-pipelines.yml to azure-pipelines-orig.yml so no file is conflicting.

image

In the interactive dialog I chose the Node.js pipeline template and the option to proceed with the default generated template. This is when I receive the message.

image

I tried again just a moment ago and confirmed that I'm receiving this message still without the existence of an azure-pipelines.yml file.

Let me know if I can provide any other helpful information.

ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @narula0781, @ashishonce, @romil07.