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

Properly order dependencies in go.mod #17815

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

acumino
Copy link
Contributor

@acumino acumino commented Dec 16, 2023

Properly order dependencies in go.mod by removing everything and running go mod tidy.

Direct and Indirect dependencies should not be mixed in require block.

@k8s-ci-robot k8s-ci-robot requested a review from prezha December 16, 2023 16:42
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 16, 2023
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 16, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @acumino. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 16, 2023
@acumino
Copy link
Contributor Author

acumino commented Dec 16, 2023

/cc @spowelljr @afbjorklund

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@afbjorklund
Copy link
Collaborator

Some of the dependencies seem to have been reverted to older versions ?

Copy link
Collaborator

@afbjorklund afbjorklund left a comment

Choose a reason for hiding this comment

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

Probably do rearrangements and whitespaces separately from version changes?

@afbjorklund
Copy link
Collaborator

afbjorklund commented Dec 16, 2023

Rearranging the file like suggested should look more like this:

 go.mod | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

There should be no modifications to go.sum, for changing go.mod.

--- a/go.mod
+++ b/go.mod
@@ -79,9 +79,6 @@ require (
        k8s.io/utils v0.0.0-20230726121419-3b25d923346b
        libvirt.org/go/libvirt v1.9008.0
        sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.3.0
-)
-
-require (
        github.com/GoogleCloudPlatform/cloudsql-proxy v1.33.15
        github.com/Xuanwo/go-locale v1.1.0
        github.com/blang/semver v3.5.1+incompatible
@@ -95,9 +92,6 @@ require (
        github.com/moby/patternmatcher v0.6.0
        github.com/opencontainers/runc v1.1.10
        github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
-)
-
-require (
        cloud.google.com/go v0.110.10 // indirect
        cloud.google.com/go/compute v1.23.3 // indirect
        cloud.google.com/go/compute/metadata v0.2.3 // indirect

And then running go mod tidy again, to sort the modules.

It will organize by require, require //indirect, replace groups.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 16, 2023
@acumino acumino requested a review from afbjorklund December 16, 2023 18:30
@acumino
Copy link
Contributor Author

acumino commented Dec 16, 2023

@afbjorklund PTAL.

@spowelljr
Copy link
Member

Running the build now, but seems correct now

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acumino, afbjorklund

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 17, 2023
@spowelljr spowelljr merged commit 64406f0 into kubernetes:master Dec 18, 2023
25 of 26 checks passed
@acumino acumino deleted the reorder-gomod branch December 18, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants