fix(config_loader): crash when CRUNCH_CONFIG_MODULE is set but fails to load#59
Open
philippWassibauer wants to merge 1 commit into
Open
fix(config_loader): crash when CRUNCH_CONFIG_MODULE is set but fails to load#59philippWassibauer wants to merge 1 commit into
philippWassibauer wants to merge 1 commit into
Conversation
…to load Previously, if CRUNCH_CONFIG_MODULE was set but the module was broken or missing, the loader would log a warning and try fallbacks — potentially running with wrong defaults silently. Now raises RuntimeError immediately, matching the existing behavior for broken operator configs at config.crunch_config.
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.
Problem
When
CRUNCH_CONFIG_MODULEis set but the module is broken or missing, the loader logs a warning and tries fallbacks — potentially running with completely wrong defaults silently.The operator-config path (
config.crunch_config) already raisesRuntimeErroron failure (added recently), but the explicit env var path was still silently falling back.Fix
If
CRUNCH_CONFIG_MODULEis set but fails to load (broken or not found), raiseRuntimeErrorimmediately — same as the operator config path.Tests
test_resolve_config_raises_when_env_var_set_but_broken— module found but instantiation failstest_resolve_config_raises_when_env_var_module_not_found— module doesn't exist at allCRUNCH_CONFIG_MODULE(conftest sets it globally)