Skip to content
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

HalObjects should never have empty or missing config values if defined in HalConfigurer #107

Open
richteer opened this issue Jan 10, 2018 · 3 comments

Comments

@richteer
Copy link
Contributor

richteer commented Jan 10, 2018

HalConfigurer is useful to set defaults in config.json when used in the CLI, but hand writing config files or an update to a module may lead to missing expected keys. HalConfigurer already sets the defaults for any expected configuration key, so module developers should not have to repeat those defaults throughout their source in various self.config.get() calls.

A potential approach to solving this may be to run HalConfigurer on the blob pulled from config.json prior to loading, so that all missing keys are filled with defaults.

Another approach may be to rework HalConfigurer and config loading slightly so that they communicate better. (e.g. have an accessable table of expected keys/defaults in HalConfigurer parseable by the config loader)

@richteer
Copy link
Contributor Author

richteer commented Oct 1, 2018

This might actually be an easy fix if someone wants to dive into the changes I made in #112 , and branch from there.

The idea should be to validate that conf blob passed in to Halibot core's .load_object() call. It should be able to fill in the default values that are missing from what was hand-written.

@mracine
Copy link
Contributor

mracine commented Oct 7, 2019

I can start looking into this issue if there hasn't been any more progress made recently.

@richteer
Copy link
Contributor Author

HalConfigurer needs a rework in my opinion, you are free to tackle that if you'd like.

That said, any improvement to HalConfigurer is more than welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants