-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(devmanual): add section about system config key conventions #13238
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: master
Are you sure you want to change the base?
feat(devmanual): add section about system config key conventions #13238
Conversation
Signed-off-by: Christoph Wurst <[email protected]>
Signed-off-by: Christoph Wurst <[email protected]>
|
||
For consistency there are conventions for config keys: | ||
|
||
* System config keys should only contain lower case letters, numbers and `_`. This ensures that they can be used as environment variables. |
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.
* System config keys should only contain lower case letters, numbers and `_`. This ensures that they can be used as environment variables. | |
* System config keys should only contain lower case letters, numbers and ``_``. This ensures that they can be used as environment variables. |
Did you mean to make it code?
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.
I like bikes and sheds.
@ChristophWurst should we add a workflow to server that ensures the consistency after merging the doc here? |
I was thinking that we can update the phpdoc and see if psalm can help us. It will also make sense to find a mechanism for key aliases, so we can phase out the unconventional keys without hard breakages |
Signed-off-by: Christoph Wurst <[email protected]>
Maybe some kind of sysconfig lexicon that allows configure aliases
|
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.
Looks good.
Only thing one could argue would be to use __
instead of _
to separate subsystem and key, to not confuse with separating words. E.g.:
localstorage_umask
localstorage_unlink_on_truncate
VS
localstorage__umask
localstorage__unlink_on_truncate
Yes, thought the same but this would mean even more changes to config keys, so I wouls argue it is better to leave it like it is currently with one separator... |
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.
LGTM
Yes, it makes sense, but at the same time I'm with @szaimen that it means we have to change even more keys. Additionally, I have not worked with any other systems so far that would use double underscore, so it seems a bit unusual to do. |
That sounds like a good idea. |
We can also have old system for old keys. I had the thought yesterday already that we could allow |
|
We would not have to change them if they work. Kind of legacy dept. My biggest problem with the environment config is that it does not allow scoped configuration, where we use arrays. 'redis.cluster' => [
'seeds' => [
'localhost:7000',
'localhost:7001',
],
'timeout' => 0.0,
], |
Well for me the main question is: |
@susnux so that example would translate to this NC_REDIS_CLUSTER__SEEDS__0=localhost:7000
NC_REDIS_CLUSTER__SEEDS__1=localhost:7001
NC_REDIS_CLUSTER__TIMEOUT=0.0 right?
I'd say it's a good thing to allow it. It's very useful in container setups. |
The bigger question with arrays is how replacing works. Let's say file has: "log.condition": {
"apps": {
"1": "admin_audit",
"50": "calendar-appointments",
"51": "appointments",
"52": "calendar",
"200": "spreed-bfp",
"501": "imaginary"
}
}, would: NC_log_condition__apps__0=perf_debug result in: "log.condition": {
"apps": {
"0": "perf_debug"
}
}, or: "log.condition": {
"apps": {
"0": "perf_debug",
"1": "admin_audit",
"50": "calendar-appointments",
"51": "appointments",
"52": "calendar",
"200": "spreed-bfp",
"501": "imaginary"
}
}, if the later, how could env be used to unset one key? |
Probably the second one, because of this:
|
☑️ Resolves
🖼️ Screenshots