-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Qualify custom bash func name #730
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- fixes issue where multiple cobra apps using custom bash completion would have their __custom_func collide - support fallback to plain __custom_func to maintain compatibility spf13#694
I think the best way to test would be to define a custom func and then just do a string search to see if it shows up twice in the output... (Once for the actual func def, and once for the call to it?) Also need the CLA. |
- check for the correct number of occurrences of function name spf13#694
Signed CLA and improved the tests. |
ghost
mentioned this pull request
Dec 19, 2018
marckhouzam
added a commit
to VilledeMontreal/helm
that referenced
this pull request
Apr 29, 2019
The version of Cobra used in dev-v3 is older than the one used for the master branch (helm v2). Although the dev-v3 branch was based on master and therefore had the same Cobra version originally, it was changed a couple of times to choose Cobra tagged versions instead. However, the latest Cobra tagged version is older than the version of Cobra used on the master branch. Therefore, some of the improvements made to Cobra and used by helm v2 are not available to helm v3 currently. This commit brings Cobra to its latest available commit for helm v3. Originally, I thought of selecting the same Cobra version in v3 as for helm v2, but after reviewing the 5 extra commits added to Cobra, I feel it is safe and valuable to bring them in also. Bringing Cobra up-to-date is essential for upcoming work being prepared for dynamic bash-completion; there are bug fixes in Cobra that are necessary for dynamic bash-completion to work properly. Specifically, spf13/cobra#730 which fixes spf13/cobra#694 is essential to avoid the risk of colliding and possibly breaking kubectl dynamic bash-completion once helm v3 has its own dynamic completion. Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
3 tasks
This was referenced May 7, 2019
Closed
Closed
marckhouzam
added a commit
to VilledeMontreal/helm
that referenced
this pull request
May 7, 2019
This commit forces ([[override]]) the version of Cobra to the tip of master. The latest tagged release of Cobra is one week shy of being a year old and is missing important fixes. An override is necessary because the Kustomize package requires a tagged version, so a [[constraint]] is rejected by dep. The version of Cobra used in dev-v3 is older than the one used for the master branch (helm v2). Although the dev-v3 branch was based on master and therefore had the same Cobra version originally, it was changed a couple of times to choose Cobra tagged versions instead. However, the latest Cobra tagged version is older than the version of Cobra used on the master branch. Therefore, some of the improvements made to Cobra and used by helm v2 are not available to helm v3 currently. This commit brings Cobra to its latest available commit for helm v3. Originally, I thought of selecting the same Cobra version in v3 as for helm v2, but after reviewing the 5 extra commits added to Cobra, I felt it was safe and valuable to bring them in also. Bringing Cobra up-to-date is essential for upcoming work being prepared for dynamic bash-completion; there are bug fixes in Cobra that are necessary for dynamic bash-completion to work properly. Specifically, spf13/cobra#730 which fixes spf13/cobra#694 is essential to avoid the risk of colliding and possibly breaking kubectl dynamic bash-completion once helm v3 has its own dynamic completion. Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
marckhouzam
added a commit
to VilledeMontreal/helm
that referenced
this pull request
May 19, 2019
The version of Cobra used in dev-v3 is older than the one used for the master branch (helm v2). Although the dev-v3 branch was based on master and therefore had the same Cobra version originally, it was changed a couple of times to choose Cobra tagged versions instead. However, the currently used 0.0.3 version of Cobra is older than the version of Cobra used on the master branch. Therefore, some of the improvements made to Cobra and used by helm v2 are not available to helm v3 currently. This commit brings Cobra to its latest available version of 0.0.4. Bringing Cobra up-to-date is essential for upcoming work being prepared for dynamic bash-completion; there are bug fixes in Cobra that are necessary for dynamic bash-completion to work properly. Specifically, spf13/cobra#730 which fixes spf13/cobra#694 is essential to avoid the risk of colliding and possibly breaking kubectl dynamic bash-completion once helm v3 has its own dynamic completion. Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
marckhouzam
added a commit
to VilledeMontreal/helm
that referenced
this pull request
Jun 3, 2019
The version of Cobra used in dev-v3 is older than the one used for the master branch (helm v2). Although the dev-v3 branch was based on master and therefore had the same Cobra version originally, it was changed a couple of times to choose Cobra tagged versions instead. However, the currently used 0.0.3 version of Cobra is older than the version of Cobra used on the master branch. Therefore, some of the improvements made to Cobra and used by helm v2 are not available to helm v3 currently. This commit brings Cobra to its latest available version of 0.0.4. Bringing Cobra up-to-date is essential for upcoming work being prepared for dynamic bash-completion; there are bug fixes in Cobra that are necessary for dynamic bash-completion to work properly. Specifically, spf13/cobra#730 which fixes spf13/cobra#694 is essential to avoid the risk of colliding and possibly breaking kubectl dynamic bash-completion once helm v3 has its own dynamic completion. Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
would have their __custom_func collide
#694
I tested this with a cobra app I'm developing locally and had success. I'm not totally sure how write automated tests for it other than the changes I made.