Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] azd init should ignore some files #4142

Open
jongio opened this issue Jul 24, 2024 · 5 comments
Open

[Issue] azd init should ignore some files #4142

jongio opened this issue Jul 24, 2024 · 5 comments

Comments

@jongio
Copy link
Member

jongio commented Jul 24, 2024

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
Copy link
Member

vhvb1989 commented Jul 25, 2024

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:

  • Create a branch-name convention (similar to the gh-pages convention).
    • Tell users they can publish a branch named azd-template
    • When azd init runs, it will check if azd-template branch exists and if yes, will use that branch instead of main branch
    • Template author can then lock an azd-template ready version and keep working/making changes on main.
    • We can create gh-action for publishing the azd-template branch and use the .azdignore for it.

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
Copy link
Member Author

jongio commented Jul 25, 2024

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

@wbreza
Copy link
Contributor

wbreza commented Jul 26, 2024

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
Copy link
Contributor

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

@rajeshkamal5050 rajeshkamal5050 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
@jongio
Copy link
Member Author

jongio commented Oct 4, 2024

@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.

@jongio jongio reopened this Oct 4, 2024
@rajeshkamal5050 rajeshkamal5050 modified the milestones: Sep 2024, Backlog Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants