Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template validation #44

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Template validation #44

wants to merge 2 commits into from

Conversation

sixfeetover
Copy link
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
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