Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Bump Cobra from 1.5.0 to 1.6.1 #3695

Closed
wants to merge 1 commit into from

Conversation

marckhouzam
Copy link
Contributor

@marckhouzam marckhouzam commented Oct 18, 2022

What this PR does / why we need it

This PR bumps to Cobra 1.6.1 which was recently released: https://github.com/spf13/cobra/releases/tag/v1.6.1
There is nothing really major in this new release, but it does have bug fixes and a couple of new features. We should keep up to date.

Describe testing done for PR

Let CI run

Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

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

lgtm, assuming CI checks out

@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3695/20221018163755/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@marckhouzam
Copy link
Contributor Author

This just needs the ok-to-merge label and it's good to go.

@randomvariable randomvariable added ok-to-merge PRs should be labelled with this before merging and removed ok-to-merge PRs should be labelled with this before merging labels Oct 20, 2022
@randomvariable
Copy link
Contributor

Let's get #3699 in first if we can

@marckhouzam
Copy link
Contributor Author

Let's get #3699 in first if we can

Sure, let's wait. No particular hurry for the Cobra upgrade.

@marckhouzam marckhouzam added the do-not-merge/hold Some fixes necessary, hold for merging label Oct 20, 2022
@marckhouzam marckhouzam changed the title Bump Cobra from 1.5.0 to 1.6.0 Bump Cobra from 1.5.0 to 1.6.1 Oct 25, 2022
@marckhouzam
Copy link
Contributor Author

I've updated the PR to move to Cobra 1.6.1 instead of 1.6.0 which was released yesterday

@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3695/20221025154706/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Merging #3695 (53aee7e) into main (2f9044a) will decrease coverage by 0.90%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3695      +/-   ##
==========================================
- Coverage   46.93%   46.03%   -0.91%     
==========================================
  Files         402      427      +25     
  Lines       40203    41754    +1551     
==========================================
+ Hits        18869    19221     +352     
- Misses      19582    20765    +1183     
- Partials     1752     1768      +16     
Impacted Files Coverage Δ
...ons/controllers/packageinstallstatus_controller.go 79.15% <0.00%> (ø)
cmd/cli/plugin/cluster/osimage.go 100.00% <0.00%> (ø)
cmd/cli/plugin/cluster/set_machinehealthcheck.go 23.33% <0.00%> (ø)
cmd/cli/plugin/cluster/machinehealthcheck.go 100.00% <0.00%> (ø)
cmd/cli/plugin/cluster/get_machinehealthcheck.go 11.42% <0.00%> (ø)
cmd/cli/plugin/cluster/create.go 42.22% <0.00%> (ø)
.../cli/plugin/cluster/get_machinehealthcheck_node.go 9.30% <0.00%> (ø)
cmd/cli/plugin/cluster/osimage_oracle.go 3.20% <0.00%> (ø)
cmd/cli/plugin/cluster/scale.go 17.85% <0.00%> (ø)
cmd/cli/plugin/cluster/delete_node_pool.go 16.66% <0.00%> (ø)
... and 17 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for updating this.

@marckhouzam
Copy link
Contributor Author

This PR is waiting for #3752 (which is replacing #3699) so we require yet another rebase from that PR.

@marckhouzam
Copy link
Contributor Author

#3752 was replaced by #3772 which is now merged, so we can go ahead with this PR here.

@marckhouzam marckhouzam removed the do-not-merge/hold Some fixes necessary, hold for merging label Nov 4, 2022
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3695/20221104200942/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3695/20221107133856/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

Copy link
Contributor

@anujc25 anujc25 left a comment

Choose a reason for hiding this comment

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

LGTM. But need to make sure all CI pipelines are successful before we merge this.

@anujc25
Copy link
Contributor

anujc25 commented Nov 8, 2022

Looks like some unit tests are failing as part of Main/Build CI

--- FAIL: TestKctrlInvoke (0.00s)
    --- FAIL: TestKctrlInvoke/Invoke (0.00s)
        --- FAIL: TestKctrlInvoke/Invoke/add_package_commands_from_kctrl (0.00s)
panic: Expected to find available commands section in spf13/cobra default usage template [recovered]
	panic: Expected to find available commands section in spf13/cobra default usage template

@marckhouzam
Copy link
Contributor Author

Looks like some unit tests are failing as part of Main/Build CI

--- FAIL: TestKctrlInvoke (0.00s)
    --- FAIL: TestKctrlInvoke/Invoke (0.00s)
        --- FAIL: TestKctrlInvoke/Invoke/add_package_commands_from_kctrl (0.00s)
panic: Expected to find available commands section in spf13/cobra default usage template [recovered]
	panic: Expected to find available commands section in spf13/cobra default usage template

Wow, thanks for finding this. I will look into it.

@marckhouzam
Copy link
Contributor Author

Looks like some unit tests are failing as part of Main/Build CI

--- FAIL: TestKctrlInvoke (0.00s)
    --- FAIL: TestKctrlInvoke/Invoke (0.00s)
        --- FAIL: TestKctrlInvoke/Invoke/add_package_commands_from_kctrl (0.00s)
panic: Expected to find available commands section in spf13/cobra default usage template [recovered]
	panic: Expected to find available commands section in spf13/cobra default usage template

So Framework's kctrl imports carvel-kapp-controller which in turns uses cppforlife which needs to be modified to accept a recent Cobra change. I will have to chase this down.

@marckhouzam marckhouzam added the do-not-merge/hold Some fixes necessary, hold for merging label Nov 8, 2022
We don't upgrade the 'package' plugin however, because it uses
github.com/vmware-tanzu/carvel-kapp-controller/cli/pkg/kctrl/cmd
which in turn uses github.com/cppforlife/cobrautil which panics when
using Cobra 1.6.  See cppforlife/cobrautil#7

Signed-off-by: Marc Khouzam <kmarc@vmware.com>
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3695/20221110021801/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@marckhouzam
Copy link
Contributor Author

marckhouzam commented Nov 14, 2022

I've made the CI pass by not bumping cobra for the package plugin because it first needs github.com/vmware-tanzu/carvel-kapp-controller/cli/pkg/kctrl/cmd to be fixed once github.com/cppforlife/cobrautil is fixed.

However, I am concerned that another plugin may have a similar problem, but that it is not triggered by CI.

I have posted a PR to fix github.com/cppforlife/cobrautil: cppforlife/cobrautil#8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-not-required do-not-merge/hold Some fixes necessary, hold for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants