Skip to content

Template validation#44

Draft
sixfeetover wants to merge 2 commits intomasterfrom
template-validation
Draft

Template validation#44
sixfeetover wants to merge 2 commits intomasterfrom
template-validation

Conversation

@sixfeetover
Copy link
Copy Markdown
Member

@sixfeetover sixfeetover commented Sep 15, 2023

This is a very draft-level initial commit of some template validation logic. At this stage, I am mostly pushing the files as a backup, and to trigger discussion.

This uses dry-validation to define a schema for the section of consult.yml that defines individual templates. In the current form, it does not validate the entire consult.yml file.

Goals

  1. Provide visibility into obvious configuration errors (e.g., having no source or destination configured).
  2. Encourage best practice configuration, such as setting a TTL.

Caveats

There are changes in here (bin/consult, as well as the ERB API change in template.rb) that are not related to template validation that I needed to make to get the code to run properly. I have not debugged why.

@aharpervc
Copy link
Copy Markdown
Contributor

I rebased your PR on the latest changes from master, but I forgot to add the parameter to preserve the original author, so now it looks like I wrote the commit. We can fix that before merging though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants