Replies: 5 comments 1 reply
|
+1 for this proposal. |
Default values in TOML settingsJust like the legacy [kci.whoami]
api = 'early-access'Values defined higher in the hierarchy would be inherited by sub-commands, so this would do the same but also provide a default value for all the [kci]
api = 'early-access'
[kci.special.command]
api = 'something-else'That way, we can drop the implicit 'DEFAULT' section as it will all be based on the |
Secrets in TOML settingsWhile the legacy tools reused the feature of loading default values from the settings to store secrets, this proposal makes a clear distinction between them. One key aspect is that secrets aren't defined as command line arguments any more, so no Instead, a [kci.secrets]
api.early-access.token = 'secret-token-1234abcd'
api.other.token = 'other-secret-token'
storage.staging-azure.credentials = 'some-storage-secret'
storage.local-ssh.credentials = 'some-other-storage-secret'So when using def whoami(config, api, secrets):
configs = kernelci.config.load(config)
api_config = configs['api_configs'][api]
api = kernelci.api.get_api(api_config, secrets.api.token)
data = api.whoami()
click.echo(json.dumps(data, indent=2))From a user point of view, this would work seamlessly: as long as the tokens for these two API configs are present of course. |
Legacy deprecationThe legacy tools and settings file are meant to be deprecated at the same time as the legacy KernelCI infrastructure, so the new |
|
OK this has been reviewed and implemented. Some small things might still need to be tweaked, and the documentation updated but this discussion was to establish the design for TOML settings and that's now done. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Now we have a clearer idea of what features the
kcicommand line tool needs to be able to provide, and we know there are CLI frameworks that can help us implement them easily, here's a proposal for how the TOML settings would work alongside thekcitool. Other tools such as pipeline services should be able to reuse this by importing thekernelci.clipackage.Roadmap issue: kernelci/kernelci-core#2125
All reactions