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 repo completions #9421

Merged
merged 1 commit into from Aug 20, 2021

Conversation

marckhouzam
Copy link
Member

@marckhouzam marckhouzam commented Feb 27, 2021

What this PR does / why we need it:

This is part 2 of the implementation of HIP 008: https://github.com/helm/community/blob/master/hips/hip-0008.md
It is a follow-up to #9243

This PR adds descriptions to Helm's custom completions for repository names. Note that with #9990 these descriptions are available for every shell.
For example:

$ helm repo remove <TAB>
bitnami  -- https://charts.bitnami.com/bitnami
center   -- https://repo.chartcenter.io
stable   -- https://kubernetes-charts.storage.googleapis.com

$ helm install myrelease <TAB>
./                     -- Relative path prefix to local chart
/                      -- Absolute path prefix to local chart
bitnami/               -- https://charts.bitnami.com/bitnami
center/                -- https://repo.chartcenter.io
file://                -- Chart local URL prefix
grafana/               -- https://grafana.github.io/helm-charts
https://    http://    -- Chart URL prefix
oteemocharts/          -- https://oteemo.github.io/charts
stable/                -- https://charts.helm.sh/stable

$ helm show all <TAB>
bitnami  -- https://charts.bitnami.com/bitnami
center   -- https://repo.chartcenter.io
stable   -- https://kubernetes-charts.storage.googleapis.com

Special notes for your reviewer:

The remaining aspects of HIP 0008 are:

  • chart names - completion for chart names uses the special <repo>-charts.txt file, which currently does not contain enough information to provide a description for chart names
  • helm environment variables - will be done in its own PR as it is more complex

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 Feb 27, 2021
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 31, 2021
@marckhouzam marckhouzam changed the title Add descriptions to custom completions (part 2) Add descriptions to repo completions Jul 31, 2021
@marckhouzam
Copy link
Member Author

Now that we are on Cobra 1.2.1, I was able to add descriptions for repo name completions in all cases.

@marckhouzam marckhouzam added this to the 3.7.0 milestone Jul 31, 2021
Ref: HIP 0008

When completing a repo name, extra information will be shown.
For example:

$ helm repo remove <TAB>
bitnami  -- https://charts.bitnami.com/bitnami
center   -- https://repo.chartcenter.io
stable   -- https://kubernetes-charts.storage.googleapis.com

$ helm install myrelease <TAB>
./                              -- Relative path prefix to local chart
/                               -- Absolute path prefix to local chart
bitnami/                        -- https://charts.bitnami.com/bitnami
center/                         -- https://repo.chartcenter.io
file://                         -- Chart local URL prefix
grafana/                        -- https://grafana.github.io/helm-charts
https://               http://  -- Chart URL prefix
oteemocharts/                   -- https://oteemo.github.io/charts
prometheus-community/           -- https://prometheus-community.github.io/helm-charts
stable/                         -- https://charts.helm.sh/stable

$ helm show all <TAB>
bitnami  -- https://charts.bitnami.com/bitnami
center   -- https://repo.chartcenter.io
stable   -- https://kubernetes-charts.storage.googleapis.com

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
@marckhouzam
Copy link
Member Author

marckhouzam commented Aug 3, 2021

I've rebased this PR to get #9990. The new descriptions added with this PR can now be tested with bash.

bash-5.1$ source <(bin/helm completion bash)
bash-5.1$ bin/helm repo update <TAB>
bitnami               (https://charts.bitnami.com/bitnami)
hashicorp             (https://helm.releases.hashicorp.com)
prometheus-community  (https://prometheus-community.github.io/helm-charts)
stable                (https://charts.helm.sh/stable)

@marckhouzam
Copy link
Member Author

Thanks @bacongobbler !

@marckhouzam marckhouzam merged commit e2836ff into helm:main Aug 20, 2021
@marckhouzam marckhouzam deleted the feat/compDescPart2 branch August 20, 2021 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants