-
Notifications
You must be signed in to change notification settings - Fork 255
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
Drop cobra fork and rework the shell completion system #1268
Drop cobra fork and rework the shell completion system #1268
Conversation
Signed-off-by: Chmouel Boudjnah <[email protected]>
772809c
to
f1b6747
Compare
The following is the coverage report on the affected files.
|
/hold |
f1b6747
to
dea7211
Compare
The following is the coverage report on the affected files.
|
There is as way to get inline completion for flags, i.e: --service-account to complete the serviceaccount as we had before, this is the example from the helm sources :
Update: I have added support for it in latest iteration and amended it. Ready for review this one to make it easier... /hold cancel |
We probably going to have to figure how to do this with |
cc @mattmoor |
dea7211
to
cf95e13
Compare
The following is the coverage report on the affected files.
|
cf95e13
to
e58d281
Compare
The following is the coverage report on the affected files.
|
e58d281
to
706a1b6
Compare
Adapted the completion we had previously to the new completion system from cobra 1.0. I started to use the client-go directly but since there is no caching, the <Tab><Tab> is unusably slow. So using the kuebctl binrary directly instead (I can't use tkn since caching is not there as well) to get the completions. This is how we were doing it previously (using kubectl or tkn) and completions should be much faster. We are winning support for other shells (powershell, fish) along the way an d not having an outdated fork in tree. Signed-off-by: Chmouel Boudjnah <[email protected]>
706a1b6
to
937ac94
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/approve |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: piyush-garg, pradeepitm12 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#1274 | [Chmouel Boudjnah] Update README to 0.15.0 | 2020/12/17-12:06 #1271 | [Chmouel Boudjnah] Use python3 binary instead of python or we won't find it | 2020/12/17-12:34 #1149 | [Veeresh Aradhya] Fixing clustertask e2e tests | 2020/12/19-07:32 #1149 | [Veeresh Aradhya] Addressing review comments | 2020/12/19-07:32 #1149 | [Veeresh Aradhya] Rebasing and updating code | 2020/12/19-07:32 #1272 | [Chmouel Boudjnah] Debian package: Do not use tkn version as a check | 2020/12/20-03:17 #1276 | [Piyush Garg] Refactor e2e scripts and fix tests | 2020/12/21-15:00 #1268 | [Chmouel Boudjnah] Drop chmouels fork and use latest cobra upstream | 2020/12/23-08:11 #1268 | [Chmouel Boudjnah] Add new completions based on new upstream completion system | 2020/12/23-08:11 #1277 | [Daniel Helfand] fix tkn version with no kubeconfig | 2021/01/05-09:29 null | [Dan Chao] Add support for showing logs for retried taskruns | 2021/01/14-05:19 null | [vinamra28] Support --clustertask Option for tkn tr delete | 2021/01/15-05:43 null | [Rupali] `tkn completion` command will bail out if something else is passed apart from expected args Modified unit test as required | 2021/01/21-17:33 null | [Chmouel Boudjnah] Add information to the README about homebrew on linux | 2021/02/02-14:41 null | [vinamra28] Update TaskRun Tests from Test Builders to Structs | 2021/02/04-12:24 null | [vinamra28] Fix eventlistener manifests as per latest triggers | 2021/02/04-12:24 null | [vinamra28] Update Task Tests from Test Builders to Structs | 2021/02/04-13:36 null | [Piyush Garg] Bump pipeline dep to v0.20.1 | 2021/02/05-06:04 null | [Piyush Garg] Update trigger dep to v0.11.2 | 2021/02/08-09:06 Signed-off-by: Piyush Garg <[email protected]>
Changes
Adapted the completion we had previously to the new completion system from
cobra 1.0.
I started to use the client-go directly but since there is no caching, the
is not very usuable since super slow. So using the kuebctl binrary directly instead
(I can't use tkn since caching is not there as well) to get the
completions.
This is how we were doing it previously (using kubectl or tkn) and
completions should be much faster. And bonus, we have some proper completion for powershell/fish and others added for free. (not tested).
It doesn't pickup the completion on
tkn hub
, so we wil need to figure out on how to do this for commands that gets pulled up by deps.Note: this PR has two diffsets on purpose, to make it easier to review/track
history. The split is between updating the new library and the second split to
add all completions to all commands.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make check
make generated
Release Notes