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
385 stars 176 forks source link

Enabling partner/community templates contribution #1089

Open rajeshkamal5050 opened 1 year ago

rajeshkamal5050 commented 1 year ago

Enabling partner/community contributions. Contributors could be,

What scaffolding code, projects, validation tools, testing tools/frameworks, system, and pipelines etc. we need to build for enabling them for an easier development, validation, testing, reviewing and publishing of templates.

Since, we already ship default TODO templates with azd and have done all of the above.

@savannahostrowski @weikanglim @jongio @puicchan please feel free to edit/update.

rajeshkamal5050 commented 1 year ago

Other issues around this area,

weikanglim commented 1 year ago

Development

azd init with empty should provide a good-enough starting point for developing a template / azdevifying an existing sample. This includes creation of infra folder and having files with code comments that help describe what is expected, with a link to the official docs for more in-depth topics.

783 and #253

Still room for improvement for templates to introduce concepts of azd.

Validation

We want #1044 that provides static lint analysis for templates. The validation should also generate a report card that can be used at awesome-azd submission time as a self-attestation.

Testing

We probably want to encourage all templates to include CI/CD for testing the template itself. This includes two parts:

  1. Documenting what that might look like (azd provision + deploy with smoke tests)
  2. Adding a template ignore file for avoiding CI / scripts for validating the template to be included in the repository creating. Unfortunately, it looks like GitHub templates don't support an ignore file: https://github.com/orgs/community/discussions/22183

Reviewing

If we can implement CI/CD, the checklist would include the successful run + static lint analysis as initial proof. We still want an awesome-azd admin to deploy the template and review the template itself.

Publishing

We want to start surfacing awesome-azd templates in the CLI. Various ways to do this: which long-term with explosion could look like an actual database, but for starters, we could simply have a template list generated from awesome-azd which azd fetches and caches, or consumes at build-time as we do currently.

savannahostrowski commented 1 year ago

This all looks great. Thanks for digging in here.

Sort of a bummer that there's no template ignore file. I sort of worry about it being a bit confusing if we have artifacts that aren't relevant to the end user included in the templates. Perhaps we could introduce a new directory to the template structure called validation/ or authoring/ or similar and bucket all the files relevant to template creation/testing/validation under there to mitigate the risk of that. We could include a README in that dir that outlines what specifically is in here and why it's included.

Re. publishing, one idea that I had was to get set up with the experimentation framework and run an A/B experiment on azd template show that pulls in the templates as you describe (via some snapshot of awesome-azd; would also be neat to support fuzzy matching for template name searching but that's a different feature request :D) and see how that fares.

savannahostrowski commented 1 year ago

@rajeshkamal5050 When do you think we can continue this investigation/move forward with some of what Wei proposes here?

rajeshkamal5050 commented 1 year ago

Moving to Gallium cc @savannahostrowski

savannahostrowski commented 10 months ago

I think that we have a good start here and I don't think this is as necessary at this time, as may it was several months ago (e.g. with fingerprinting etc. in the works).

I'd propose deprioritizing this in light of other efforts that I think are bigger value add. If we get concrete feedback then we can revisit reprioritizing this.