Load AppConfig at runtime and wire logging into CLI & API#158
Merged
aidankhogg merged 1 commit intoJun 29, 2026
Merged
Conversation
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.
Motivation
AppConfigfile or viaNETENGINE_CONFIGrather than scattered env/defaults.Description
netengine/config/runtime.pywith helpers:load_app_config,configure_logging, andload_runtime_configthat useConfigLoader.load_config(AppConfig, ...)and mapAppConfig.loggingto the existingLoggerFactoryvia a generatedRuntimeLogConfigclass.--configoption (envvarNETENGINE_CONFIG) which callsload_runtime_config(config_file)during CLI startup.load_runtime_config()at FastAPI import time innetengine/api/app.pyso the API process applies the same logging defaults.tests/test_config.pyto verify a minimal runtime config file applies logging defaults and that the CLI--configoption passes runtime logging settings to the logger factory.Testing
python -m ruff check netengine/config/runtime.py netengine/api/app.py netengine/cli/main.py tests/test_config.pyand it passed.pytest -q tests/test_config.py tests/test_cli.py::test_poetry_console_script_points_to_click_groupand the tests passed.pytest -q tests/test_cli.pyand all tests passed; full test run showed47 passedfor the combined runs including the new tests.Codex Task