Skip to content

fix(config_loader): crash when CRUNCH_CONFIG_MODULE is set but fails to load#59

Open
philippWassibauer wants to merge 1 commit into
mainfrom
fix/fail-hard-on-broken-config
Open

fix(config_loader): crash when CRUNCH_CONFIG_MODULE is set but fails to load#59
philippWassibauer wants to merge 1 commit into
mainfrom
fix/fail-hard-on-broken-config

Conversation

@philippWassibauer

Copy link
Copy Markdown
Contributor

Problem

When CRUNCH_CONFIG_MODULE is 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 raises RuntimeError on failure (added recently), but the explicit env var path was still silently falling back.

Fix

If CRUNCH_CONFIG_MODULE is set but fails to load (broken or not found), raise RuntimeError immediately — same as the operator config path.

Tests

  • test_resolve_config_raises_when_env_var_set_but_broken — module found but instantiation fails
  • test_resolve_config_raises_when_env_var_module_not_found — module doesn't exist at all
  • Fixed existing tests to explicitly clear CRUNCH_CONFIG_MODULE (conftest sets it globally)
  • 746 tests pass, 0 regressions

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant