You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Plugins currently have no way of hooking into config. Our config is relatively complex which creates the need for a schema/etc.
Desired solution
Flatten the config store (so it's just dict<string, string>) and provide config:show:index and config:set:index that add key/value
Specification
API changes
bf config:show:index [--key/-k]
Behaviors:
IF a key is specified AND the key exists, it shows that particular key's value
IF a key is specified AND the key does NOT exist, it prints "undefined" [1]
ELSE, when no key is specified, it shows all config (in json)
bf config:set:index --key/-k --value/-v
Behaviors:
IF key and/or value are not specified, return an error. Suggested text: "You must specify both --key and --value".
ELSE key is set to value, regardless of whether the key existed previously. [2]
Storage changes
The store SHOULD be flat
(i.e we'll move from [key: string]: any to [key: string]: string.)
For plugin specific settings (i.e. qnamaker, chatdown, etc.), the pattern SHOULD be <plugin>__<key>[3].
This avoids conflicts with similar setting names (i.e. id, applicationKey, etc.)
Existing CLI commands for qnamaker and telemetry SHOULD use this flat format
Notes
[1]: This is based on the behavior of npm config get asdfasdfasdfasdf. git config --get asdfasdfasdf throws an error. My opinion is that this is the equivalent of a dictionary and many libraries return undefined/null/None when a key doesn't exist, so opting for npm behavior.
[2]: This is different from our behavior with other "lossy" things like file overwrites, but it's consistent with npm/git CLI behaviors.
[3]: This is borrowed from the ASP.NET IConfiguration environment variable parser. I've used it in a few other places (outside of .NET) and really enjoyed it. It avoids the problem of needing to concat names together. (i.e I can do QNAMAKER__IS_RANDOM_SETTING_SET and not QNAMAKER__ISRANDOMSETTINGSET which is more readable and I can still programatically distinguish namespace from just "space" underscores. This will allow us to pull config from env and config file, which will be useful once we start caring more about CI.
Scoping
We probably also need a delete command at a certain point, but we'll scope that out of this change since we want to squeeze it in to 4.6.
Problem
Plugins currently have no way of hooking into config. Our config is relatively complex which creates the need for a schema/etc.
Desired solution
Flatten the config store (so it's just dict<string, string>) and provide config:show:index and config:set:index that add key/value
Specification
API changes
bf config:show:index [--key/-k]bf config:set:index --key/-k --value/-vkeyand/orvalueare not specified, return an error. Suggested text: "You must specify both --key and --value".keyis set tovalue, regardless of whether the key existed previously. [2]Storage changes
[key: string]: anyto[key: string]: string.)<plugin>__<key>[3].id,applicationKey, etc.)Notes
npm config get asdfasdfasdfasdf.git config --get asdfasdfasdfthrows an error. My opinion is that this is the equivalent of a dictionary and many libraries return undefined/null/None when a key doesn't exist, so opting for npm behavior.IConfigurationenvironment variable parser. I've used it in a few other places (outside of .NET) and really enjoyed it. It avoids the problem of needing to concat names together. (i.e I can doQNAMAKER__IS_RANDOM_SETTING_SETand notQNAMAKER__ISRANDOMSETTINGSETwhich is more readable and I can still programatically distinguish namespace from just "space" underscores. This will allow us to pull config from env and config file, which will be useful once we start caring more about CI.Scoping
We probably also need a
deletecommand at a certain point, but we'll scope that out of this change since we want to squeeze it in to 4.6.