Skip to content
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

Add descriptions to custom completions (part 1) #9243

Merged
merged 6 commits into from
Feb 24, 2021

Conversation

marckhouzam
Copy link
Member

@marckhouzam marckhouzam commented Jan 17, 2021

What this PR does / why we need it:

This is part 1 of the implementation of HIP 008: https://github.com/helm/community/blob/master/hips/hip-0008.md

For the zsh and fish shells, this PR adds descriptions to Helm's custom completions to make them more informative to the the user. Specifically:

  • release names
$ helm history n<TAB>
nginx   -- nginx-6.0.2 -> deployed
nginx2  -- nginx-ingress-1.41.2 -> deployed
  • plugin names
$ helm plugin uninstall <TAB>
2to3        -- migrate and cleanup Helm v2 configuration and releases in-place to Helm v3
diff        -- Preview helm upgrade changes as a diff
fullstatus  -- provide status of resources part of the release
github      -- Install or upgrade Helm charts from GitHub repos
  • kubernetes contexts
$ helm --kube-context <TAB>
acc     -- accept
default -- k3d-k3s-default
lab     -- lab
lab2    -- cluster.local
  • release revisions
$ helm get manifest nginx --revision <TAB>
1  -- App: 1.19.1, Chart: nginx-6.0.2
2  -- App: v0.34.1, Chart: nginx-ingress-1.41.2
  • chart versions
$ helm upgrade nginx stable/grafana --version <TAB>
0.8.4   -- Created: March 30, 2018
0.8.5   -- App: 5.0.4, Created: April 10, 2018
1.0.0   -- App: 5.0.4, Created: April 11, 2018 (deprecated)
1.10.0  -- App: 5.1.2, Created: June 1, 2018
  • output formats
$ helm status -o <TAB>
json   -- Output result in JSON format
table  -- Output result in human-readable format
yaml   -- Output result in YAML format

Special notes for your reviewer:

This is part 1 of HIP 0008 because the remaining aspects require a little more discussion, so I thought I would do them in a separate PR:

If applicable:

  • this PR contains unit tests

@helm-bot helm-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 17, 2021
@marckhouzam marckhouzam force-pushed the feat/compDescriptions branch 2 times, most recently from 6cc8c6a to 1d3d961 Compare February 16, 2021 20:43
Copy link
Member

@bacongobbler bacongobbler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Ref: HIP 0008

When completing a release name, extra information will be shown for
shells that support completions (fish, zsh).  For example, if I have
two releases: "nginx" and "nginx2", completion would yield:

$ helm history n<TAB>
nginx   -- nginx-6.0.2 -> deployed
nginx2  -- nginx-ingress-1.41.2 -> deployed

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Ref: HIP 0008

When completing a plugin name, extra information will be shown for
shells that support completions (fish, zsh).  For example:

$ helm plugin uninstall <TAB>
2to3             -- migrate and cleanup Helm v2 configuration and releases in-place to Helm v3
diff             -- Preview helm upgrade changes as a diff
fullstatus       -- provide status of resources part of the release
github           -- Install or upgrade Helm charts from GitHub repos

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Ref: HIP 0008

When completing a kube-context, extra information will be shown for
shells that support completions (fish, zsh).  For example:

$ helm --kube-context <TAB>
acc       -- accept
default   -- k3d-k3s-default
lab       -- lab
lab2      -- cluster.local

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Ref: HIP 0008

When completing a revision, extra information will be shown for
shells that support completions (fish, zsh).  For example:

$ helm get manifest nginx --revision <TAB>
1  -- App: 1.19.1, Chart: nginx-6.0.2
2  -- App: v0.34.1, Chart: nginx-ingress-1.41.2

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Ref: HIP 0008

When completing a version, extra information will be shown for
shells that support completions (fish, zsh).  For example:

$ helm upgrade nginx stable/grafana --version <TAB>
0.8.4   -- Created: March 30, 2018
0.8.5   -- App: 5.0.4, Created: April 10, 2018
1.0.0   -- App: 5.0.4, Created: April 11, 2018 (deprecated)
1.10.0  -- App: 5.1.2, Created: June 1, 2018

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
Ref: HIP 0008

When completing output formats, extra information will be shown
for shells that support completions (fish, zsh).  For example:

$ helm status -o <TAB>
json   -- Output result in JSON format
table  -- Output result in human-readable format
yaml   -- Output result in YAML format

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
@marckhouzam marckhouzam force-pushed the feat/compDescriptions branch from 1d3d961 to 593b267 Compare February 24, 2021 17:03
@marckhouzam
Copy link
Member Author

The force push was simply a rebase to resolve conflicts.

@marckhouzam marckhouzam merged commit ea5d5b6 into helm:master Feb 24, 2021
@marckhouzam marckhouzam deleted the feat/compDescriptions branch February 24, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants