-
Notifications
You must be signed in to change notification settings - Fork 263
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
Supporting extending all command groups? #827
Comments
@navidshaikh and @rhuss and others, please chime in here with any opinions and changes on what this feature should look like. My goal is to update description with any sensible suggestion(s) and open a vote in about 24 hours. We will keep vote open for about the same (24 hours) and if we are a go, I commit to implement this feature thereafter. It’s tricky but doable and know how to approach it based on #818. Thanks for your attention and opinion on this. —— |
@sixolet @cppforlife @duglin @jchesterpivotal @daisy-ycguo and others who might not have seen this and have been part of this project early on, please chime in your opinion on this or wait for vote. Thanks 🙏🏽 |
/assign @maximilien |
IMO, we should allow a plugin to extend command groups and bring its own leaf commands as long as they don't collide with kn's own commands. No for use case 2 to override kn's (leaf or group) commands with plugins, this could bring uncertainty. |
OK thanks for chiming in @navidshaikh. I certainly like this better. Let's see what others say and I will update. Best. |
For me, it is clear that we must not allow use case 2, i.e. no leaf command can be overridden. If some plugin author feels the need to do things differently than the builtin kn commands, then he should name his plugin individually (like 'kn-service-mycreate'). For use case 1, I'm all in for not applying any restriction to add new commands to existing command groups at any level. My arguments are:
|
OK so based on the current feedback. Seems like the consensus is to only allow use case #1. I repeat and refine it here in the least amount of text as I could. Polll: allow any plugin to extend any command group. Please vote with 👍 if you are in favour of this suggestion, and 👎 if not. This extension implies core groups (where "core" needs to be defined), e.g., There are some details that we also need to agree on, I am listing here but these can be refined as needed. They are:
Please vote 👍 or 👎 here until about 24 hours. Simple majority wins. Only vote on this comment. |
[Updated the description above to clarify what the poll is about, so the comments here are about the options given above]
For option 1 to decide, what is the definition of "core" extension ? When two conflicting plugins introduce the same command group, which one 'wins' ? What should be voted for when neither 1. or 2. is appropriate ? (2 I guess)
You mean when you have two plugins with the exact same name? Well, what happens if you have two executables called 'kn' ? Then one first in path wins. I suggest the same is true for plugins. Feels very natural for me. The other question is when you have two plugins which hook in into different levels of the command hierarchy. (e.g. |
Regardless what, my vote is for no restriction at all except for an exact clash to a core command (like |
@maximilien I added some additional explanation to your poll description. Please check whether this appropriate and reflects your thoughts. |
@maximilien ok, but please let me just add this one thought/question (also posted to slack): Why is the kn user-experience protected when using a I'm with you that we definitely should strive for a coherent UX, kn combined with plugins. But for me this is more about how to name and model options so that for a casual user it is indistingushable whether she is using a plugin or a core command. IMO that is the perfect user experience, without any UI break. Forcing plugins into the top-level leads to strange names and groupings. Maybe we should craft some kind of Turing test to let user guess whether a feature is a plugin or built-in :-) ? Therefore I'm currently rewriting our CLI conventions guide with detailed instructions on how to model flags for different types (scalar, list, map, binary, ...). This guide should then be applied for plugin UI as well. You can expect a PR today. |
If we allow extension of any group, we should not allow to convert a leaf-command to a command group because of a plugin. E.g. a |
OK looks like people want to have use case 1. That is allow plugins to extend a core command group so long as the user sets So a user that has this feature set in their configuration can add a plugin named By —- |
From Slack discussion, to document my view for posterity, especially since I am in the minority and I lost this vote: —— Meaning If kn becomes super successful, I venture to guess that few users would want to extend core command group. And even in the event they do, we, as a core WG, would invite them to participate and do that extension as part of the core. Especially if its a great idea. Plus we would always want to expand the WG with contributors so inviting them would make sense. Therefore, discouraging users to add commands to the core namespace is a reasonable restriction — except in some rare cases, e.g., And to be extra clear my views are that extending any core group namespace should not be allowed. So NO to both |
Just FYI - I don't see the need for the config flag - seems like an unnecessary burden on people. IMO it would have only been needed if we allowed people to override core kn cmds |
I guess I added the flag because of how much I hate this feature overall :) However, since I lost the vote, sure. I can remove the unnecessary burden. Comment here @rhuss, @navidshaikh, @dsimansk (the ones who voted) if you are not OK for no config flag. No comment => @duglin wins and no config flag. |
Feature request
PR #818 allows extensions to the
source
command group. This is needed sincekn
has core commands undersource
to support some eventing sources, e.g.,ping
. However, since the number of variety of eventing sources is large and growing, we envisioned additional eventing source support to be added as plugins. See for instance thesource kafka
andsource github
and other plugins being developed inclient-contrib
repository.So the question then comes up should we generalize support for extending and overriding of core commands. This was raised by @navidshaikh and @rhuss. And proposed by Navid in comments to PR #818.
While both sides of the issues are useful. Before implementing we will use this issue to discuss and eventually vote a direction. So watch for the comment with pole for voting below once we have agreement on the feature request.
Use case
There are two principle use cases:
As a
kn
user and developer, I would like to add a new command to an existing command group via a plugin. For instance, adebug
command to the coreservice
command group.As a
kn
user and developer, I would like to override an existing command with my own implementation via a plugin. So imagine you have afancy-create
command forservice
that allows some extra decorations to services and other features when user callscreate
. You would like to have user callkn service create
vskn service fancy-create
.Please note that use case 2 extends on use case 1. So use case 2 can only exist if we allow use case 1.
UI Example
The text was updated successfully, but these errors were encountered: