-
Notifications
You must be signed in to change notification settings - Fork 44
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
Switch from config init to BaseSettings #226
Switch from config init to BaseSettings #226
Conversation
Codecov Report
@@ Coverage Diff @@
## master #226 +/- ##
=======================================
Coverage 87.11% 87.11%
=======================================
Files 43 43
Lines 1862 1862
=======================================
Hits 1622 1622
Misses 240 240
Continue to review full report at Codecov.
|
Ok, this looks like it works. I've got to add some tests in the morning. |
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.
Look's great!
I know this is still WIP, I was just curious to see how this was done, and added some comments along the way.
The tests look a bit mangled at this point, but I guess that aligns well with your last comment 👍
Thanks for this @shyamd, this is certainly better than our current system! |
Co-Authored-By: Casper Welzel Andersen <[email protected]>
One of the two of you has to review for the merging to become unblocked btw. |
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 work @shyamd, thanks. This definitely simplifies the config and has caught a few other bugs.
I'm happy to approve this as is, my only minor comment is whether you think it makes sense for the example_config file to contain the defaults only? I know it's not much of an ask, but the only other way to see the defaults is to check the code.
We should definitely do a 0.8 release after this (or at least soon).
@@ -0,0 +1,37 @@ | |||
{ | |||
"debug": false, | |||
"use_real_mongo": true, |
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 get that this is just an example config, but does it make more sense for this file to contain the default values?
"use_real_mongo": true, | |
"use_real_mongo": false, |
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'm sorta back and forth on this issue. Part of me agrees with you and part of me wants a more real-world example. Obviously we can't make the defaults real-world example as we want it to just run as-is.
Perhaps we could include the default config elsewhere? |
Good idea. I've added that for now. The next big PR might be official docs of some sort since there is enough complexity now that they are needed. |
Great, agreed. I'm happy to help with that as its quite a big task, we have an issue at #176 to start tracking this if we want to delegate the work. |
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 think this should have been squashed in some way - 53 commits is a bit of an extensive addition to the history for a single PR... |
Closes #152
This is going to be a complicated PR since this
SeverConfig
object is spiderwebed all over the server module. The goal is to swtich toBaseSettings
which will make using this as a standalone server given a mongoDB much easier