blue-build / cli

BlueBuild's command line program that builds custom Fedora Atomic images based on your recipe.yml
https://blue-build.org/
Apache License 2.0
71 stars 9 forks source link

Add option for checking receipe format #210

Open arejula27 opened 2 months ago

arejula27 commented 2 months ago

Sometimes the gh action takes 5 minutes and then fails because of a wrong recipe format. This rating time can be avoided by adding a static checker before running everything, also users can use it locally as a githook so they never commit a wrong receipe

xynydev commented 2 months ago

This is planned, we'll have JSONSchema validation, the schema repo is here: https://github.com/blue-build/schema This will also support validation inside your code editor, if it supports YAML LSP.

arejula27 commented 2 months ago

I was thinking also to add a version field, similar to kubernetes files, where the first line says which version uses the file

xynydev commented 2 months ago

Since a standard comment line linking the schema is needed for LSP support, I thought that that could also encode the recipe format version: # yaml-language-server: $schema=https://schema.blue-build.org/recipe-v1.json ^ that is the line I'm using currently for testing

180 is where we're planning recipe v2 and we'll probably roll out the schema validation at the same time as that.