coder/registry

Add validation for Template and Module README files

Closed this issue · 2 comments

This is a follow up to these issues/PRs:

When we brought in all the templates that were previously in coder/coder, we never updated any other files. Notably, we never added validation logic to ensure that all the README files were formatted correctly, or had any required content

That already caused a problem when we tried to publish a template under the new Coder Labs namespace.

We can definitely reuse a good amount of the validation logic we have right now. The main thing we need to figure out is, beyond basic README structure validation, is there any specific content that template READMEs should have? For example, module READMEs require an example Terraform snippet so that users can easily bring them in. Should templates have anything similar?

Action steps

  1. Identify what template-specific content (if any) we want to require from template README files
  2. Update validation logic to ensure that templates follow base guidelines for README formatting and have all required content
  3. Update any template files as necessary to match new validation requirements

Update: the lack of validation has already broken CI when trying to rebuild the Registry website

The problem was fixed with #276, but I'm worried it will happen again, and sooner than we'd like

We should validate the template, module, and contributor README.md metadata as part of CI to prevent any malformed ones from merging and breaking CI on the coder/registry-server.