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
[Plugins, Options] Standardize PluginOpt names to use dashes #3636
[Plugins, Options] Standardize PluginOpt names to use dashes #3636
Conversation
This commit standardizes the use of dashes/hypens (`-`) for the names of PluginOpts. This is done to conform with argparse formatting so that the formating of options names is consistent across sos global options, component options, and now plugin options. For example, the `networking` plugin's `namespace_pattern` option is now `namespace-pattern` and should now be specified via the `--plugin-option networking.namespace-pattern=foo` syntax. Similarly, developers will now need to use `Plugin.get_option('namespace-pattern')` in order to reference it. Note that the use of global options within plugins (for example `--all-logs`) is unchanged, meaning that users will continue to use `--all-logs` and due to how these options get stored, developers would still use `Plugin.get_option('all_logs')`. Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
As mentioned, this is done purely to create a consistent CLI experience for users, and I landed on converting to dashes from underscores rather than the other way around simply because our "top level" CLI options that are handled by argparse are exclusively dashes. Happy to hear any arguments for moving the other way, though that would be a much larger shift. The handling of global options that affect plugins (e.g. |
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'm on par with that, make all the things consistent
Note to self: after merging, update the contributions guideline to include a line about this. |
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.
Ack, though we shall (how?) warn users about the plugin opts syntax change.
Cc @mhradile for awareness.
Release notes are the standard track for that. We can make sure to be loud about it. |
This commit standardizes the use of dashes/hypens (
-
) for the names of PluginOpts. This is done to conform with argparse formatting so that the formating of options names is consistent across sos global options, component options, and now plugin options.For example, the
networking
plugin'snamespace_pattern
option is nownamespace-pattern
and should now be specified via the--plugin-option networking.namespace-pattern=foo
syntax. Similarly, developers will now need to usePlugin.get_option('namespace-pattern')
in order to reference it.Note that the use of global options within plugins (for example
--all-logs
) is unchanged, meaning that users will continue to use--all-logs
and due to how these options get stored, developers would still usePlugin.get_option('all_logs')
.Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines