openshift / openshift/source-to-image

Custom shell completions overrides default cobra completions

Open Beginner friendly
#1,277 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lifecycle/frozen
Dominant language
Go
Stars
2.5k
Forks
701
PR merge metrics
No merged PRs in 30d

Description

We found out in https://src.fedoraproject.org/rpms/source-to-image/pull-request/9 that source-to-image has custom code in https://github.com/openshift/source-to-image/blob/master/pkg/cmd/cli/cmd/completion.go that overrides cobra's default completion subcommand. Maybe this was necessary with older versions of cobra, but now, overriding this removes the ability to generate completions for fish and powershell which cobra supports, and also the custom code does not use cobra's native support for zsh completions — it instead seems to borrow old code from kubectl. Can this custom completion command be removed?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/cmd/cli/cmd/completion.go and inspect how the custom completion subcommand replaces Cobra's native command. Remove the override if Cobra now provides the required behavior, then verify that completion generation works for fish, powershell, and zsh.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.