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

Update Cobra from 1.2.1 to 1.3.0 #107628

Closed
wants to merge 1 commit into from

Conversation

brianpursley
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR upgrades cobra from version 1.2.1 to 1.3.0.

This will be helpful for kubectl for a few reasons:

Which issue(s) this PR fixes:

Fixes kubernetes/kubectl#1166

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. labels Jan 19, 2022
@k8s-ci-robot k8s-ci-robot added sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 19, 2022
@brianpursley
Copy link
Member Author

/cc @eddiezane
/cc @marckhouzam

@k8s-ci-robot
Copy link
Contributor

@brianpursley: GitHub didn't allow me to request PR reviews from the following users: marckhouzam.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @eddiezane
/cc @marckhouzam

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 19, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: brianpursley
To complete the pull request process, please ask for approval from liggitt after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@brianpursley
Copy link
Member Author

Hmm, unit tests are passing locally. Maybe a flake.

/retest

@enj enj added this to Needs Triage in SIG Auth Old Jan 24, 2022
@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 25, 2022
@liggitt
Copy link
Member

liggitt commented Feb 8, 2022

I think it is due to cobra's dependency on a newer version of viper, which has a large number of dependencies.

yeah... that might be something to keep on the back burner to investigate a way to isolate / drop ...

@liggitt
Copy link
Member

liggitt commented Feb 8, 2022

/test pull-kubernetes-dependencies

@@ -332,22 +332,21 @@ replace (
github.com/liggitt/tabwriter => github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
github.com/lithammer/dedent => github.com/lithammer/dedent v1.1.0
github.com/lpabon/godbc => github.com/lpabon/godbc v0.1.1
github.com/lyft/protoc-gen-star => github.com/lyft/protoc-gen-star v0.5.3
Copy link
Member

Choose a reason for hiding this comment

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

what is pulling this in? another proto generation tool increases likelihood of selecting incompatible transitive protobuf libraries

Copy link
Member

@eddiezane eddiezane Feb 8, 2022

Choose a reason for hiding this comment

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

github.com/cespare/xxhash/v2 => github.com/cespare/xxhash/v2 v2.1.2
github.com/chai2010/gettext-go => github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5
github.com/checkpoint-restore/go-criu/v5 => github.com/checkpoint-restore/go-criu/v5 v5.0.0
github.com/chzyer/logex => github.com/chzyer/logex v1.1.10
github.com/chzyer/readline => github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
github.com/chzyer/test => github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1
github.com/cilium/ebpf => github.com/cilium/ebpf v0.6.2
github.com/circonus-labs/circonus-gometrics => github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible
Copy link
Member

Choose a reason for hiding this comment

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

github.com/hashicorp/go-cleanhttp => github.com/hashicorp/go-cleanhttp v0.5.1
github.com/hashicorp/go-immutable-radix => github.com/hashicorp/go-immutable-radix v1.0.0
github.com/hashicorp/go-cleanhttp => github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-hclog => github.com/hashicorp/go-hclog v1.0.0
Copy link
Member

Choose a reason for hiding this comment

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

new

github.com/hashicorp/go-multierror => github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/go-rootcerts => github.com/hashicorp/go-rootcerts v1.0.0
github.com/hashicorp/go-multierror => github.com/hashicorp/go-multierror v1.1.0
github.com/hashicorp/go-retryablehttp => github.com/hashicorp/go-retryablehttp v0.5.3
Copy link
Member

Choose a reason for hiding this comment

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

new

go.mod Show resolved Hide resolved
go.mod Show resolved Hide resolved
google.golang.org/grpc => google.golang.org/grpc v1.40.0
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
google.golang.org/grpc => google.golang.org/grpc v1.42.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc => google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
Copy link
Member

Choose a reason for hiding this comment

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

same question about what is pulling this in?

@marckhouzam
Copy link
Member

I think it is due to cobra's dependency on a newer version of viper, which has a large number of dependencies.

yeah... that might be something to keep on the back burner to investigate a way to isolate / drop ...

So kubernetes doesn't use Viper directly correct? And removing the dependency to Viper would have benefits for kubernetes?

If so, I will discuss this with the Cobra maintainers and see if there's anything that can be done.

@eddiezane
Copy link
Member

I think it is due to cobra's dependency on a newer version of viper, which has a large number of dependencies.

yeah... that might be something to keep on the back burner to investigate a way to isolate / drop ...

So kubernetes doesn't use Viper directly correct? And removing the dependency to Viper would have benefits for kubernetes?

If so, I will discuss this with the Cobra maintainers and see if there's anything that can be done.

If that could happen it would cut down on a ton of transitive deps for us.

ref: #102598

@liggitt
Copy link
Member

liggitt commented Feb 8, 2022

Yeah, we dropped direct dependence on Viper in that PR, but we still have a transitive dependency on it, which adds a lot to our dependency graph. https://github.com/muesli/coral is an interesting proof-of-concept that tracks head of cobra and drops the viper dep. Since some of our deps use cobra though, I think the viper dependency would have to be made optional in cobra itself for it to benefit us:

go mod graph | grep " github.com/spf13/cobra" | grep -v k8s.io
github.com/coredns/corefile-migration@v1.0.14 github.com/spf13/cobra@v1.1.3
github.com/containerd/continuity@v0.1.0 github.com/spf13/cobra@v1.0.0
go.etcd.io/etcd/server/v3@v3.5.0 github.com/spf13/cobra@v1.1.3
go.etcd.io/etcd/pkg/v3@v3.5.0 github.com/spf13/cobra@v1.1.3

@jpmcb
Copy link
Member

jpmcb commented Feb 8, 2022

Hi all - I was pointed to this PR from some people in the cobra community. From what I gather, we need to remove the transient dependencies on Viper so that the dependencies resolve correctly?

@liggitt
Copy link
Member

liggitt commented Feb 8, 2022

Hi all - I was pointed to this PR from some people in the cobra community. From what I gather, we need to remove the transient dependencies on Viper so that the dependencies resolve correctly?

The dependencies are resolving correctly, but are steadily increasing beyond acceptable levels because of the viper transitive dependency.

@liggitt
Copy link
Member

liggitt commented Feb 8, 2022

The dependencies are resolving correctly, but are steadily increasing beyond acceptable levels because of the viper transitive dependency.

I'll be filing an issue in the cobra repo with a request to isolate the viper dependencies used only by the cobra command, with some suggestions/considerations based on our experience isolating dependencies for the cadvisor command (google/cadvisor#2437)

@liggitt
Copy link
Member

liggitt commented Feb 8, 2022

I'll be filing an issue in the cobra repo with a request to isolate the viper dependencies used only by the cobra command, with some suggestions/considerations based on our experience isolating dependencies for the cadvisor command (google/cadvisor#2437)

opened spf13/cobra#1597

@marckhouzam
Copy link
Member

Do you guys still plan to go ahead with upgrading to Cobra 1.3 or do you want to wait for the next release of Cobra which will remove the dependency on Viper?
Some Cobra 1.3 features could be used right away (completion description for Bash), and others would unblock other PRs (completion for plugins #105867).

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 21, 2022
@k8s-ci-robot
Copy link
Contributor

@brianpursley: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dims
Copy link
Member

dims commented Feb 21, 2022

@marckhouzam i'd rather wait until viper is out.

@liggitt
Copy link
Member

liggitt commented Mar 10, 2022

FYI, the viper dependency has been dropped from cobra HEAD in spf13/cobra#1604, and cobra v1.4.0 will be tagged shortly. Once it is, this can be updated to cobra v1.4.0 🎉

I imagine it will be easier to reset against master and redo the update, since the bump will be dropping a bunch of viper-only dependencies instead of requiring updates to them (there may still be updates to other existing things, which could be ok, but I'd expect fewer new deps)

@marckhouzam
Copy link
Member

FYI, the viper dependency has been dropped from cobra HEAD in spf13/cobra#1604, and cobra v1.4.0 will be tagged shortly. Once it is, this can be updated to cobra v1.4.0 🎉

Thanks @liggitt for working with Cobra to make this happen. It will benefit a whole bunch of projects 🎉

@jpmcb
Copy link
Member

jpmcb commented Mar 10, 2022

Hi all - Just cut v1.4.0

https://github.com/spf13/cobra/releases/tag/v1.4.0

Feel free to tag me if there's any needed cobra support 🐍 🚀 🌔


And thank you all for the support in making this happen! Big shoutout to @liggitt for the in depth proposal and help on this!

@dims
Copy link
Member

dims commented Mar 10, 2022

thanks a ton @liggitt @jpmcb !!

@brianpursley
Copy link
Member Author

Closing this PR.

It sounds like @liggitt may open a PR to upgrade to Cobra 1.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging this pull request may close these issues.

Update Cobra to version 1.3.0
8 participants