-
Notifications
You must be signed in to change notification settings - Fork 7
feat: added config checks #310
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
Conversation
|
@race-of-sloths please, include my PR in the Race |
|
@frolvanya Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: executed
The average score is 2 @frolvanya check out your results on the Race of Sloths Leaderboard! and in the profile What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
kobayurii
left a comment
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.
I don't think it's the best solution to write new functions for field deserialization and validation every time. Please consider using a third-party crate, for example serde_valid.
@kobayurii Yep, I thought about this and I'm also not a big fan of code duplication. However, I faced few issues, maybe I'm doing something wrong. The P.S: or we need to come up with the custom implementation of validation function and we'll basically end up with the same state of code + a little overhead, because we used an extra crate P.S2: + we also need to come up with a custom validation for URLs, because basic |
I gave you |
Oh, I knew only about |
|
I rewrote validation to use
P.S: @kobayurii Thanks for sharing such powerful crate with me! It might become handy in my pet projects |
|
@race-of-sloths score 2
In such dangerous situations, I'd prefer to panic. As for the second part of your question, let's keep "pretty unreadable" for now. We'll get back to it if we realize it's a real issue for us. |
🌟 Score recorded!@khorolets, thank you for scoring this pull request in the Race of Sloths! |
khorolets
left a comment
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.
Great job, I left a few minor comments and approve 👍
kobayurii
left a comment
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.
Great! I left a one comment and approve 👍
|
I've fixed everything. As I see both of you approved the PR, so I'll merge it |
✅ PR is finalized!Your contribution is much appreciated with a final score of 2! Another weekly streak completed, well done @frolvanya! To keep your weekly streak and get another bonus make pull request next week! Looking forward to see you in race-of-sloths |
* feat: added checks for config variables * refactor: used `validator` crate for config validation * chore: simplified formatting * chore: reordered imports * feat: panic on error instead of logging * chore: provided better message error
* feat: added checks for config variables * refactor: used `validator` crate for config validation * chore: simplified formatting * chore: reordered imports * feat: panic on error instead of logging * chore: provided better message error
* feat: added checks for config variables * refactor: used `validator` crate for config validation * chore: simplified formatting * chore: reordered imports * feat: panic on error instead of logging * chore: provided better message error
* feat: added checks for config variables * refactor: used `validator` crate for config validation * chore: simplified formatting * chore: reordered imports * feat: panic on error instead of logging * chore: provided better message error
* feat: added checks for config variables * refactor: used `validator` crate for config validation * chore: simplified formatting * chore: reordered imports * feat: panic on error instead of logging * chore: provided better message error


This PR introduces additional validation checks for certain configuration variables. Specifically, it ensures that all URLs and
f64values adhere to their expected formats and constraintsHere's an example of running rpc-server with invalid env variables:
