Open ambs opened 3 years ago
@ambs thanks - looks like there's an error to fix.
I fixed the problem. It's not a clean solution yet.
I think you need to decide what to do with the get_debug_config
function.
I suggest it just sets values if they are not present, and therefore, not rewriting anything.
If that seems like a good suggestion, let me know, and I'll prepare such a PR (and we can keep the debug=True option).
@ambs I think updating get_debug_config to just set values if they're not present - would be ok. That way configuration in the config file isn't overwritten, as you point out. However, to update get_debug_config, you might need to update the tests, which use that function. You might need to add a new function to set the correct config for the tests.
@bcail I am happy with that. It might take some more time to prepare a decent patch, but I will try to prepare it. Just so I do not abuse CI, what is the correct way to run the tests locally? Thank you
Take a look at the CI configuration: https://github.com/loris-imageserver/loris/blob/development/.github/workflows/ci.yml. That shows how to set up the environment for running the tests.
by default, the repository has debug enabled, meaning the get_debug_config is called overwriting the user config. That is not nice. Changed by default to false. In the future this can be a configuration flag?
when no config file is set, and debug is false, no configuration is loaded. This causes a lot of errors (namely key not founds). Given the repo includes a config file, added code to load it by default
when using the default config file, warn the user about that
Some details can be made better, but for now, it is working perfectly on my docker environment. I am happy to provide further changes on this branch if you like.