Remove dry-validation from dependencies#333
Merged
cjlarose merged 6 commits intorubyconfig:masterfrom Mar 2, 2024
Merged
Conversation
Member
3 sounds good to me! |
Contributor
Author
|
Here it is, passing the tests as well. I don't have much time now, and nor |
Member
|
Tests appear to be red on GitHub Actions. It's not immediately clear to me why. Take all the time you need 🙏 |
Member
Contributor
Author
|
@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 :/ |
cjlarose
approved these changes
Mar 2, 2024
Member
|
Released with version 5.3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
validatormay give an object that doesn't quack#success?nor#errors(and then#textfor 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::VERSIONexist 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.schemaorConfig.validation_contractwas set.I'd go for
3.. It fails early and has a lower footprint on the codebase.