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

feat: make InitDefaultCompletionCmd public #1467

Merged
merged 6 commits into from Oct 10, 2022

Conversation

gssbzn
Copy link
Contributor

@gssbzn gssbzn commented Aug 3, 2021

closes #1464

I also took the liberty to directly call it when generating docs as it seems that was already the case for InitDefaultHelpCmd

@CLAassistant
Copy link

CLAassistant commented Aug 3, 2021

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/docs-generation Generation of docs via Cobra label Aug 3, 2021
Copy link
Collaborator

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

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

Although I am not familiar with the details of the documentation generation code, this change does seem appropriate, and all the existing tests keep passing.

@github-actions
Copy link

This PR is being marked as stale due to a long period of inactivity

@gssbzn
Copy link
Contributor Author

gssbzn commented Oct 28, 2021

Random comment to make the bot not close this PR

umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 5, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 15, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Nov 16, 2021
@jpmcb
Copy link
Collaborator

jpmcb commented Dec 7, 2021

Hmmm I want to take a second to think about this one quick before merging.

We'd be changing the completions API to include a new Init that was once private but not changing the existing API that would constitute a breaking change?

@jpmcb jpmcb added this to the 1.3.0 milestone Dec 7, 2021
@jpmcb jpmcb removed the kind/stale label Dec 7, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Dec 7, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Dec 7, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Dec 7, 2021
umarcor pushed a commit to umarcor/cobra that referenced this pull request Dec 7, 2021
@gssbzn
Copy link
Contributor Author

gssbzn commented Dec 8, 2021

but not changing the existing API that would constitute a breaking change?

Right now calling cmd.InitDefaultCompletionCmd() inside the different Gen commands could be seen as a breaking change I could give you that, I'm happy to rollback that change if that gets this merged, at least having InitDefaultCompletionCmd public would reduce a lot of the hacking we have in place to be able to generate docs for the auto complete commands

@jpmcb
Copy link
Collaborator

jpmcb commented Dec 8, 2021

This all looks good to me, but I think just for stability, this needs to wait for a 2.0 release. Since technically the API change would be a breaking change. If there's one thing I hate, it's surprising users with unexpected breaking changes 😂

Otherwise, I think this implementation makes perfect sense.

@jpmcb jpmcb modified the milestones: 1.3.0, 2.0.0 Dec 8, 2021
@jpmcb jpmcb added the area/shell-completion All shell completions label Dec 8, 2021
@marckhouzam
Copy link
Collaborator

marckhouzam commented Dec 8, 2021

We'd be changing the completions API to include a new Init that was once private but not changing the existing API that would constitute a breaking change?

I'm not understanding well. Adding a new public function does not break the API, does it? We've added a bunch of public functions and constants when we added Go shell completions...

umarcor pushed a commit to umarcor/cobra that referenced this pull request Dec 8, 2021
@github-actions
Copy link

github-actions bot commented Feb 7, 2022

This PR is being marked as stale due to a long period of inactivity

@johnSchnake
Copy link
Collaborator

The exported method itself shouldn't be breaking unless I'm misunderstanding something. @jpmcb if he removes the addition to the method and just exports the method, is this good to merge?

@github-actions github-actions bot added size/XS Denotes a PR that changes 0-9 lines and removed area/shell-completion All shell completions labels May 4, 2022
@github-actions github-actions bot removed the area/docs-generation Generation of docs via Cobra label May 4, 2022
@gssbzn
Copy link
Contributor Author

gssbzn commented May 4, 2022

@marckhouzam @jpmcb I've removed the calls to document the completion command from the default docs in the hope that this change makes it for the spring release, let me know if there's something else of concern here

@marckhouzam marckhouzam modified the milestones: 2.0.0, 1.6.0 Oct 1, 2022
@jpmcb
Copy link
Collaborator

jpmcb commented Oct 4, 2022

I'm not understanding well. Adding a new public function does not break the API, does it? We've added a bunch of public functions and constants when we added Go shell completions...

You're right - I was being overly cautious; thanks for the feedback all

Copy link
Collaborator

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

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

If possible, and if @gssbzn has the bandwidth, I'd like to see a bit of documentation around this now that we'll be making it a public method. Otherwise, we can address that in subsequent PRs

@gssbzn
Copy link
Contributor Author

gssbzn commented Oct 5, 2022

@jpmcb what kind of documentation were you looking for? when to use? would documenting in the different *.md files for /doc enough?

@github-actions github-actions bot added the area/docs-generation Generation of docs via Cobra label Oct 5, 2022
@marckhouzam marckhouzam merged commit 8607918 into spf13:main Oct 10, 2022
@gssbzn gssbzn deleted the InitDefaultCompletionCmd branch October 11, 2022 07:45
hoshsadiq pushed a commit to zulucmd/zulu that referenced this pull request Dec 31, 2022
I also took the liberty to directly call it when generating docs as
it seems that was already the case for `InitDefaultHelpCmd`

Merge spf13/cobra#1467

closes #1464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs-generation Generation of docs via Cobra size/XS Denotes a PR that changes 0-9 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Making initCompleteCmd exported so completion commands can be documented
5 participants