From 120c0cdecd8aaa231b0e727b1786f64cfb75d8a7 Mon Sep 17 00:00:00 2001 From: David Larsen Date: Fri, 19 Dec 2025 19:25:40 -0500 Subject: [PATCH] Fix: Empty CLI string defaults no longer override env/API config When CLI arguments with empty string defaults (like --dockerfiles) are not explicitly provided by the user, they were incorrectly overwriting non-empty values loaded from environment variables or the Socket Basics API config. The issue was that the check `if arg_value is not None` passed for empty strings, causing `config_dict['dockerfiles'] = ""` to wipe out the value from the dashboard config. Changed the condition to `if arg_value` (truthy check) for non-bool types, so empty string defaults don't override actual config values. This fixes Dockerfile scanning not working when configured via the Socket dashboard, as the `dockerfiles` value was being cleared by the CLI default. --- socket_basics/core/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/socket_basics/core/config.py b/socket_basics/core/config.py index 6b36cb3..55512cf 100644 --- a/socket_basics/core/config.py +++ b/socket_basics/core/config.py @@ -1275,7 +1275,9 @@ def create_config_from_args(args) -> Config: for disabled_param in param['disables']: config_dict[disabled_param] = False - elif param.get('type') != 'bool': + elif param.get('type') != 'bool' and arg_value: + # Only override config for non-bool types if CLI arg has a value + # This prevents empty string defaults from wiping out env/API config config_dict[param_name] = arg_value except Exception as e: logging.getLogger(__name__).warning("Warning: Error processing dynamic CLI args: %s", e)