Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
416 stars 204 forks source link

[Issue] azd init should ignore some files #4142

Open jongio opened 4 months ago

jongio commented 4 months ago

When a user runs azd init it copies all files from the repo. Sometimes we don't want that.

The template author may want a CONTRIBUTING.md file in the repo or a file in the .github folder for the template authoring experience. But doesn't want the user to have that file when they are using the template.

Examples of files that we don't want to be copied when initialization a template, but should be in the repo. https://github.com/Azure-Samples/agent-openai-python-prompty/blob/main/CONTRIBUTING.md https://github.com/Azure-Samples/agent-openai-python-prompty/blob/main/CHANGELOG.md https://github.com/Azure-Samples/agent-openai-python-prompty/blob/main/.github/CODE_OF_CONDUCT.md https://github.com/Azure-Samples/agent-openai-python-prompty/blob/main/.github/workflows/azure-dev-validation.yaml

Suggestion:

Add a .azdignore file to the root of the repo that contains files/paths that azd should ignore during the init.

vhvb1989 commented 4 months ago

What about git clone , a codespace or manual donwload? There would be an inconsistency between acquiring templates with azd init v/s other acquisition methods.

Here's an alternative:

A strategy like this would enable folks to start a codespace from the azd-template branch to use and own the template, or from main branch to contribute to the template itself (like updating the .azdignore files)

jongio commented 4 months ago

As a template author I do not want to manage two different branches - too much overhead.

wbreza commented 4 months ago

We can only control how azd itself acquires templates. I think this feature would be helpful for template authors that want to exclude files during the azd init process.

We know if developers manually acquire the template that the azd ignore file will not be processed. One other idea is that any additional azd init call on a template after clone will check for the existence of the file and clean any effected files.

rajeshkamal5050 commented 1 month ago

Seeing that PR #4146 is closed in favor of PR #4258 and its corresponding issues #1039 #4215. Marking this issue as not planned. Feel free to open if you think otherwise @jongio

jongio commented 1 month ago

@rajeshkamal5050 - This is a different issue. The ones you referenced are "ignore files during packaging". This one is for "ignore files during init". The description of this issue is still a good reference for the desire there.