-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
Remove dry-validation
from dependencies
#333
Conversation
3 sounds good to me! |
Here it is, passing the tests as well. I don't have much time now, and nor |
Tests appear to be red on GitHub Actions. It's not immediately clear to me why. Take all the time you need 🙏 |
@cjlarose I took me a while to get my head around this again. But it seems to me that there is no blocker anymore, is there? Also you'd have to reapprove the tests as I had to rebase :/ |
Released with version 5.3.0 |
Follow-up of #317, as I'm not a StuartApp member anymore.
@cjlarose to answer your question:
If think that the issue might be that another version of dry doesn't match this API:
config/lib/config/validation/validate.rb
Lines 15 to 19 in f2b8d2a
Eg the result of calling
validator
may give an object that doesn't quack#success?
nor#errors
(and then#text
for each error).However if we want to be that precise, then I guess that we'd also need to check that the validator is actually a dry object.
I have three solutions in mind:
Config::Validation::Validate#validate!
that ifDry::Validation::VERSION
exist in the codebase it is of correct version. At that point it should be either loaded by user, or it will be checked later by the mechanism introduced in this PRvalidate_using!
method and print out that there might be a dry-validation version errorvalidate!
method if dry-validation is not found or if it isn't the correct version. Error ifConfig.schema
orConfig.validation_contract
was set.I'd go for
3.
. It fails early and has a lower footprint on the codebase.