-
Notifications
You must be signed in to change notification settings - Fork 146
[alternative] Support multiple west config files per config level #867
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
base: main
Are you sure you want to change the base?
[alternative] Support multiple west config files per config level #867
Conversation
Perfectly fine for me. I just wanted to show it to you for completeness. |
You could have waited for other opinions! They could still come but it's bit less likely in a closed PR. |
e33851f
to
8f92d18
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #867 +/- ##
==========================================
- Coverage 84.52% 84.48% -0.04%
==========================================
Files 11 11
Lines 3366 3396 +30
==========================================
+ Hits 2845 2869 +24
- Misses 521 527 +6
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I like the simplicity here. A user that sets the environment variable, to change a config file location, already needs to know what they are doing.
Allowing to pass in multiple files is in line with the ConfigParser's functionality.
multiple config files can be specified in the according environment variable for each config level (separated by 'os.pathsep', which is ';' on Windows or ':' otherwise). The config files are applied in the same order as they are specified, whereby values from later files override earlier ones.
8f92d18
to
3c9c122
Compare
This is (another) alternative to PR #849. It is easier to discuss this solution while there is already some implementation existing.
Why?
In a big company there are often shared configs for build system and tooling (e.g., west and its configs).
Those generic configs must be applied first and contain some default or fallback values, if the user does not specify any value in any user config.
Depending on the company and team size, multiple different configs need to be stacked.
Remember, that users must always be able to overwrite values from those generic config files within their config.
Proposed Solution
Multiple config files can be specified in the according environment variable (
WEST_CONFIG_SYSTEM
,WEST_CONFIG_GLOBAL
,WEST_CONFIG_LOCAL
) for each config level (separated by ':').The config files are applied in the same order as they are specified, whereby values from later files override earlier ones.
I personally like configuration through env variables, but I fear you don't.
Nevertheless I have prepared this proposal. Maybe it convinces you.
Note: Maybe this mechanism does not make sense for
WEST_CONFIG_LOCAL
.This could also be combined with the approach from #849, so that multiple configs per config level are supported with a dropin config directory each. This would be the ultimative solution.