Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUBED_CONFIG env var is ignored if file/path not found #614

Open
applio opened this issue Nov 8, 2024 · 0 comments
Open

CUBED_CONFIG env var is ignored if file/path not found #614

applio opened this issue Nov 8, 2024 · 0 comments

Comments

@applio
Copy link
Contributor

applio commented Nov 8, 2024

Issue Description:
Incorrectly specifying the location of the config via CUBED_CONFIG does not result in an error and instead is silently ignored, allowing execution to proceed with defaults for the config.

Additional Info:
If the path to the intended YAML config file for Cubed is invalid (i.e. because of a typo or incorrect pathname) in the CUBED_CONFIG environment variable, no warning or error is raised and the user's code may continue successfully with whatever other configuration information is available from defaults or other YAML files discovered by Donfig. This is consistent with the intended behavior described in Donfig's documentation. If a user wishes to run with and only with a particular configuration, specified via the CUBED_CONFIG env var, currently the burden is on the user to add their own explicit check to see that the file/directory specified in CUBED_CONFIG exists and is readable.

Expected Behavior:
If the user follows the encouragement in Cubed's documentation and sets a value for CUBED_CONFIG but it points to something that is not there, a user might reasonably expect feedback about a misconfiguration and that execution would not proceed. Otherwise a user could be fooled into believing their config is used in an execution that does not complain about a problematic value in CUBED_CONFIG.

Observed Behavior:
If CUBED_CONFIG is set to point at a YAML specifying that executor A is to be used but a mistake is made in the pathname for that file, execution may proceed successfully with a different, default executor B (potentially local processes) in some cases.

To Reproduce:
Take one of the examples and specify a config via CUBED_CONFIG to use when executing the example. Validate that it runs successfully to completion. Then modify the value set for CUBED_CONFIG to point elsewhere and execute again -- it will behave as if CUBED_CONFIG had not been set at all. Example invocation where env var is set to point at config:

% CUBED_CONFIG=/home/somebody/dev/cubed/examples/pickone/cubed.yaml python3 examples/add-random.py
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

No branches or pull requests

1 participant