Open noelmcloughlin opened 3 years ago
@myii regarding Dhall. There is overlap with cue: https://github.com/cuelang/cue/discussions/669#discussioncomment-306811
My PR is to introduce basic Schema support without forcing cue. The help I need from you is to update your CI/CD image to install Cuelang (and Dhall perhaps). A basic pipeline job can check yaml against schema.cue
schema (its only 1% coverage because I just wanted to showcase the possibility). The code footprint is tiny - one file.
A Dhall footprint could be introduced in different PR but neither dhall or cue should be forced.
Overview
There is no Data Constraints languages used in Saltstack formulas. If these were used, as part of CI/CD, then it would help formula developers, and provide example of how users could add/introduce data validation themselves. A related issue, is that no saltstack formula has a published schema, except what is available in README, pillar.example, etc.
To start a discussion I would suggest using Cuelang (https://cuelang.org/docs/install) to address three concerns:
DEMO
install cuelang from https://cuelang.org/docs/install/
goto a directory with YAML files
create a Schema file named
schema.cue
in this directory.Make a change to some YAML file to introduce a bad value.
Validate against schema data-constraints (
cue vet FILE.yaml schema.cue
)Fix the error in your YAML and try again.
Related issues
Salt project: https://github.com/saltstack/salt/issues/54193