-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add Schema validator #176
Add Schema validator #176
Conversation
Hey @oleander 👋🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, the PR looks very good to me! Thank you for the contribution! I need to fix the CI on Ruby 2.7. I'll do it this week.
Great, thanks! I'll close the other PR. |
That's what I was afraid of. Rubygems cannot correctly install the transitive dependency https://github.com/bibendi/dip/actions/runs/11915832181/job/33438788176 |
I've limited the versions for |
I ran the CI locally and had to make some adjustments to the versioning. The Ruby 3 constraint was introduced in version 6 of |
Released v8.2.0 |
👋🏾 Hey all This change has caused issues with the dip config in sbmt-pact
It is now affected as sbmt-pact does not pin the version of dip in the CI config Not sure if the schema validator should be allowing those cases, or if the dip config needs to be updated |
Hey Yousaf! |
Fixed at v8.2.1 |
excellent, cheers Misha! - thanks for the extra tip re: skipping validation. (might be nice to have that in the error message, just in case anyone in the future needs to get out of a bind) |
Hello! Is there a particular reason that this schema doesn't support array env values?
If not, can support be added? Thanks! |
Hi! Why do you need array env variables? After all, in the end, the value turns into a string anyway. And for an array, such a conversion does not look unambiguous. |
@bibendi Thanks for the reply. A developer on my team pointed this out to me as well; when we use the value it's coming through as a string, so I suppose we were just using it as syntactic sugar. And all we need to do is add a By the way, this is a great tool and we appreciate all your work. |
This PR introduces JSON schema validator for dip.yml config files to help users catch configuration errors early and ensure their configs follow the expected format.
Key Changes
dip validate
CLI command$schema: https://raw.githubusercontent.com/bibendi/dip/refs/heads/master/schema.json
allows your editor to lint the dip.yml on-the-fly, if configured for it.Features
New
dip validate
Commanddip validate
Schema Support in dip.yml
$schema
property (the URL does not exist until the PR gets merged):Automatic Validation
Testing
Documentation
dip validate
command in README.mdDependencies
json-schema
(~> 5) as a new dependencyChecklist