feat: set arbitrary plugin config value at cli #1347
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Doing a bit of spit balling.
We previously addressed the need for supplying configuration to plugins with the
--plugin-config
flag to load a yaml file intosettings
for use by plugins. We've found this feature to be quite helpful, especially in the case of loading multiple plugins (i.e. resolvers) that each require their own configuration. However, we have also found that it would be handy to be able to set or modify these values from the command line. So instead of having to modify theplugin_config.yml
you're using to load the universal resolver plugin to point it to a different resolver instance, we could have a command line argument like the following:Or perhaps a short form of:
With such a command line argument, we propose that dotted key values act as a shorthand for nesting values. For example,
a.b.c.d=value
becomes{"a": {"b": {"c": {"d": "value"}}}}
. We also propose that the value be loaded as yaml to avoid parsing ourselves while still allowing us to express values more complicated than just strings and numbers.Open to thoughts 🙂