-
Notifications
You must be signed in to change notification settings - Fork 294
Add an arbitrary separator for plugin keys #1199
Conversation
211bf94
to
8ee7d05
Compare
This separator is arbitrary enough to be unused in a plugin name. 🐢
8ee7d05
to
8ad971e
Compare
@kindermoumoute, could you give some example of plugin that has a I doubt if this change is really needed and if we really want to accept This means inconsistency among others in snapctl command helper:
As a user I would like to follow this given instruction and both suggested ways to unload plugin should work fine. @kindermoumoute, what is your perspective? Is there any plugin which really needs to contain ":" in its name? |
But your question is legit, do we want |
LGTM
If snapctl works in the future the way it does today we will need a rule for it (validating that plugin names don't inlude @kindermoumoute, @IzabellaRaulin, all: How would you feel about the proposal that snapctl takes positional arguments for the type, name and version instead of the formatted string "::". This simplification would also allow the removal of the switches |
It would make sense, and we could still use advanced format like: $ snapctl plugin unload publisher file 3
$ snapctl plugin unload processor "my processor" 1 (supposing we want to allow spaces in plugin name) |
I'm curious how does this behave for the rest API? |
I believe the API takes in separate named args for type/name/version and the separator isn't involved until you get into control. |
I meant what happens when we try the following if we allow spaces or slashes in plugin name like 'my processor' or 'my/processor', I think we will just have to URL encode them:
|
It would require that we url decode the name param (QueryUnescape) in the REST server. I tested adding the ability to handle spaces 👉 jcooklin@da40fd0. I'll open an issue and PR against it tomorrow. |
It's good to have the flexibility on the namespace separator. I have a couple of questions:
|
@kindermoumoute, @jcooklin, all - I really like the idea that core.Separator is defined and used instead of hardcoded @kindermoumoute, I asked before:
So, it seems that there is no really use case that some plugin really needs to be named in that way. ProposalBased on that, my suggestion is:
Reason
|
Having the separator as simple as
I don't see an obvious case where plugin authors would need to worry themselves with
I would argue from the other side. Why not allow spaces? Allowing it is trivial. Most of this comes down to balancing being flexible (user and plugin author friendly) while putting up reasonable restrictions and rules. However this shakes out we need a separate issue and PR that will validate plugin names. I'm suggesting
|
I can see the benefit of this PR set the key separator as a variable in one place instead of many files so that it can change quickly in the future. If no user requested to have spaces for a plugin name, I vote not to deal with it for Snap 1.0. Positioning probably is the better solution as @jcooklin said. We use positions now anyway. |
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
Fixes #1198
Summary of changes:
core.Separator
.:
was used as a separator for the plugin keys, the character has been changer bycore.Separator
.Testing done:
:
character in the name.snapctl plugin list
.snapctl plugin unload -t <type> -n <name> -v <version>
.@intelsdi-x/snap-maintainers
This separator is arbitrary enough to be unused in a plugin name. 🐢